完成不同类型Marker的展示
This commit is contained in:
@@ -16,6 +16,7 @@ import com.mogo.module.service.entity.MarkerLocation;
|
||||
import com.mogo.module.service.entity.MarkerOnlineCar;
|
||||
import com.mogo.module.service.entity.MarkerResponse;
|
||||
import com.mogo.module.service.entity.MarkerShareMusic;
|
||||
import com.mogo.module.service.marker.MapMarkerInfoView;
|
||||
import com.mogo.module.service.marker.MapMarkerView;
|
||||
import com.mogo.module.service.marker.MarkerInfoWindowAdapter;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
@@ -191,13 +192,31 @@ public class MarkerServiceHandler {
|
||||
Logger.e(TAG, "绘制Marker====markerTag:" + markerTag);
|
||||
|
||||
MapMarkerView mapMarkerView = new MapMarkerView(mContext);
|
||||
MapMarkerInfoView mapMarkerInfoView = new MapMarkerInfoView(mContext);
|
||||
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.icon(mapMarkerView)
|
||||
.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;
|
||||
}
|
||||
|
||||
IMogoMarker marker = getMarkerManager().addMarker(markerTag, options);
|
||||
marker.setInfoWindowAdapter(markerInfoWindowAdapter);
|
||||
marker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
|
||||
@@ -26,4 +26,26 @@ public class ServiceConst {
|
||||
* 倒计时间隔
|
||||
*/
|
||||
public static final int DECREASE_INTERVAL = 1_000;
|
||||
|
||||
|
||||
/**
|
||||
* 卡片 车聊聊
|
||||
*/
|
||||
public static final String CARD_TYPE_CARS_CHATTING = "CARD_TYPE_CARS_CHATTING";
|
||||
|
||||
/**
|
||||
* 卡片 探路数据
|
||||
*/
|
||||
public static final String CARD_TYPE_ROAD_CODITION = "CARD_TYPE_ROAD_CODITION";
|
||||
|
||||
/**
|
||||
* 卡片 分享音乐
|
||||
*/
|
||||
public static final String CARD_TYPE_SHARE_MUSIC = "CARD_TYPE_SHARE_MUSIC";
|
||||
|
||||
/**
|
||||
* 卡片 用户数据
|
||||
*/
|
||||
public static final String CARD_TYPE_USER_DATA = "CARD_TYPE_USER_DATA";
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user