完成了点击Marker切换样式的效果
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;
|
||||
@@ -115,7 +114,7 @@ public class MarkerServiceHandler {
|
||||
|
||||
@Override
|
||||
public boolean onMarkerClicked(IMogoMarker marker) {
|
||||
TipToast.shortTip("点击了大而全中的Marker");
|
||||
Logger.e(TAG, "点击了大而全中的Marker");
|
||||
if (lastMarker != null) {
|
||||
MapMarkerView mapMarkerView = new MapMarkerView(mContext);
|
||||
|
||||
@@ -129,12 +128,13 @@ public class MarkerServiceHandler {
|
||||
newMarker.setInfoWindowAdapter(markerInfoWindowAdapter);
|
||||
newMarker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
newMarker.setObject(lastMarker.getObject());
|
||||
|
||||
lastMarker.destroy();
|
||||
}
|
||||
|
||||
lastMarker = marker;
|
||||
|
||||
//
|
||||
MapMarkerInfoView mapMarkerInfoView = new MapMarkerInfoView(mContext);
|
||||
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.icon(mapMarkerInfoView)
|
||||
.owner(marker.getOwner())
|
||||
@@ -146,6 +146,8 @@ public class MarkerServiceHandler {
|
||||
newMarker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
newMarker.setObject(marker.getObject());
|
||||
|
||||
lastMarker = newMarker;
|
||||
marker.destroy();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -222,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);
|
||||
|
||||
Reference in New Issue
Block a user