增加了将Marker回调到卡片的操作
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user