|
|
@@ -223,6 +223,7 @@ public class UrbanMonitorServiceImpl implements IUrbanMonitorService {
|
|
|
if (dimType == null || dimType.isEmpty()) {
|
|
|
dimType = "2d";
|
|
|
}
|
|
|
+ final String requestDimType = dimType;
|
|
|
|
|
|
List<UrbanExpansionLayerVO> list = urbanMonitorMapper.selectUrbanExpansionList(dimType);
|
|
|
|
|
|
@@ -242,18 +243,27 @@ public class UrbanMonitorServiceImpl implements IUrbanMonitorService {
|
|
|
for (UrbanExpansionLayerVO item : list) {
|
|
|
UrbanExpansionConfigVO.LayerInfo info = new UrbanExpansionConfigVO.LayerInfo(item.getLayerName(),
|
|
|
item.getData(), item.getServiceId());
|
|
|
+ boolean isPreferredDim = requestDimType.equalsIgnoreCase(item.getDimType());
|
|
|
|
|
|
if ("boundary".equals(item.getLayerType())) {
|
|
|
// key is year string
|
|
|
- boundaryLayers.put(String.valueOf(item.getYear()), info);
|
|
|
+ String key = String.valueOf(item.getYear());
|
|
|
+ if (isPreferredDim || !boundaryLayers.containsKey(key)) {
|
|
|
+ boundaryLayers.put(key, info);
|
|
|
+ }
|
|
|
} else if ("expand".equals(item.getLayerType())) {
|
|
|
// key is prevYear_year
|
|
|
if (item.getPrevYear() != null) {
|
|
|
String key = item.getPrevYear() + "_" + item.getYear();
|
|
|
- expandLayers.put(key, info);
|
|
|
+ if (isPreferredDim || !expandLayers.containsKey(key)) {
|
|
|
+ expandLayers.put(key, info);
|
|
|
+ }
|
|
|
}
|
|
|
} else if ("map".equals(item.getLayerType())) {
|
|
|
- mapLayers.put(String.valueOf(item.getYear()), info);
|
|
|
+ String key = String.valueOf(item.getYear());
|
|
|
+ if (isPreferredDim || !mapLayers.containsKey(key)) {
|
|
|
+ mapLayers.put(key, info);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|