增加了marker添加object绑定
This commit is contained in:
@@ -93,36 +93,52 @@ public class MarkerServiceHandler {
|
||||
if (carChat != null) {
|
||||
for (MarkerCarChat markerCarChat : carChat) {
|
||||
MarkerLocation markerLocation = markerCarChat.getLocation();
|
||||
drawMapMarker(markerCarChat.getType(), markerLocation, optionsList);
|
||||
drawMapMarker(
|
||||
markerCarChat.getType(),
|
||||
markerCarChat,
|
||||
markerLocation,
|
||||
optionsList);
|
||||
}
|
||||
}
|
||||
|
||||
if (onlineCar != null) {
|
||||
for (MarkerOnlineCar markerOnlineCar : onlineCar) {
|
||||
MarkerLocation markerLocation = markerOnlineCar.getLocation();
|
||||
drawMapMarker(markerOnlineCar.getType(), markerLocation, optionsList);
|
||||
drawMapMarker(
|
||||
markerOnlineCar.getType(),
|
||||
markerOnlineCar,
|
||||
markerLocation,
|
||||
optionsList);
|
||||
}
|
||||
}
|
||||
|
||||
if (exploreWay != null) {
|
||||
for (MarkerExploreWay markerExploreWay : exploreWay) {
|
||||
MarkerLocation markerLocation = markerExploreWay.getLocation();
|
||||
drawMapMarker(markerExploreWay.getType(), markerLocation, optionsList);
|
||||
drawMapMarker(
|
||||
markerExploreWay.getType(),
|
||||
markerExploreWay,
|
||||
markerLocation,
|
||||
optionsList);
|
||||
}
|
||||
}
|
||||
|
||||
if (shareMusic != null) {
|
||||
for (MarkerShareMusic markerShareMusic : shareMusic) {
|
||||
MarkerLocation markerLocation = markerShareMusic.getLocation();
|
||||
drawMapMarker(markerShareMusic.getType(), markerLocation, optionsList);
|
||||
drawMapMarker(
|
||||
markerShareMusic.getType(),
|
||||
markerShareMusic,
|
||||
markerLocation,
|
||||
optionsList);
|
||||
}
|
||||
}
|
||||
|
||||
List<IMogoMarker> iMogoMarkers = getMarkerManager().addMarkers(TAG, optionsList, true);
|
||||
for (IMogoMarker iMogoMarker : iMogoMarkers) {
|
||||
iMogoMarker.setInfoWindowAdapter(markerInfoWindowAdapter);
|
||||
iMogoMarker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
}
|
||||
// List<IMogoMarker> iMogoMarkers = getMarkerManager().addMarkers(TAG, optionsList, true);
|
||||
// for (IMogoMarker iMogoMarker : iMogoMarkers) {
|
||||
// iMogoMarker.setInfoWindowAdapter(markerInfoWindowAdapter);
|
||||
// iMogoMarker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -176,9 +192,11 @@ public class MarkerServiceHandler {
|
||||
* @param markerLocation 要绘制Marker的位置信息
|
||||
* @param optionsList 要加入的Marker集合
|
||||
*/
|
||||
public static void drawMapMarker(String markerTag, MarkerLocation markerLocation,
|
||||
public static void drawMapMarker(String markerTag,
|
||||
Object bindObject,
|
||||
MarkerLocation markerLocation,
|
||||
ArrayList<MogoMarkerOptions> optionsList) {
|
||||
Logger.e(markerTag, "绘制Marker====markerTag:" + markerTag);
|
||||
Logger.e(TAG, "绘制Marker====markerTag:" + markerTag);
|
||||
|
||||
MapMarkerView mapMarkerView = new MapMarkerView(mContext);
|
||||
|
||||
@@ -188,7 +206,13 @@ public class MarkerServiceHandler {
|
||||
.latitude(markerLocation.getLat())
|
||||
.longitude(markerLocation.getLon());
|
||||
|
||||
optionsList.add(options);
|
||||
IMogoMarker marker = getMarkerManager().addMarker(markerTag, options);
|
||||
marker.setInfoWindowAdapter(markerInfoWindowAdapter);
|
||||
marker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
marker.setObject(bindObject);
|
||||
getMapUIController().changeZoom(10);
|
||||
|
||||
// optionsList.add(options);
|
||||
}
|
||||
|
||||
|
||||
@@ -207,8 +231,6 @@ public class MarkerServiceHandler {
|
||||
marker.setInfoWindowAdapter(markerInfoWindowAdapter);
|
||||
marker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
|
||||
getMapUIController().changeZoom(false);
|
||||
|
||||
getMapUIController().changeZoom(10);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user