merge code

This commit is contained in:
qiji4215 2023-04-20 09:38:51 +08:00
parent 3d9ab011a8
commit 48e3e7817c
5 changed files with 15 additions and 15 deletions

View File

@ -81,9 +81,6 @@ dependencies {
implementation 'org.apache.poi:poi:5.2.3'
implementation 'org.apache.poi:poi-ooxml:5.2.3'
// spatialite文件
implementation 'com.github.sevar83:android-spatialite:2.0.1'
}
//
kapt {

View File

@ -3,7 +3,9 @@ package com.navinfo.collect.library.map.handler
import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import com.navinfo.collect.library.map.NIMapView
import org.oscim.core.GeoPoint
import org.oscim.layers.Layer
import org.oscim.layers.marker.MarkerItem
abstract class BaseHandler(context: AppCompatActivity, mapView: NIMapView) {
protected val mContext: AppCompatActivity = context
@ -27,4 +29,6 @@ abstract class BaseHandler(context: AppCompatActivity, mapView: NIMapView) {
fun removeOnMapClickListener() {
mMapView.setOnMapClickListener(null)
}
abstract fun <T> mutableListOf(): MutableList<GeoPoint>
}

View File

@ -196,7 +196,7 @@ open class LayerManagerHandler(context: AppCompatActivity, mapView: NIMapView) :
itemizedLayer =
MyItemizedLayer(
mMapView.vtmMap,
mutableListOf(),
mutableListOf<Any>(),
markerRendererFactory,
object : MyItemizedLayer.OnItemGestureListener {
override fun onItemSingleTapUp(

View File

@ -1,6 +1,5 @@
package com.navinfo.collect.library.map.handler
import android.content.Context
import android.graphics.BitmapFactory
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity

View File

@ -180,10 +180,10 @@ open class PolygonHandler(context: AppCompatActivity, mapView: NIMapView) :
//编辑点
if (editIndex > -1) {
if (mPolygonLayer.points.size > 0) {
val list: MutableList<GeoPoint> = mutableListOf()
val list: MutableList<GeoPoint> = mutableListOf<Any>()
list.addAll(mPolygonLayer.points)
if (list.size > 3) {
val newList: MutableList<GeoPoint> = mutableListOf()
val newList: MutableList<GeoPoint> = mutableListOf<Any>()
if (editIndex == 0) {
newList.add(list[list.size - 1])
newList.add(geoPoint)
@ -197,7 +197,7 @@ open class PolygonHandler(context: AppCompatActivity, mapView: NIMapView) :
newList.add(geoPoint)
newList.add(list[editIndex + 1])
}
val newList2: MutableList<GeoPoint> = mutableListOf()
val newList2: MutableList<GeoPoint> = mutableListOf<Any>()
for (i in editIndex + 1 until list.size) {
newList2.add(list[i])
}
@ -211,7 +211,7 @@ open class PolygonHandler(context: AppCompatActivity, mapView: NIMapView) :
}
if (editIndex < list.size) {
list.removeAt(editIndex)
val list2: MutableList<GeoPoint> = mutableListOf()
val list2: MutableList<GeoPoint> = mutableListOf<Any>()
list2.addAll(list)
list2.add(editIndex, geoPoint)
mPolygonLayer.setPoints(list2)
@ -224,7 +224,7 @@ open class PolygonHandler(context: AppCompatActivity, mapView: NIMapView) :
mEndpointLayer.addItem(markerItem)
mPathMakers.add(editIndex, markerItem)
mPathLayerTemp.setStyle(newTempStyle)
val list: MutableList<GeoPoint> = mutableListOf()
val list: MutableList<GeoPoint> = mutableListOf<Any>()
if (mPathMakers.size > 1) {
list.add(mPathMakers[0].geoPoint)
list.add(geoPoint)
@ -237,10 +237,10 @@ open class PolygonHandler(context: AppCompatActivity, mapView: NIMapView) :
}
editIndex = -1
} else { //新增点
val points: MutableList<GeoPoint> = mutableListOf()
val points: MutableList<GeoPoint> = mutableListOf<Any>()
points.addAll(mPolygonLayer.points)
if (points.size > 2) {
val list: MutableList<GeoPoint> = mutableListOf()
val list: MutableList<GeoPoint> = mutableListOf<Any>()
points.add(points[0])
list.add(points[0])
list.add(geoPoint)
@ -280,7 +280,7 @@ open class PolygonHandler(context: AppCompatActivity, mapView: NIMapView) :
if (mPolygonLayer.points.size > 0) {
if (editIndex > -1) {
val list: MutableList<GeoPoint> =
mutableListOf()
mutableListOf<Any>()
if (editIndex == 0 || editIndex == mPathMakers.size - 1) {
list.add(mPathMakers[editIndex].geoPoint)
list.add(
@ -303,7 +303,7 @@ open class PolygonHandler(context: AppCompatActivity, mapView: NIMapView) :
// crossText.setText("")
} else {
val list: MutableList<GeoPoint> =
mutableListOf()
mutableListOf<Any>()
if (mPolygonLayer.points.size > 1) {
list.add(mPolygonLayer.points[0])
list.add(
@ -329,7 +329,7 @@ open class PolygonHandler(context: AppCompatActivity, mapView: NIMapView) :
mPathLayerTemp.setPoints(list)
if (mPolygonLayer.points.size > 1) {
val list1: MutableList<GeoPoint> =
mutableListOf()
mutableListOf<Any>()
list1.addAll(mPolygonLayer.points)
list1.add(
GeoPoint(