修复了数据引起的marker

This commit is contained in:
董宏宇
2020-01-13 20:44:46 +08:00
parent b64197643e
commit ee2b4991b5
14 changed files with 127 additions and 126 deletions

View File

@@ -167,7 +167,7 @@ public class MarkerServiceHandler {
List<MarkerCarChat> carChat = markerCardResult.getCarChat();
List<MarkerOnlineCar> onlineCar = markerCardResult.getOnlineCar();
List<MarkerExploreWay> exploreWay = markerCardResult.getExploreWay();
List<MarkerShareMusic> shareMusic = markerCardResult.getShareMusic();
// List<MarkerShareMusic> shareMusic = markerCardResult.getShareMusic();
if (carChat != null) {
for (MarkerCarChat markerCarChat : carChat) {
@@ -209,27 +209,26 @@ public class MarkerServiceHandler {
markerShowEntity.setMarkerLocation(markerLocation);
markerShowEntity.setMarkerType(markerExploreWay.getType());
markerShowEntity.setTextContent(markerExploreWay.getAddr());
markerShowEntity.setIconUrl(markerExploreWay.getUserInfo().getUserHead());
drawMapMarker(markerShowEntity);
}
}
}
if (shareMusic != null) {
for (MarkerShareMusic markerShareMusic : shareMusic) {
MarkerLocation markerLocation = markerShareMusic.getLocation();
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
markerShowEntity.setBindObj(markerShareMusic);
markerShowEntity.setMarkerLocation(markerLocation);
markerShowEntity.setMarkerType(markerShareMusic.getType());
markerShowEntity.setTextContent(markerShareMusic.getMediaName());
markerShowEntity.setIconUrl(markerShareMusic.getMediaImg());
drawMapMarker(markerShowEntity);
}
}
// if (shareMusic != null) {
// for (MarkerShareMusic markerShareMusic : shareMusic) {
// MarkerLocation markerLocation = markerShareMusic.getLocation();
//
// MarkerShowEntity markerShowEntity = new MarkerShowEntity();
// markerShowEntity.setBindObj(markerShareMusic);
// markerShowEntity.setMarkerLocation(markerLocation);
// markerShowEntity.setMarkerType(markerShareMusic.getType());
// markerShowEntity.setTextContent(markerShareMusic.getMediaName());
// markerShowEntity.setIconUrl(markerShareMusic.getMediaImg());
//
// drawMapMarker(markerShowEntity);
// }
// }
}
getMapUIController().changeZoom(8);
@@ -240,19 +239,24 @@ public class MarkerServiceHandler {
*/
public static IMogoMarker drawMapMarker(MarkerShowEntity markerShowEntity) {
Logger.e(TAG, "绘制Marker====markerTag" + markerShowEntity);
View markerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity);
MogoMarkerOptions options = new MogoMarkerOptions()
.owner(markerShowEntity.getMarkerType())
.latitude(markerShowEntity.getMarkerLocation().getLat())
.longitude(markerShowEntity.getMarkerLocation().getLon());
options.icon(markerView);
if (markerShowEntity.getMarkerLocation() != null) {
View markerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity);
IMogoMarker marker = getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
marker.setOnMarkerClickListener(mogoMarkerClickListener);
marker.setObject(markerShowEntity);
MogoMarkerOptions options = new MogoMarkerOptions()
.owner(markerShowEntity.getMarkerType())
.latitude(markerShowEntity.getMarkerLocation().getLat())
.longitude(markerShowEntity.getMarkerLocation().getLon());
options.icon(markerView);
return marker;
IMogoMarker marker = getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
marker.setOnMarkerClickListener(mogoMarkerClickListener);
marker.setObject(markerShowEntity);
return marker;
} else {
Logger.e(TAG, "Location 必须进行初始化!!!!!");
}
return null;
}

View File

@@ -91,7 +91,7 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
break;
}
ivCar.setRotation(markerShowEntity.getMarkerLocation().getAngle());
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
if (!TextUtils.isEmpty(markerShowEntity.getTextContent())) {
tvMarkerContent.setText(markerShowEntity.getTextContent());
}

View File

@@ -81,7 +81,7 @@ public class MapMarkerView extends MapMarkerBaseView {
ivBg.setImageResource(R.drawable.bg_map_marker_purple);
break;
}
ivCar.setRotation(markerShowEntity.getMarkerLocation().getAngle());
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
loadImageWithMarker(markerShowEntity);