增加了将Marker回调到卡片的操作

This commit is contained in:
董宏宇
2020-01-09 14:54:59 +08:00
parent 5b601b19ed
commit 4600817725
4 changed files with 37 additions and 2 deletions

View File

@@ -198,6 +198,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
@Override
public boolean onMarkerClicked( IMogoMarker marker ) {
switch2( marker.getOwner() );
mMogoModuleHandler.onMarkerReceive(marker.getOwner(),marker);
return false;
}

View File

@@ -3,6 +3,7 @@ package com.mogo.module.main.cards;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.location.IMogoLocationClient;
import com.mogo.map.location.IMogoLocationListener;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.service.module.IMogoModuleProvider;
@@ -72,4 +73,12 @@ public interface MogoModulesHandler extends IMogoMapListener,
* 销毁
*/
void destroy();
/**
* 卡片接收到Marker传入数据
* @param cardType
* @param marker
*/
void onMarkerReceive(String cardType, IMogoMarker marker);
}

View File

@@ -14,6 +14,7 @@ import com.mogo.map.MogoLatLng;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.location.IMogoLocationListener;
import com.mogo.map.location.MogoLocation;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.model.MogoPoi;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.map.navi.MogoNaviInfo;
@@ -437,4 +438,15 @@ public class MogoModulesManager implements MogoModulesHandler,
mMapLoadedCallback = null;
mEnableModuleName = null;
}
@Override
public void onMarkerReceive(String cardType, IMogoMarker marker) {
for ( IMogoModuleProvider value : mModuleProviders.values() ) {
if (value.getModuleName().equals(cardType)) {
if (value.getMarkerClickListener() != null) {
value.getMarkerClickListener().onMarkerClicked(marker);
}
}
}
}
}