merge code
This commit is contained in:
parent
48e3e7817c
commit
13f835f467
@ -31,8 +31,8 @@ android {
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
sourceSets {
|
||||
main {
|
||||
|
@ -3,9 +3,7 @@ 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
|
||||
@ -29,6 +27,4 @@ abstract class BaseHandler(context: AppCompatActivity, mapView: NIMapView) {
|
||||
fun removeOnMapClickListener() {
|
||||
mMapView.setOnMapClickListener(null)
|
||||
}
|
||||
|
||||
abstract fun <T> mutableListOf(): MutableList<GeoPoint>
|
||||
}
|
@ -196,7 +196,7 @@ open class LayerManagerHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
itemizedLayer =
|
||||
MyItemizedLayer(
|
||||
mMapView.vtmMap,
|
||||
mutableListOf<Any>(),
|
||||
mutableListOf(),
|
||||
markerRendererFactory,
|
||||
object : MyItemizedLayer.OnItemGestureListener {
|
||||
override fun onItemSingleTapUp(
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.navinfo.collect.library.map.handler
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.BitmapFactory
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
|
@ -180,10 +180,10 @@ open class PolygonHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
//编辑点
|
||||
if (editIndex > -1) {
|
||||
if (mPolygonLayer.points.size > 0) {
|
||||
val list: MutableList<GeoPoint> = mutableListOf<Any>()
|
||||
val list: MutableList<GeoPoint> = mutableListOf()
|
||||
list.addAll(mPolygonLayer.points)
|
||||
if (list.size > 3) {
|
||||
val newList: MutableList<GeoPoint> = mutableListOf<Any>()
|
||||
val newList: MutableList<GeoPoint> = mutableListOf()
|
||||
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<Any>()
|
||||
val newList2: MutableList<GeoPoint> = mutableListOf()
|
||||
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<Any>()
|
||||
val list2: MutableList<GeoPoint> = mutableListOf()
|
||||
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<Any>()
|
||||
val list: MutableList<GeoPoint> = mutableListOf()
|
||||
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<Any>()
|
||||
val points: MutableList<GeoPoint> = mutableListOf()
|
||||
points.addAll(mPolygonLayer.points)
|
||||
if (points.size > 2) {
|
||||
val list: MutableList<GeoPoint> = mutableListOf<Any>()
|
||||
val list: MutableList<GeoPoint> = mutableListOf()
|
||||
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<Any>()
|
||||
mutableListOf()
|
||||
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<Any>()
|
||||
mutableListOf()
|
||||
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<Any>()
|
||||
mutableListOf()
|
||||
list1.addAll(mPolygonLayer.points)
|
||||
list1.add(
|
||||
GeoPoint(
|
||||
|
Loading…
x
Reference in New Issue
Block a user