[3.4.0-map-sdk] wait to finish
This commit is contained in:
@@ -28,17 +28,17 @@ public abstract class MogoBaseMapView extends FrameLayout implements ILifeCycle
|
||||
|
||||
public MogoBaseMapView( Context context, @Nullable AttributeSet attrs, int defStyleAttr ) {
|
||||
super( context, attrs, defStyleAttr );
|
||||
init( context );
|
||||
init( context,attrs );
|
||||
}
|
||||
|
||||
private void init( Context context ) {
|
||||
addMapView( context );
|
||||
private void init( Context context, AttributeSet attrs) {
|
||||
addMapView( context, attrs );
|
||||
if (mMapView != null){
|
||||
MogoMap.Companion.getMapInstance().initInstance( mMapView.getMap() , getInstanceTag());
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void addMapView( Context context );
|
||||
protected abstract void addMapView( Context context , AttributeSet attrs);
|
||||
|
||||
protected abstract String getInstanceTag();
|
||||
|
||||
@@ -85,7 +85,7 @@ public abstract class MogoBaseMapView extends FrameLayout implements ILifeCycle
|
||||
}
|
||||
}
|
||||
|
||||
public IMogoMap getMap() {
|
||||
protected IMogoMap getMap() {
|
||||
if ( mMapView != null ) {
|
||||
return mMapView.getMap();
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ class MogoMap private constructor() {
|
||||
|
||||
const val DEFAULT = "Default"
|
||||
|
||||
@JvmStatic
|
||||
val mapInstance by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
MogoMap()
|
||||
}
|
||||
@@ -19,7 +20,7 @@ class MogoMap private constructor() {
|
||||
private val mapCache = ConcurrentHashMap<String, IMogoMap>()
|
||||
|
||||
/**
|
||||
* 缓存多实例对象
|
||||
* 缓存多实例对象,instanceTag未指定默认给予DEFAULT
|
||||
*/
|
||||
fun initInstance(map: IMogoMap, instanceTag: String = DEFAULT) {
|
||||
if (mapCache.contains(instanceTag)) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.map.overlay
|
||||
|
||||
import com.mogo.map.MogoMap.Companion.DEFAULT
|
||||
import com.mogo.map.overlay.core.*
|
||||
import com.mogo.map.overlay.line.*
|
||||
import com.mogo.map.overlay.point.*
|
||||
@@ -8,7 +9,7 @@ import com.mogo.map.overlay.line.Polyline.Options as LineOptions
|
||||
|
||||
interface IMoGoOverlayManager {
|
||||
|
||||
fun showOrUpdatePoint(options: PointOptions): Point?
|
||||
fun showOrUpdatePoint(options: PointOptions, mapTag:String = DEFAULT): Point?
|
||||
|
||||
fun hidePoint(id: String)
|
||||
|
||||
@@ -38,7 +39,7 @@ interface IMoGoOverlayManager {
|
||||
|
||||
fun showPoint(id: String)
|
||||
|
||||
fun showOrUpdateLine(options: LineOptions): Polyline?
|
||||
fun showOrUpdateLine(options: LineOptions,mapTag:String = DEFAULT): Polyline?
|
||||
|
||||
fun hideLine(id: String)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user