修复了因为其他模块没有设置moduleName导致Marker回调异常

This commit is contained in:
董宏宇
2020-01-09 18:17:11 +08:00
parent 7bead52ebc
commit 2ed6b944c4
2 changed files with 6 additions and 17 deletions

View File

@@ -475,7 +475,7 @@ public class MogoModulesManager implements MogoModulesHandler,
@Override
public void onMarkerReceive(IMogoMarker marker) {
for (IMogoModuleProvider value : mModuleProviders.values()) {
if (value.getModuleName().equals(marker.getOwner())) {
if (value.getModuleName()!=null && value.getModuleName().equals(marker.getOwner())) {
if (value.getMarkerClickListener() != null) {
value.getMarkerClickListener().onMarkerClicked(marker);
}

View File

@@ -26,7 +26,6 @@ import com.mogo.service.map.IMogoMapService;
import com.mogo.utils.TipToast;
import com.mogo.utils.logger.Logger;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
@@ -88,16 +87,13 @@ public class MarkerServiceHandler {
List<MarkerExploreWay> exploreWay = markerCardResult.getExploreWay();
List<MarkerShareMusic> shareMusic = markerCardResult.getShareMusic();
ArrayList<MogoMarkerOptions> optionsList = new ArrayList<>();
if (carChat != null) {
for (MarkerCarChat markerCarChat : carChat) {
MarkerLocation markerLocation = markerCarChat.getLocation();
drawMapMarker(
markerCarChat.getType(),
markerCarChat,
markerLocation,
optionsList);
markerLocation);
}
}
@@ -107,8 +103,7 @@ public class MarkerServiceHandler {
drawMapMarker(
markerOnlineCar.getType(),
markerOnlineCar,
markerLocation,
optionsList);
markerLocation);
}
}
@@ -118,8 +113,7 @@ public class MarkerServiceHandler {
drawMapMarker(
markerExploreWay.getType(),
markerExploreWay,
markerLocation,
optionsList);
markerLocation);
}
}
@@ -129,8 +123,7 @@ public class MarkerServiceHandler {
drawMapMarker(
markerShareMusic.getType(),
markerShareMusic,
markerLocation,
optionsList);
markerLocation);
}
}
@@ -186,12 +179,10 @@ public class MarkerServiceHandler {
* @param markerTag Marker类型
* http://gitlab.zhidaoauto.com/ecos/yycp-service/CarLauncher-Docs/blob/master/%E5%8D%A1%E7%89%87%E7%B1%BB%E5%9E%8B%E5%AE%9A%E4%B9%89.md
* @param markerLocation 要绘制Marker的位置信息
* @param optionsList 要加入的Marker集合
*/
public static void drawMapMarker(String markerTag,
Object bindObject,
MarkerLocation markerLocation,
ArrayList<MogoMarkerOptions> optionsList) {
MarkerLocation markerLocation) {
Logger.e(TAG, "绘制Marker====markerTag" + markerTag);
MapMarkerView mapMarkerView = new MapMarkerView(mContext);
@@ -214,7 +205,6 @@ public class MarkerServiceHandler {
public static void drawMapMarker() {
Logger.e(TAG, "=====绘制Marker====");
MapMarkerView mapMarkerView = new MapMarkerView(mContext);
MogoMarkerOptions options = new MogoMarkerOptions()
@@ -228,6 +218,5 @@ public class MarkerServiceHandler {
marker.setObject("我是Marker上面绑定的数据");
getMapUIController().changeZoom(10);
}
}