|
|
|
|
@@ -23,7 +23,8 @@ public class CloudPoiManager {
|
|
|
|
|
|
|
|
|
|
private Map<String, PoiWrapper> poiWrapper = new ArrayMap<>();
|
|
|
|
|
private static CloudPoiManager instance = null;
|
|
|
|
|
public static CloudPoiManager getInstance(){
|
|
|
|
|
|
|
|
|
|
public static CloudPoiManager getInstance() {
|
|
|
|
|
if (instance == null) {
|
|
|
|
|
synchronized (CloudPoiManager.class) {
|
|
|
|
|
if (instance == null) {
|
|
|
|
|
@@ -34,43 +35,53 @@ public class CloudPoiManager {
|
|
|
|
|
return instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void generateDefault(){
|
|
|
|
|
public void generateDefault() {
|
|
|
|
|
if (poiWrapper.isEmpty()) {
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.GAS_STATION, new PoiWrapper(MarkerPoiTypeEnum.GAS_STATION,R.drawable.module_common_icon_map_marker_refuel,
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.GAS_STATION, new PoiWrapper(MarkerPoiTypeEnum.GAS_STATION, R.drawable.module_common_icon_map_marker_refuel,
|
|
|
|
|
R.drawable.module_common_icon_map_marker_refuel, "加油站"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.TRAFFIC_CHECK, new PoiWrapper(MarkerPoiTypeEnum.TRAFFIC_CHECK,
|
|
|
|
|
R.drawable.module_common_icon_map_marker_road_check2,R.drawable.module_common_icon_map_marker_road_check2_white, "交通检查"));
|
|
|
|
|
R.drawable.module_common_icon_map_marker_road_check2, R.drawable.module_common_icon_map_marker_road_check2_white, "交通检查"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.ROAD_CLOSED, new PoiWrapper(MarkerPoiTypeEnum.ROAD_CLOSED,
|
|
|
|
|
R.drawable.module_common_icon_map_marker_road_block_off2,R.drawable.module_common_icon_map_marker_road_block_off2_white, "封路"));
|
|
|
|
|
R.drawable.module_common_icon_map_marker_road_block_off2, R.drawable.module_common_icon_map_marker_road_block_off2_white, "封路"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.SHOP_DISCOUNT, new PoiWrapper(MarkerPoiTypeEnum.SHOP_DISCOUNT,
|
|
|
|
|
R.drawable.module_common_icon_map_marker_shop_discount,R.drawable.module_common_icon_map_marker_shop_discount, "商场打折"));
|
|
|
|
|
R.drawable.module_common_icon_map_marker_shop_discount, R.drawable.module_common_icon_map_marker_shop_discount, "商场打折"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.FOURS_4S, new PoiWrapper(MarkerPoiTypeEnum.FOURS_4S,
|
|
|
|
|
R.drawable.module_common_icon_map_marker_4s,R.drawable.module_common_icon_map_marker_4s, "4S店"));
|
|
|
|
|
R.drawable.module_common_icon_map_marker_4s, R.drawable.module_common_icon_map_marker_4s, "4S店"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ROAD_WORK, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ROAD_WORK,
|
|
|
|
|
R.drawable.module_common_icon_map_marker_road_work2,R.drawable.module_common_icon_map_marker_road_work2_white, "施工"));
|
|
|
|
|
R.drawable.module_common_icon_map_marker_road_work2, R.drawable.module_common_icon_map_marker_road_work2_white, "施工"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.FOURS_BLOCK_UP, new PoiWrapper(MarkerPoiTypeEnum.FOURS_BLOCK_UP,
|
|
|
|
|
R.drawable.module_common_icon_map_marker_road_block_up2,R.drawable.module_common_icon_map_marker_road_block_up2_white, "拥堵"));
|
|
|
|
|
R.drawable.module_common_icon_map_marker_road_block_up2, R.drawable.module_common_icon_map_marker_road_block_up2_white, "拥堵"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.FOURS_PONDING, new PoiWrapper(MarkerPoiTypeEnum.FOURS_PONDING,
|
|
|
|
|
R.drawable.module_common_icon_map_marker_pondingl2,R.drawable.module_common_icon_map_marker_pondingl2_white, "积水"));
|
|
|
|
|
R.drawable.module_common_icon_map_marker_pondingl2, R.drawable.module_common_icon_map_marker_pondingl2_white, "积水"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.FOURS_SHOP_FREE, new PoiWrapper(MarkerPoiTypeEnum.FOURS_SHOP_FREE,
|
|
|
|
|
R.drawable.module_common_icon_map_marker_shop,R.drawable.module_common_icon_map_marker_shop, "超时打折"));
|
|
|
|
|
R.drawable.module_common_icon_map_marker_shop, R.drawable.module_common_icon_map_marker_shop, "超时打折"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.FOURS_FOG, new PoiWrapper(MarkerPoiTypeEnum.FOURS_FOG,
|
|
|
|
|
R.drawable.module_common_ic_rc_dark_frog2,R.drawable.module_common_ic_rc_dark_frog2_white, "浓雾"));
|
|
|
|
|
R.drawable.module_common_ic_rc_dark_frog2, R.drawable.module_common_ic_rc_dark_frog2_white, "浓雾"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ICE, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ICE,
|
|
|
|
|
R.drawable.module_common_ic_rc_freeze2,R.drawable.module_common_ic_rc_freeze2_white, "结冰"));
|
|
|
|
|
R.drawable.module_common_ic_rc_freeze2, R.drawable.module_common_ic_rc_freeze2_white, "结冰"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.FOURS_PARKING, new PoiWrapper(MarkerPoiTypeEnum.FOURS_PARKING,
|
|
|
|
|
R.drawable.module_common_ic_rc_parking2,R.drawable.module_common_ic_rc_parking2, "停车场"));
|
|
|
|
|
R.drawable.module_common_ic_rc_parking2, R.drawable.module_common_ic_rc_parking2, "停车场"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT,
|
|
|
|
|
R.drawable.module_common_ic_rc_accident3,R.drawable.module_common_ic_rc_accident3_white, "事故"));
|
|
|
|
|
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "事故"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT_01, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT_01,
|
|
|
|
|
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "重大事故"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT_02, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT_02,
|
|
|
|
|
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "特大事故"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT_03, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT_03,
|
|
|
|
|
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "较大事故"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT_04, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT_04,
|
|
|
|
|
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "一般事故"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT_05, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT_05,
|
|
|
|
|
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "轻微事故"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.FOURS_NEALY, new PoiWrapper(MarkerPoiTypeEnum.FOURS_NEALY,
|
|
|
|
|
R.drawable.module_common_icon_map_marker_shear_news,R.drawable.module_common_icon_map_marker_shear_news, "身边"));
|
|
|
|
|
R.drawable.module_common_icon_map_marker_shear_news, R.drawable.module_common_icon_map_marker_shear_news, "身边"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.FOURS_LIVING, new PoiWrapper(MarkerPoiTypeEnum.FOURS_LIVING,
|
|
|
|
|
R.drawable.module_common_icon_map_marker_living,R.drawable.module_common_icon_map_marker_living_white, "实时路况"));
|
|
|
|
|
R.drawable.module_common_icon_map_marker_living, R.drawable.module_common_icon_map_marker_living_white, "实时路况"));
|
|
|
|
|
poiWrapper.put(MarkerPoiTypeEnum.ILLEGAL_PARK_LIVING, new PoiWrapper(MarkerPoiTypeEnum.ILLEGAL_PARK_LIVING,
|
|
|
|
|
R.drawable.module_common_ic_rc_illegal_park,R.drawable.module_common_ic_rc_illegal_park_white, "违章停车"));
|
|
|
|
|
R.drawable.module_common_ic_rc_illegal_park, R.drawable.module_common_ic_rc_illegal_park_white, "违章停车"));
|
|
|
|
|
// 分享里用到的故障求助
|
|
|
|
|
poiWrapper.put("9999", new PoiWrapper("9999",
|
|
|
|
|
R.drawable.module_common_icon_seek_help,R.drawable.module_common_icon_seek_help, "故障求助"));
|
|
|
|
|
R.drawable.module_common_icon_seek_help, R.drawable.module_common_icon_seek_help, "故障求助"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -81,13 +92,13 @@ public class CloudPoiManager {
|
|
|
|
|
if (!config.isEmpty()) {
|
|
|
|
|
List<PoiWrapper> configWrappers = GsonUtil.arrayFromJson(config, PoiWrapper.class);
|
|
|
|
|
Logger.d(TAG, "config: " + configWrappers);
|
|
|
|
|
if(configWrappers!=null) {
|
|
|
|
|
if (configWrappers != null) {
|
|
|
|
|
for (PoiWrapper wrapper : configWrappers) {
|
|
|
|
|
wrapper.setIconInfoRes(R.drawable.module_common_icon_map_marker_road_block_up2_white);
|
|
|
|
|
wrapper.setIconRes(R.drawable.module_common_icon_map_marker_road_block_up2);
|
|
|
|
|
if(poiWrapper.containsKey(wrapper.getPoiType())) {
|
|
|
|
|
if (poiWrapper.containsKey(wrapper.getPoiType())) {
|
|
|
|
|
PoiWrapper defWrapper = poiWrapper.get(wrapper.getPoiType());
|
|
|
|
|
if(defWrapper!=null) {
|
|
|
|
|
if (defWrapper != null) {
|
|
|
|
|
wrapper.setIconRes(defWrapper.getIconRes());
|
|
|
|
|
wrapper.setIconInfoRes(defWrapper.getIconInfoRes());
|
|
|
|
|
}
|
|
|
|
|
@@ -95,7 +106,7 @@ public class CloudPoiManager {
|
|
|
|
|
Logger.d(TAG, "put===" + wrapper);
|
|
|
|
|
poiWrapper.put(wrapper.getPoiType(), wrapper);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
Logger.e(TAG, "解析configWrapper异常: " + config);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|