@@ -28,113 +28,75 @@ class MogoMapDelegateFactory {
|
||||
|
||||
private static final String TAG = "MogoMapDelegateFactory";
|
||||
|
||||
// private static boolean useCustom = false;
|
||||
//
|
||||
// public static boolean isUseCustom() {
|
||||
// return useCustom;
|
||||
// }
|
||||
|
||||
private static IMogoMapApiBuilder sApiBuilder;
|
||||
|
||||
private static IMogoMapApiBuilder getApiBuilder() {
|
||||
if ( sApiBuilder == null ) {
|
||||
synchronized ( MogoMapDelegateFactory.class ) {
|
||||
if ( sApiBuilder == null ) {
|
||||
sApiBuilder = ARouter.getInstance().navigation( IMogoMapApiBuilder.class );
|
||||
if (sApiBuilder == null) {
|
||||
synchronized (MogoMapDelegateFactory.class) {
|
||||
if (sApiBuilder == null) {
|
||||
sApiBuilder = ARouter.getInstance().navigation(IMogoMapApiBuilder.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sApiBuilder;
|
||||
}
|
||||
|
||||
public static IMogoGeoSearch getGeoSearchDelegate( Context context ) {
|
||||
return getApiBuilder().getGeoSearch( context );
|
||||
// if ( useCustom ) {
|
||||
// Logger.d( TAG, "use custom IMogoGeoSearch" );
|
||||
// return new com.mogo.map.impl.custom.search.GeocodeSearchClient( context );
|
||||
// }
|
||||
// return new com.mogo.map.impl.amap.search.GeocodeSearchClient( context );
|
||||
public static IMogoGeoSearch getGeoSearchDelegate(Context context) {
|
||||
return getApiBuilder().getGeoSearch(context);
|
||||
}
|
||||
|
||||
public static IMogoInputtipsSearch getInputtipsSearchDelegate( Context context, MogoInputtipsQuery query ) {
|
||||
return getApiBuilder().getInputtipsSearch( context, query );
|
||||
// if ( useCustom ) {
|
||||
// Logger.d( TAG, "use custom IMogoInputtipsSearch" );
|
||||
// return new com.mogo.map.impl.custom.search.InputtipsSearch( context, query );
|
||||
// }
|
||||
// return new com.mogo.map.impl.amap.search.InputtipsSearch( context, query );
|
||||
public static IMogoInputtipsSearch getInputtipsSearchDelegate(Context context, MogoInputtipsQuery query) {
|
||||
return getApiBuilder().getInputtipsSearch(context, query);
|
||||
}
|
||||
|
||||
public static IMogoLocationClient getLocationClientDelegate( Context context ) {
|
||||
return getApiBuilder().getLocationClient( context );
|
||||
// if ( useCustom ) {
|
||||
// Logger.d( TAG, "use custom IMogoLocationClient" );
|
||||
// return new com.mogo.map.impl.custom.location.ALocationClient( context );
|
||||
// }
|
||||
// return new com.mogo.map.impl.amap.location.ALocationClient( context );
|
||||
public static IMogoLocationClient getLocationClientDelegate(Context context) {
|
||||
return getApiBuilder().getLocationClient(context);
|
||||
}
|
||||
|
||||
public static IMogoMapUIController getMapUIControllerDelegate() {
|
||||
return getApiBuilder().getMapUIController();
|
||||
// if ( useCustom ) {
|
||||
// Logger.d( TAG, "use custom IMogoMapUIController" );
|
||||
// return com.mogo.map.impl.custom.uicontroller.AMapUIController.getInstance();
|
||||
// }
|
||||
// return com.mogo.map.impl.amap.uicontroller.AMapUIController.getInstance();
|
||||
}
|
||||
|
||||
public static IMogoNavi getNaviDelegate( Context context ) {
|
||||
public static IMogoNavi getNaviDelegate(Context context) {
|
||||
|
||||
if ( DebugConfig.isUseCustomNavi() ) {
|
||||
return getApiBuilder().getNavi( context );
|
||||
// return com.mogo.map.impl.amap.navi.NaviClient.getInstance( context );
|
||||
} else if ( AppUtils.isAppInstalled( context, "com.autonavi.amapauto" ) ) {
|
||||
return AutoNaviClient.getInstance( context );
|
||||
if (DebugConfig.isUseCustomNavi()) {
|
||||
return getApiBuilder().getNavi(context);
|
||||
} else if (AppUtils.isAppInstalled(context, "com.autonavi.amapauto")) {
|
||||
return AutoNaviClient.getInstance(context);
|
||||
}
|
||||
return getApiBuilder().getNavi( context );
|
||||
// return com.mogo.map.impl.amap.navi.NaviClient.getInstance( context );
|
||||
return getApiBuilder().getNavi(context);
|
||||
}
|
||||
|
||||
public static IMogoPoiSearch getPoiSearchClientDelegate( Context context, MogoPoiSearchQuery query ) {
|
||||
return getApiBuilder().getPoiSearchClient( context, query );
|
||||
// if ( useCustom ) {
|
||||
// Logger.d( TAG, "use custom IMogoPoiSearch" );
|
||||
// return new com.mogo.map.impl.custom.search.PoiSearchClient( context, query );
|
||||
// }
|
||||
// return new com.mogo.map.impl.amap.search.PoiSearchClient( context, query );
|
||||
public static IMogoPoiSearch getPoiSearchClientDelegate(Context context, MogoPoiSearchQuery query) {
|
||||
return getApiBuilder().getPoiSearchClient(context, query);
|
||||
}
|
||||
|
||||
public static IMogoRoadSearch getRoadSearchDelegate() {
|
||||
return getApiBuilder().getRoadSearch();
|
||||
// if ( useCustom ) {
|
||||
// Logger.d( TAG, "use custom IMogoRoadSearch" );
|
||||
// return new com.mogo.map.impl.custom.search.RoadSearchClient();
|
||||
// }
|
||||
// return new com.mogo.map.impl.amap.search.RoadSearchClient();
|
||||
}
|
||||
|
||||
|
||||
public static IMogoAimless getAimless( Context context ) {
|
||||
return getApiBuilder().getAimless( context );
|
||||
public static IMogoAimless getAimless(Context context) {
|
||||
return getApiBuilder().getAimless(context);
|
||||
}
|
||||
|
||||
public static void createMapViewInstance( Context context ) {
|
||||
getApiBuilder().createMapView( context );
|
||||
public static void createMapViewInstance(Context context) {
|
||||
getApiBuilder().createMapView(context);
|
||||
}
|
||||
|
||||
public static void destroy() {
|
||||
getApiBuilder().destroy();
|
||||
}
|
||||
|
||||
public static IMogoMapView getMapView( Context context ) {
|
||||
return getApiBuilder().getMapView( context );
|
||||
public static IMogoMapView getMapView(Context context) {
|
||||
return getApiBuilder().getMapView(context);
|
||||
}
|
||||
|
||||
public static IMogoTrafficSearch getTrafficSearch() {
|
||||
return getApiBuilder().getTrafficSearch();
|
||||
}
|
||||
|
||||
public static CoordinatesTransformer getCoordinatesTransformer(){
|
||||
public static CoordinatesTransformer getCoordinatesTransformer() {
|
||||
return getApiBuilder().getCoordinatesTransformer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,12 +107,10 @@ public class MogoMarkerManager implements IMogoMarkerManager {
|
||||
|
||||
@Override
|
||||
public void addRouteWay(Context context, MogoLatLng startPoint, MogoLatLng endPoint, List< MogoLatLng > wayPoints ) {
|
||||
// RouteOverlayHelper.getInstance().addRouteWay( context, startPoint, endPoint, wayPoints );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeRouteWayOverlay() {
|
||||
// RouteOverlayHelper.getInstance().removeAll();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user