[3.4.0-map-sdk] wait to finish

This commit is contained in:
zhongchao
2023-08-25 10:16:15 +08:00
parent db342e0bfc
commit 7865da2347
40 changed files with 404 additions and 648 deletions

View File

@@ -5,6 +5,7 @@ import com.mogo.eagle.core.data.map.*
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.call.map.*
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.map.MogoMap.Companion.DEFAULT
import com.mogo.map.overlay.point.Point.Options
import com.mogo.map.MogoMap.Companion.mapInstance
import com.mogo.map.overlay.core.*
@@ -20,7 +21,7 @@ internal class MoGoOverlayManagerImpl: IMoGoOverlayManager {
private val lines by lazy { ConcurrentHashMap<Polyline, IMapPolylineOverlay>() }
override fun showOrUpdatePoint(options: Options): Point? {
override fun showOrUpdatePoint(options: Options, mapTag:String): Point? {
synchronized(points) {
val key = Point(options.id, options.owner, options.level, options)
var point = points[key]
@@ -29,7 +30,7 @@ internal class MoGoOverlayManagerImpl: IMoGoOverlayManager {
point.setOptions(options)
return key
} else {
val p = mapInstance.getMogoMap().addPoint(options)
val p = mapInstance.getMogoMap(mapTag).addPoint(options)
if (p != null) {
p.onRemove { removed ->
val keys = points.filterKeys { it.id == removed }
@@ -223,7 +224,7 @@ internal class MoGoOverlayManagerImpl: IMoGoOverlayManager {
}
}
override fun showOrUpdateLine(options: Polyline.Options): Polyline? {
override fun showOrUpdateLine(options: Polyline.Options,mapTag:String): Polyline? {
synchronized(lines) {
val key = Polyline(options.id, options.owner, options.level, options)
var line = lines[key]
@@ -232,7 +233,7 @@ internal class MoGoOverlayManagerImpl: IMoGoOverlayManager {
line.setOptions(options)
return key
} else {
val newLine = mapInstance.getMogoMap().addLine(options)
val newLine = mapInstance.getMogoMap(mapTag).addLine(options)
if (newLine != null) {
newLine.onRemove { removed ->
val keys = lines.filterKeys { it.id == removed }