gis-map-universal 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/gismap.umd.js +133 -19
- package/package.json +1 -1
package/gismap.umd.js
CHANGED
|
@@ -264311,8 +264311,8 @@ lightUrl:"https://service.sdmap.gov.cn/tileservice/sdpubmap?",geoJSONUrl:"/china
|
|
|
264311
264311
|
// projection:'EPsG:4326'
|
|
264312
264312
|
// });
|
|
264313
264313
|
// this.map.addLayer(wmtslayer);
|
|
264314
|
-
let baseRoadlayer=new layer_Tile["default"]({layerName:"baseRoadlayer",source:new source_TileWMS({url:'http://
|
|
264315
|
-
that.normalizedThemeStyle==="light"?that.tiandituLayerUrl=that.lightUrl:that.tiandituLayerUrl=that.darkUrl;this.tiandituLayer=new layer_Tile["default"]({source:new Tianditu_Tianditu({url:this.tiandituLayerUrl,key:"
|
|
264314
|
+
let baseRoadlayer=new layer_Tile["default"]({layerName:"baseRoadlayer",source:new source_TileWMS({url:'http://localhost:8090/iserver/services/map-WorkSpace/wms130',params:{LAYERS:"T84",FORMAT:"image/png"}}),zIndex:4,projection:"EPSG:3857"});// this.map.addLayer(baseRoadlayer);
|
|
264315
|
+
that.normalizedThemeStyle==="light"?that.tiandituLayerUrl=that.lightUrl:that.tiandituLayerUrl=that.darkUrl;this.tiandituLayer=new layer_Tile["default"]({source:new Tianditu_Tianditu({url:this.tiandituLayerUrl,key:"aaaea01715112ff36a1d2a25f345ba4f",projection:"EPSG:4326"}),zIndex:1});this.map.addLayer(this.tiandituLayer);// // 测试车道线
|
|
264316
264316
|
// const token = `?token=d6bWDtdlxIc-VPNRQWQF-VaTDzwYZIOK_tWug3ZNffcW1nMltpiEdtsrNLCkc_XoVWbV1LhkGcUv5kOLpXt7kA..`
|
|
264317
264317
|
// let chedaoBGLayer = new TileLayer({
|
|
264318
264318
|
// layerName: "chedaoBGLayer",
|
|
@@ -264621,7 +264621,7 @@ initAreaGDPLayer(){let data=[{city:"济南",latlng:[117.218567,36.63746469],leve
|
|
|
264621
264621
|
}else if(value===4){return"#FFD700";// 金色
|
|
264622
264622
|
}else if(value===5){return"#00FFFF";// 青色
|
|
264623
264623
|
}else{return"#2E2E2E";// 深灰色,用于默认或其他情况
|
|
264624
|
-
}}}}}]};if(this.largeTruckLayer){this.largeTruckLayer.setChartOptions(option);}},removeLargeTruckLayer(){if(this.largeTruckLayer){this.largeTruckLayer.remove();this.largeTruckLayer=null;}}},watch:{themeStyle(val){let _this=this;if(val==="dark"){if(_this.tiandituLayer){_this.map.removeLayer(_this.tiandituLayer);_this.map.removeLayer(_this.china_full_Layer);_this.tiandituLayer=new layer_Tile["default"]({source:new Tianditu_Tianditu({url:_this.darkUrl,key:"d02c0b2c57b4ba04f74cbccbb138f130",projection:"EPSG:4326"}),zIndex:1});_this.map.addLayer(_this.tiandituLayer);fetch(_this.geoJSONUrl).then(response=>response.json()).then(data=>{let geoJSONFormat=new ol_format_GeoJSON["default"]();_this.china_full_Layer=new layer_Vector["default"]({layerName:"xxxx",source:new source_Vector["default"]({format:geoJSONFormat,features:geoJSONFormat.readFeatures(data,{dataProjection:"EPSG:4326",featureProjection:"EPSG:4326"})}),zIndex:3,style:function(feature){return new Style["default"]({fill:new Fill["default"]({color:_this.darkFillColor}),stroke:new Stroke["default"]({color:_this.darkStrokeColor,width:1})});}});_this.map.addLayer(_this.china_full_Layer);});}}else if(val==="light"){_this.map.removeLayer(_this.tiandituLayer);_this.map.removeLayer(_this.china_full_Layer);_this.tiandituLayer=new layer_Tile["default"]({source:new Tianditu_Tianditu({url:_this.lightUrl,key:"
|
|
264624
|
+
}}}}}]};if(this.largeTruckLayer){this.largeTruckLayer.setChartOptions(option);}},removeLargeTruckLayer(){if(this.largeTruckLayer){this.largeTruckLayer.remove();this.largeTruckLayer=null;}}},watch:{themeStyle(val){let _this=this;if(val==="dark"){if(_this.tiandituLayer){_this.map.removeLayer(_this.tiandituLayer);_this.map.removeLayer(_this.china_full_Layer);_this.tiandituLayer=new layer_Tile["default"]({source:new Tianditu_Tianditu({url:_this.darkUrl,key:"d02c0b2c57b4ba04f74cbccbb138f130",projection:"EPSG:4326"}),zIndex:1});_this.map.addLayer(_this.tiandituLayer);fetch(_this.geoJSONUrl).then(response=>response.json()).then(data=>{let geoJSONFormat=new ol_format_GeoJSON["default"]();_this.china_full_Layer=new layer_Vector["default"]({layerName:"xxxx",source:new source_Vector["default"]({format:geoJSONFormat,features:geoJSONFormat.readFeatures(data,{dataProjection:"EPSG:4326",featureProjection:"EPSG:4326"})}),zIndex:3,style:function(feature){return new Style["default"]({fill:new Fill["default"]({color:_this.darkFillColor}),stroke:new Stroke["default"]({color:_this.darkStrokeColor,width:1})});}});_this.map.addLayer(_this.china_full_Layer);});}}else if(val==="light"){_this.map.removeLayer(_this.tiandituLayer);_this.map.removeLayer(_this.china_full_Layer);_this.tiandituLayer=new layer_Tile["default"]({source:new Tianditu_Tianditu({url:_this.lightUrl,key:"aaaea01715112ff36a1d2a25f345ba4f",projection:"EPSG:4326"}),zIndex:1});_this.map.addLayer(_this.tiandituLayer);fetch(_this.geoJSONUrl).then(response=>response.json()).then(data=>{let geoJSONFormat=new ol_format_GeoJSON["default"]();_this.china_full_Layer=new layer_Vector["default"]({layerName:"xxxx",source:new source_Vector["default"]({format:geoJSONFormat,features:geoJSONFormat.readFeatures(data,{dataProjection:"EPSG:4326",featureProjection:"EPSG:4326"})}),zIndex:3,style:function(feature){return new Style["default"]({fill:new Fill["default"]({color:_this.lightFillColor}),stroke:new Stroke["default"]({color:_this.lightStrokeColor,width:1})});}});_this.map.addLayer(_this.china_full_Layer);});}}}});
|
|
264625
264625
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.reduce.js
|
|
264626
264626
|
var es_array_reduce = __webpack_require__("13d5");
|
|
264627
264627
|
|
|
@@ -264635,7 +264635,7 @@ var scratch = __webpack_require__("c1ec");
|
|
|
264635
264635
|
/* harmony default export */ var layerCheck = ({
|
|
264636
264636
|
data() {
|
|
264637
264637
|
return {
|
|
264638
|
-
corridorLayers: ["交通网主骨架", "旅游走廊"],
|
|
264638
|
+
corridorLayers: ["交通网主骨架", "旅游走廊", "都市圈"],
|
|
264639
264639
|
//, "三维效果演示"
|
|
264640
264640
|
highwayLayers: ["高速路网", "国道路网", "省道路网", "收费站", "服务区", "高速相机", "国省道相机"],
|
|
264641
264641
|
trafficEventLayers: ["突发事件", "收费站异常", "服务区异常", "养护施工", "异常天气", "AI告警事件",
|
|
@@ -264757,6 +264757,7 @@ var scratch = __webpack_require__("c1ec");
|
|
|
264757
264757
|
this.removeLayerByName("travelLayer");
|
|
264758
264758
|
this.removeLayerByName("BIMand3DLayer");
|
|
264759
264759
|
this.removeLayerByName("travelPointLayer");
|
|
264760
|
+
this.removeLayerByName("dushiquanLayer");
|
|
264760
264761
|
} else {
|
|
264761
264762
|
if (value.includes("交通网主骨架")) {
|
|
264762
264763
|
if (!this.findLayerByName("roadNetworkLayer")) {
|
|
@@ -264780,6 +264781,13 @@ var scratch = __webpack_require__("c1ec");
|
|
|
264780
264781
|
} else {
|
|
264781
264782
|
this.removeLayerByName("BIMand3DLayer");
|
|
264782
264783
|
}
|
|
264784
|
+
if (value.includes("都市圈")) {
|
|
264785
|
+
if (!this.findLayerByName("dushiquanLayer")) {
|
|
264786
|
+
this.initdushiquanLayer();
|
|
264787
|
+
}
|
|
264788
|
+
} else {
|
|
264789
|
+
this.removeLayerByName("dushiquanLayer");
|
|
264790
|
+
}
|
|
264783
264791
|
}
|
|
264784
264792
|
},
|
|
264785
264793
|
highwayChange(value) {
|
|
@@ -266759,13 +266767,17 @@ function getWeatherForecast() {
|
|
|
266759
266767
|
|
|
266760
266768
|
|
|
266761
266769
|
|
|
266770
|
+
|
|
266771
|
+
|
|
266772
|
+
|
|
266762
266773
|
/* harmony default export */ var initWeatherForecastLayer = ({
|
|
266763
266774
|
data() {
|
|
266764
266775
|
return {
|
|
266765
266776
|
gaosuRoad: "/roadInfo_GS.json",
|
|
266766
266777
|
guodaoRoad: "/roadInfo_GD.json",
|
|
266767
266778
|
shengdaoRoad: "/roadInfo_SD.json",
|
|
266768
|
-
tieluLine: "/tieluLine.json"
|
|
266779
|
+
tieluLine: "/tieluLine.json",
|
|
266780
|
+
dushiquan: "/sdArea.json"
|
|
266769
266781
|
};
|
|
266770
266782
|
},
|
|
266771
266783
|
methods: {
|
|
@@ -266775,13 +266787,13 @@ function getWeatherForecast() {
|
|
|
266775
266787
|
let weatherForecastList = {
|
|
266776
266788
|
pointList: []
|
|
266777
266789
|
};
|
|
266778
|
-
let aa = [
|
|
266790
|
+
let aa = ["晴", "阴", "多云", "小雨", "中雨"];
|
|
266779
266791
|
getWeatherForecast().then(res => {
|
|
266780
266792
|
if (res && res.data) {
|
|
266781
266793
|
res.data.forEach(item => {
|
|
266782
266794
|
if (item) {
|
|
266783
|
-
let aa = [
|
|
266784
|
-
let dayweather = aa.includes(item.casts[0].dayweather) ? item.casts[0].dayweather :
|
|
266795
|
+
let aa = ["晴", "阴", "多云", "小雨", "中雨"];
|
|
266796
|
+
let dayweather = aa.includes(item.casts[0].dayweather) ? item.casts[0].dayweather : "多云";
|
|
266785
266797
|
let obj = {
|
|
266786
266798
|
type: "WeatherForecast",
|
|
266787
266799
|
longitude: Number(item.cityLng),
|
|
@@ -266793,7 +266805,7 @@ function getWeatherForecast() {
|
|
|
266793
266805
|
GGoffsetX: 0,
|
|
266794
266806
|
GGoffsetY: 0,
|
|
266795
266807
|
textOffsetY: 65,
|
|
266796
|
-
textFontSize:
|
|
266808
|
+
textFontSize: "12px sans-serif",
|
|
266797
266809
|
textBGColor: "rgba(255,255,255,0)",
|
|
266798
266810
|
otherInfo: {
|
|
266799
266811
|
name: item.city + "--" + item.casts[0].dayweather
|
|
@@ -267056,7 +267068,7 @@ function getWeatherForecast() {
|
|
|
267056
267068
|
};
|
|
267057
267069
|
this.addPointByArr(rainfallList, "RainfallLayer", isCluster);
|
|
267058
267070
|
},
|
|
267059
|
-
initGaosuRoadLayer(cityId = null, lineColor =
|
|
267071
|
+
initGaosuRoadLayer(cityId = null, lineColor = "#16ce72") {
|
|
267060
267072
|
// 如果已有图层,先移除
|
|
267061
267073
|
if (this.GaosuRoadLayer && this.map) {
|
|
267062
267074
|
this.map.removeLayer(this.GaosuRoadLayer);
|
|
@@ -267095,10 +267107,10 @@ function getWeatherForecast() {
|
|
|
267095
267107
|
});
|
|
267096
267108
|
this.map.addLayer(this.GaosuRoadLayer);
|
|
267097
267109
|
}).catch(error => {
|
|
267098
|
-
console.error(
|
|
267110
|
+
console.error("加载高速道路数据失败:", error);
|
|
267099
267111
|
});
|
|
267100
267112
|
},
|
|
267101
|
-
initguodaoRoadLayer(cityId = null) {
|
|
267113
|
+
initguodaoRoadLayer(cityId = null, lineColor = "#16ce72") {
|
|
267102
267114
|
// 如果已有图层,先移除
|
|
267103
267115
|
if (this.guodaoRoadLayer && this.map) {
|
|
267104
267116
|
this.map.removeLayer(this.guodaoRoadLayer);
|
|
@@ -267113,7 +267125,7 @@ function getWeatherForecast() {
|
|
|
267113
267125
|
};
|
|
267114
267126
|
if (cityId && data.features) {
|
|
267115
267127
|
filteredData.features = data.features.filter(feature => {
|
|
267116
|
-
return feature.properties && feature.properties.nodeId
|
|
267128
|
+
return feature.properties && feature.properties.nodeId == cityId;
|
|
267117
267129
|
});
|
|
267118
267130
|
}
|
|
267119
267131
|
this.guodaoRoadLayer = new layer_Vector["default"]({
|
|
@@ -267127,7 +267139,7 @@ function getWeatherForecast() {
|
|
|
267127
267139
|
}),
|
|
267128
267140
|
style: new Style["default"]({
|
|
267129
267141
|
stroke: new Stroke["default"]({
|
|
267130
|
-
color:
|
|
267142
|
+
color: lineColor,
|
|
267131
267143
|
// 蓝色线条
|
|
267132
267144
|
width: 2 // 线条宽度
|
|
267133
267145
|
})
|
|
@@ -267136,10 +267148,10 @@ function getWeatherForecast() {
|
|
|
267136
267148
|
});
|
|
267137
267149
|
this.map.addLayer(this.guodaoRoadLayer);
|
|
267138
267150
|
}).catch(error => {
|
|
267139
|
-
console.error(
|
|
267151
|
+
console.error("加载国道数据失败:", error);
|
|
267140
267152
|
});
|
|
267141
267153
|
},
|
|
267142
|
-
initshengdaoRoadLayer(cityId = null) {
|
|
267154
|
+
initshengdaoRoadLayer(cityId = null, lineColor = "#16ce72") {
|
|
267143
267155
|
// 如果已有图层,先移除
|
|
267144
267156
|
if (this.shengdaoRoadLayer && this.map) {
|
|
267145
267157
|
this.map.removeLayer(this.shengdaoRoadLayer);
|
|
@@ -267154,7 +267166,7 @@ function getWeatherForecast() {
|
|
|
267154
267166
|
};
|
|
267155
267167
|
if (cityId && data.features) {
|
|
267156
267168
|
filteredData.features = data.features.filter(feature => {
|
|
267157
|
-
return feature.properties && feature.properties.nodeId
|
|
267169
|
+
return feature.properties && feature.properties.nodeId == cityId;
|
|
267158
267170
|
});
|
|
267159
267171
|
}
|
|
267160
267172
|
this.shengdaoRoadLayer = new layer_Vector["default"]({
|
|
@@ -267168,7 +267180,7 @@ function getWeatherForecast() {
|
|
|
267168
267180
|
}),
|
|
267169
267181
|
style: new Style["default"]({
|
|
267170
267182
|
stroke: new Stroke["default"]({
|
|
267171
|
-
color:
|
|
267183
|
+
color: lineColor,
|
|
267172
267184
|
// 蓝色线条
|
|
267173
267185
|
width: 1 // 线条宽度
|
|
267174
267186
|
})
|
|
@@ -267177,7 +267189,7 @@ function getWeatherForecast() {
|
|
|
267177
267189
|
});
|
|
267178
267190
|
this.map.addLayer(this.shengdaoRoadLayer);
|
|
267179
267191
|
}).catch(error => {
|
|
267180
|
-
console.error(
|
|
267192
|
+
console.error("加载省道数据失败:", error);
|
|
267181
267193
|
});
|
|
267182
267194
|
},
|
|
267183
267195
|
initTieluLineLayer() {
|
|
@@ -267208,6 +267220,108 @@ function getWeatherForecast() {
|
|
|
267208
267220
|
});
|
|
267209
267221
|
this.map.addLayer(this.TieluLineLayer);
|
|
267210
267222
|
});
|
|
267223
|
+
},
|
|
267224
|
+
initdushiquanLayer() {
|
|
267225
|
+
// 如果已有图层,先移除
|
|
267226
|
+
if (this.dushiquanLayer && this.map) {
|
|
267227
|
+
this.map.removeLayer(this.dushiquanLayer);
|
|
267228
|
+
this.dushiquanLayer = null;
|
|
267229
|
+
}
|
|
267230
|
+
fetch(this.dushiquan).then(response => response.json()).then(data => {
|
|
267231
|
+
let geoJSONFormat = new ol_format_GeoJSON["default"]();
|
|
267232
|
+
|
|
267233
|
+
// 创建城市区域图层
|
|
267234
|
+
this.dushiquanLayer = new layer_Vector["default"]({
|
|
267235
|
+
layerName: "dushiquanLayer",
|
|
267236
|
+
source: new source_Vector["default"]({
|
|
267237
|
+
format: geoJSONFormat,
|
|
267238
|
+
features: geoJSONFormat.readFeatures(data, {
|
|
267239
|
+
dataProjection: "EPSG:4326",
|
|
267240
|
+
featureProjection: "EPSG:4326"
|
|
267241
|
+
})
|
|
267242
|
+
}),
|
|
267243
|
+
zIndex: 3,
|
|
267244
|
+
style: feature => {
|
|
267245
|
+
const properties = feature.getProperties();
|
|
267246
|
+
const cityName = properties.name;
|
|
267247
|
+
let fillColor = '#fff648ff'; // 默认颜色
|
|
267248
|
+
|
|
267249
|
+
// 定义不同城市组的颜色
|
|
267250
|
+
const group1 = ['德州市', '滨州市', '东营市', '聊城市', '济南市', '淄博市', '泰安市'];
|
|
267251
|
+
const group2 = ['烟台市', '威海市', '潍坊市', '青岛市', '日照市'];
|
|
267252
|
+
const group3 = ['菏泽市', '济宁市', '枣庄市', '临沂市'];
|
|
267253
|
+
|
|
267254
|
+
// 根据城市名称设置颜色
|
|
267255
|
+
if (group1.includes(cityName)) {
|
|
267256
|
+
fillColor = '#049b39';
|
|
267257
|
+
} else if (group2.includes(cityName)) {
|
|
267258
|
+
fillColor = '#065df8';
|
|
267259
|
+
} else if (group3.includes(cityName)) {
|
|
267260
|
+
fillColor = '#07bbfc';
|
|
267261
|
+
}
|
|
267262
|
+
return new Style["default"]({
|
|
267263
|
+
fill: new Fill["default"]({
|
|
267264
|
+
color: fillColor
|
|
267265
|
+
}),
|
|
267266
|
+
stroke: new Stroke["default"]({
|
|
267267
|
+
color: '#6eedfa',
|
|
267268
|
+
width: 1
|
|
267269
|
+
}),
|
|
267270
|
+
text: new ol_style_Text["default"]({
|
|
267271
|
+
text: cityName,
|
|
267272
|
+
fill: new Fill["default"]({
|
|
267273
|
+
color: '#ffffff'
|
|
267274
|
+
}),
|
|
267275
|
+
font: '14px sans-serif',
|
|
267276
|
+
textAlign: 'center',
|
|
267277
|
+
textBaseline: 'middle'
|
|
267278
|
+
})
|
|
267279
|
+
});
|
|
267280
|
+
}
|
|
267281
|
+
});
|
|
267282
|
+
|
|
267283
|
+
// 添加城市名称标签图层
|
|
267284
|
+
const textFeatures = [];
|
|
267285
|
+
data.features.forEach(feature => {
|
|
267286
|
+
if (feature.properties && feature.properties.center) {
|
|
267287
|
+
const center = feature.properties.center;
|
|
267288
|
+
const name = feature.properties.name;
|
|
267289
|
+
|
|
267290
|
+
// 创建点要素用于显示文本
|
|
267291
|
+
const textFeature = new ol_Feature["a" /* default */]({
|
|
267292
|
+
geometry: new geom_Point["default"](Object(ol_proj["fromLonLat"])(center)),
|
|
267293
|
+
name: name
|
|
267294
|
+
});
|
|
267295
|
+
textFeatures.push(textFeature);
|
|
267296
|
+
}
|
|
267297
|
+
});
|
|
267298
|
+
this.cityNameLayer = new layer_Vector["default"]({
|
|
267299
|
+
layerName: "cityNameLayer",
|
|
267300
|
+
source: new source_Vector["default"]({
|
|
267301
|
+
features: textFeatures
|
|
267302
|
+
}),
|
|
267303
|
+
zIndex: 4,
|
|
267304
|
+
style: new Style["default"]({
|
|
267305
|
+
text: new ol_style_Text["default"]({
|
|
267306
|
+
text: function (feature) {
|
|
267307
|
+
return feature.get('name');
|
|
267308
|
+
},
|
|
267309
|
+
fill: new Fill["default"]({
|
|
267310
|
+
color: '#333'
|
|
267311
|
+
}),
|
|
267312
|
+
font: '12px sans-serif',
|
|
267313
|
+
textAlign: 'center',
|
|
267314
|
+
textBaseline: 'middle'
|
|
267315
|
+
})
|
|
267316
|
+
})
|
|
267317
|
+
});
|
|
267318
|
+
|
|
267319
|
+
// 添加图层到地图
|
|
267320
|
+
this.map.addLayer(this.dushiquanLayer);
|
|
267321
|
+
this.map.addLayer(this.cityNameLayer);
|
|
267322
|
+
}).catch(error => {
|
|
267323
|
+
console.error("加载城市区域数据失败:", error);
|
|
267324
|
+
});
|
|
267211
267325
|
}
|
|
267212
267326
|
}
|
|
267213
267327
|
});
|