rc
This commit is contained in:
@@ -24,7 +24,6 @@ import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
import com.mogo.service.imageloader.IMogoImageloader;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.List;
|
||||
@@ -106,6 +105,8 @@ public class MarkerServiceHandler {
|
||||
}
|
||||
|
||||
|
||||
private static IMogoMarker lastMarker;
|
||||
|
||||
/**
|
||||
* 地图上的Marker点击回调
|
||||
*/
|
||||
@@ -113,8 +114,40 @@ public class MarkerServiceHandler {
|
||||
|
||||
@Override
|
||||
public boolean onMarkerClicked(IMogoMarker marker) {
|
||||
TipToast.shortTip("点击了大而全中的Marker");
|
||||
Logger.e(TAG, "点击了大而全中的Marker");
|
||||
if (lastMarker != null) {
|
||||
MapMarkerView mapMarkerView = new MapMarkerView(mContext);
|
||||
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.icon(mapMarkerView)
|
||||
.owner(lastMarker.getOwner())
|
||||
.latitude(lastMarker.getPosition().getLat())
|
||||
.longitude(lastMarker.getPosition().getLng());
|
||||
|
||||
IMogoMarker newMarker = getMarkerManager().addMarker(lastMarker.getOwner(), options);
|
||||
newMarker.setInfoWindowAdapter(markerInfoWindowAdapter);
|
||||
newMarker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
newMarker.setObject(lastMarker.getObject());
|
||||
|
||||
lastMarker.destroy();
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
MapMarkerInfoView mapMarkerInfoView = new MapMarkerInfoView(mContext);
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.icon(mapMarkerInfoView)
|
||||
.owner(marker.getOwner())
|
||||
.latitude(marker.getPosition().getLat())
|
||||
.longitude(marker.getPosition().getLng());
|
||||
|
||||
IMogoMarker newMarker = getMarkerManager().addMarker(marker.getOwner(), options);
|
||||
newMarker.setInfoWindowAdapter(markerInfoWindowAdapter);
|
||||
newMarker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
newMarker.setObject(marker.getObject());
|
||||
|
||||
lastMarker = newMarker;
|
||||
marker.destroy();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -176,7 +209,7 @@ public class MarkerServiceHandler {
|
||||
}
|
||||
|
||||
}
|
||||
getMapUIController().changeZoom(10);
|
||||
getMapUIController().changeZoom(8);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -191,32 +224,13 @@ public class MarkerServiceHandler {
|
||||
Object bindObject,
|
||||
MarkerLocation markerLocation) {
|
||||
Logger.e(TAG, "绘制Marker====markerTag:" + markerTag);
|
||||
|
||||
MapMarkerView mapMarkerView = new MapMarkerView(mContext);
|
||||
MapMarkerInfoView mapMarkerInfoView = new MapMarkerInfoView(mContext);
|
||||
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner(markerTag)
|
||||
.latitude(markerLocation.getLat())
|
||||
.longitude(markerLocation.getLon());
|
||||
|
||||
switch (markerTag) {
|
||||
case ServiceConst.CARD_TYPE_CARS_CHATTING:
|
||||
options.icon(mapMarkerView);
|
||||
break;
|
||||
case ServiceConst.CARD_TYPE_ROAD_CODITION:
|
||||
options.icon(mapMarkerView);
|
||||
break;
|
||||
case ServiceConst.CARD_TYPE_SHARE_MUSIC:
|
||||
options.icon(mapMarkerView);
|
||||
break;
|
||||
case ServiceConst.CARD_TYPE_USER_DATA:
|
||||
options.icon(mapMarkerInfoView);
|
||||
break;
|
||||
default:
|
||||
options.icon(mapMarkerView);
|
||||
break;
|
||||
}
|
||||
options.icon(mapMarkerView);
|
||||
|
||||
IMogoMarker marker = getMarkerManager().addMarker(markerTag, options);
|
||||
marker.setInfoWindowAdapter(markerInfoWindowAdapter);
|
||||
@@ -241,6 +255,6 @@ public class MarkerServiceHandler {
|
||||
marker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
marker.setObject("我是Marker上面绑定的数据");
|
||||
|
||||
getMapUIController().changeZoom(10);
|
||||
getMapUIController().changeZoom(8);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user