diff --git a/public/static/libs/mapbox/night-style1.json b/public/static/libs/mapbox/night-style1.json index f27671f..bdf6856 100644 --- a/public/static/libs/mapbox/night-style1.json +++ b/public/static/libs/mapbox/night-style1.json @@ -55,7 +55,7 @@ "type": "fill", "source": "openmaptiles", "source-layer": "landuse", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -84,7 +84,7 @@ "type": "fill", "source": "openmaptiles", "source-layer": "landcover", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "==", "class", @@ -282,7 +282,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "waterway", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -338,7 +338,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "waterway", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -640,7 +640,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "transportation", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -681,7 +681,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "transportation", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -797,7 +797,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "transportation", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -1088,7 +1088,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "transportation", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -1741,7 +1741,7 @@ "type": "symbol", "source": "openmaptiles", "source-layer": "poi", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -1817,7 +1817,7 @@ "type": "symbol", "source": "openmaptiles", "source-layer": "transportation_name", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "==", "$type", @@ -1863,7 +1863,7 @@ "type": "symbol", "source": "openmaptiles", "source-layer": "place", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -2037,7 +2037,7 @@ "metadata": {}, "source": "openmaptiles", "source-layer": "building", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ diff --git a/public/static/libs/mapbox/night-style1.json b/public/static/libs/mapbox/night-style1.json index f27671f..bdf6856 100644 --- a/public/static/libs/mapbox/night-style1.json +++ b/public/static/libs/mapbox/night-style1.json @@ -55,7 +55,7 @@ "type": "fill", "source": "openmaptiles", "source-layer": "landuse", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -84,7 +84,7 @@ "type": "fill", "source": "openmaptiles", "source-layer": "landcover", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "==", "class", @@ -282,7 +282,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "waterway", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -338,7 +338,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "waterway", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -640,7 +640,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "transportation", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -681,7 +681,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "transportation", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -797,7 +797,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "transportation", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -1088,7 +1088,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "transportation", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -1741,7 +1741,7 @@ "type": "symbol", "source": "openmaptiles", "source-layer": "poi", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -1817,7 +1817,7 @@ "type": "symbol", "source": "openmaptiles", "source-layer": "transportation_name", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "==", "$type", @@ -1863,7 +1863,7 @@ "type": "symbol", "source": "openmaptiles", "source-layer": "place", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -2037,7 +2037,7 @@ "metadata": {}, "source": "openmaptiles", "source-layer": "building", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ diff --git a/public/static/libs/mapbox/style/wh_dhgx.json b/public/static/libs/mapbox/style/wh_dhgx.json index 099d076..e38be7d 100644 --- a/public/static/libs/mapbox/style/wh_dhgx.json +++ b/public/static/libs/mapbox/style/wh_dhgx.json @@ -1,8 +1,25 @@ { "params": { "basemap": "https://supermap2.wh-nf.cn:8090/bm", - "mvt": "https://supermap0.wh-nf.cn:8090/vt/v1/mvt", - "geojson": "https://supermap0.wh-nf.cn:8090/vt/geojson", + "mvt": [ + "https://supermap0.wh-nf.cn:8090/vt/mvt", + "https://supermap1.wh-nf.cn:8090/vt/mvt", + "https://supermap2.wh-nf.cn:8090/vt/mvt", + "https://supermap3.wh-nf.cn:8090/vt/mvt", + "https://supermap4.wh-nf.cn:8090/vt/mvt", + "https://supermap5.wh-nf.cn:8090/vt/mvt", + "https://supermap6.wh-nf.cn:8090/vt/mvt", + "https://supermap7.wh-nf.cn:8090/vt/mvt", + "https://supermap8.wh-nf.cn:8090/vt/mvt", + "https://supermap9.wh-nf.cn:8090/vt/mvt", + "https://supermap10.wh-nf.cn:8090/vt/mvt", + "https://supermap11.wh-nf.cn:8090/vt/mvt", + "https://supermap12.wh-nf.cn:8090/vt/mvt", + "https://supermap13.wh-nf.cn:8090/vt/mvt", + "https://supermap14.wh-nf.cn:8090/vt/mvt", + "https://supermap15.wh-nf.cn:8090/vt/mvt" + ], + "geojson": "https://supermap13.wh-nf.cn:8090/vt/geojson", "sprites": [ "/static/libs/mapbox/style/sprite/sprite" ], @@ -1143,7 +1160,7 @@ "rgba(255,0,0,1)" ], "text-halo-width": 1.5, - "text-opacity": ["step", ["zoom"], 0, 14, 1] + "text-opacity": ["step", ["zoom"], 0, 11, 1] }, "layout": { "icon-image": [ @@ -1203,7 +1220,7 @@ "temporary", "selectedLocation", "tran" ], - "icon-allow-overlap": true, + "icon-allow-overlap": false, "icon-anchor": "center", "icon-size": [ "match", @@ -1215,18 +1232,24 @@ "sewage_pipeline_quality_city",0.7, 1 ], - "text-allow-overlap": false, "text-field": "{name}", "text-font": [ "KlokanTech Noto Sans Regular" ], + "text-allow-overlap": false, "text-size": 13, "text-justify": "left", "text-anchor": "bottom", "text-line-height": 1.3, "text-max-width": 10, - "text-offset": [4.5,-2.0], - "text-optional": true + "text-offset": [ + "match", + ["get","name"], + "绣球山污水泵站",[0,3], + "湖滨泵站",[0,3], + "关东泵站",[0,3], + [3.5,-1.0] + ] }, "mType": "geojson" }, diff --git a/public/static/libs/mapbox/night-style1.json b/public/static/libs/mapbox/night-style1.json index f27671f..bdf6856 100644 --- a/public/static/libs/mapbox/night-style1.json +++ b/public/static/libs/mapbox/night-style1.json @@ -55,7 +55,7 @@ "type": "fill", "source": "openmaptiles", "source-layer": "landuse", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -84,7 +84,7 @@ "type": "fill", "source": "openmaptiles", "source-layer": "landcover", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "==", "class", @@ -282,7 +282,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "waterway", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -338,7 +338,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "waterway", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -640,7 +640,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "transportation", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -681,7 +681,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "transportation", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -797,7 +797,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "transportation", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -1088,7 +1088,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "transportation", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -1741,7 +1741,7 @@ "type": "symbol", "source": "openmaptiles", "source-layer": "poi", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -1817,7 +1817,7 @@ "type": "symbol", "source": "openmaptiles", "source-layer": "transportation_name", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "==", "$type", @@ -1863,7 +1863,7 @@ "type": "symbol", "source": "openmaptiles", "source-layer": "place", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -2037,7 +2037,7 @@ "metadata": {}, "source": "openmaptiles", "source-layer": "building", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ diff --git a/public/static/libs/mapbox/style/wh_dhgx.json b/public/static/libs/mapbox/style/wh_dhgx.json index 099d076..e38be7d 100644 --- a/public/static/libs/mapbox/style/wh_dhgx.json +++ b/public/static/libs/mapbox/style/wh_dhgx.json @@ -1,8 +1,25 @@ { "params": { "basemap": "https://supermap2.wh-nf.cn:8090/bm", - "mvt": "https://supermap0.wh-nf.cn:8090/vt/v1/mvt", - "geojson": "https://supermap0.wh-nf.cn:8090/vt/geojson", + "mvt": [ + "https://supermap0.wh-nf.cn:8090/vt/mvt", + "https://supermap1.wh-nf.cn:8090/vt/mvt", + "https://supermap2.wh-nf.cn:8090/vt/mvt", + "https://supermap3.wh-nf.cn:8090/vt/mvt", + "https://supermap4.wh-nf.cn:8090/vt/mvt", + "https://supermap5.wh-nf.cn:8090/vt/mvt", + "https://supermap6.wh-nf.cn:8090/vt/mvt", + "https://supermap7.wh-nf.cn:8090/vt/mvt", + "https://supermap8.wh-nf.cn:8090/vt/mvt", + "https://supermap9.wh-nf.cn:8090/vt/mvt", + "https://supermap10.wh-nf.cn:8090/vt/mvt", + "https://supermap11.wh-nf.cn:8090/vt/mvt", + "https://supermap12.wh-nf.cn:8090/vt/mvt", + "https://supermap13.wh-nf.cn:8090/vt/mvt", + "https://supermap14.wh-nf.cn:8090/vt/mvt", + "https://supermap15.wh-nf.cn:8090/vt/mvt" + ], + "geojson": "https://supermap13.wh-nf.cn:8090/vt/geojson", "sprites": [ "/static/libs/mapbox/style/sprite/sprite" ], @@ -1143,7 +1160,7 @@ "rgba(255,0,0,1)" ], "text-halo-width": 1.5, - "text-opacity": ["step", ["zoom"], 0, 14, 1] + "text-opacity": ["step", ["zoom"], 0, 11, 1] }, "layout": { "icon-image": [ @@ -1203,7 +1220,7 @@ "temporary", "selectedLocation", "tran" ], - "icon-allow-overlap": true, + "icon-allow-overlap": false, "icon-anchor": "center", "icon-size": [ "match", @@ -1215,18 +1232,24 @@ "sewage_pipeline_quality_city",0.7, 1 ], - "text-allow-overlap": false, "text-field": "{name}", "text-font": [ "KlokanTech Noto Sans Regular" ], + "text-allow-overlap": false, "text-size": 13, "text-justify": "left", "text-anchor": "bottom", "text-line-height": 1.3, "text-max-width": 10, - "text-offset": [4.5,-2.0], - "text-optional": true + "text-offset": [ + "match", + ["get","name"], + "绣球山污水泵站",[0,3], + "湖滨泵站",[0,3], + "关东泵站",[0,3], + [3.5,-1.0] + ] }, "mType": "geojson" }, diff --git a/src/components/Map/Map.vue b/src/components/Map/Map.vue index c04c677..0d55f15 100644 --- a/src/components/Map/Map.vue +++ b/src/components/Map/Map.vue @@ -48,7 +48,7 @@ const initeMap = async () => { console.log("baseUrl", baseUrl); config = (await axios.get(baseUrl + props.initJson)).data; - isMvtCache = config.params.mvt.includes("/v1/mvt"); + isMvtCache = config.params.mvt[0].includes("/v1/mvt"); isGeojsonCache = config.params.geojson.includes("/v1/geojson"); const { basemap } = config.params; const { style, localStyle } = config.params.init; @@ -162,42 +162,18 @@ }); async function getGeoJSON() { config.geojsonMvts = {}; - let url = config.mapbox - .filter((i) => i.mType == "geojsonMvt") - .map((item) => { + let url = config.mapbox.filter((i) => i.mType == "geojsonMvt").map((item) => { let { mType, columns, geom_column, id, key } = item; let sourceID = geom_column ? key + "_" + (geom_column || "") : key; let params = []; if (columns) params.push(`columns=${columns}`); if (geom_column) params.push(`geom_column=${geom_column}`); - return ( - config.params.geojson + - `/${key}${ - !isGeojsonCache ? "_" + (geom_column || "geometrys") + ".geojson" : "" - }?` + - params.join("&") - ); - }); + return (config.params.geojson + `/${key}${!isGeojsonCache ? "_" + (geom_column || "geometrys") + ".geojson" : ""}?` + params.join("&")); + }); url = Array.from(new Set(url)); let fetchs = url.map((url) => axios.get(url)); let results = await Promise.all(fetchs); - url.forEach( - (url, index) => - (config.geojsonMvts[url] = { - ...results[index].data, - features: - results[index].data.features && - results[index].data.features.map((i) => ({ - ...i, - properties: { - ...i.properties, - name: i.properties.name - ? i.properties.name.replaceAll("\\n", "\n") - : undefined, - }, - })), - }) - ); + url.forEach((url, index) => (config.geojsonMvts[url] = {...results[index].data, features: results[index].data.features && results[index].data.features.map((i) => ({...i, properties: {...i.properties, name: i.properties.name ? i.properties.name.replaceAll("\\n", "\n") : undefined}}))})); } async function setGifImage(item) { @@ -314,29 +290,16 @@ ...(mType == "mvt" ? { type: "vector", - tiles: [ - config.params.mvt + - `/${key}/{z}/{x}/{y}${!isMvtCache ? ".pbf" : ""}?` + - params.join("&"), - ], + tiles:config.params.mvt.map(i => i + `/${key}/{z}/{x}/{y}${!isMvtCache ? ".pbf" : ""}?` + params.join("&")), + /* tiles: [ + config.params.mvt + `/${key}/{z}/{x}/{y}${!isMvtCache ? ".pbf" : ""}?` + params.join("&"), + ],*/ tileSize: 512, scheme: "xyz", maxzoom: 14, minzoom: 1, } - : { - type: "geojson", - data: - config.geojsonMvts[ - config.params.geojson + - `/${key}${ - !isGeojsonCache - ? "_" + (geom_column || "geometrys") + ".geojson" - : "" - }?` + - params.join("&") - ], - }), + : {type: "geojson", data: config.geojsonMvts[config.params.geojson + `/${key}${!isGeojsonCache ? "_" + (geom_column || "geometrys") + ".geojson" : ""}?` + params.join("&")],}), }); } map.addLayer({ ...item, source: sourceID }); diff --git a/public/static/libs/mapbox/night-style1.json b/public/static/libs/mapbox/night-style1.json index f27671f..bdf6856 100644 --- a/public/static/libs/mapbox/night-style1.json +++ b/public/static/libs/mapbox/night-style1.json @@ -55,7 +55,7 @@ "type": "fill", "source": "openmaptiles", "source-layer": "landuse", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -84,7 +84,7 @@ "type": "fill", "source": "openmaptiles", "source-layer": "landcover", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "==", "class", @@ -282,7 +282,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "waterway", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -338,7 +338,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "waterway", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -640,7 +640,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "transportation", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -681,7 +681,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "transportation", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -797,7 +797,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "transportation", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -1088,7 +1088,7 @@ "type": "line", "source": "openmaptiles", "source-layer": "transportation", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -1741,7 +1741,7 @@ "type": "symbol", "source": "openmaptiles", "source-layer": "poi", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -1817,7 +1817,7 @@ "type": "symbol", "source": "openmaptiles", "source-layer": "transportation_name", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "==", "$type", @@ -1863,7 +1863,7 @@ "type": "symbol", "source": "openmaptiles", "source-layer": "place", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ @@ -2037,7 +2037,7 @@ "metadata": {}, "source": "openmaptiles", "source-layer": "building", - "minzoom": 14.5, + "minzoom": 15.5, "filter": [ "all", [ diff --git a/public/static/libs/mapbox/style/wh_dhgx.json b/public/static/libs/mapbox/style/wh_dhgx.json index 099d076..e38be7d 100644 --- a/public/static/libs/mapbox/style/wh_dhgx.json +++ b/public/static/libs/mapbox/style/wh_dhgx.json @@ -1,8 +1,25 @@ { "params": { "basemap": "https://supermap2.wh-nf.cn:8090/bm", - "mvt": "https://supermap0.wh-nf.cn:8090/vt/v1/mvt", - "geojson": "https://supermap0.wh-nf.cn:8090/vt/geojson", + "mvt": [ + "https://supermap0.wh-nf.cn:8090/vt/mvt", + "https://supermap1.wh-nf.cn:8090/vt/mvt", + "https://supermap2.wh-nf.cn:8090/vt/mvt", + "https://supermap3.wh-nf.cn:8090/vt/mvt", + "https://supermap4.wh-nf.cn:8090/vt/mvt", + "https://supermap5.wh-nf.cn:8090/vt/mvt", + "https://supermap6.wh-nf.cn:8090/vt/mvt", + "https://supermap7.wh-nf.cn:8090/vt/mvt", + "https://supermap8.wh-nf.cn:8090/vt/mvt", + "https://supermap9.wh-nf.cn:8090/vt/mvt", + "https://supermap10.wh-nf.cn:8090/vt/mvt", + "https://supermap11.wh-nf.cn:8090/vt/mvt", + "https://supermap12.wh-nf.cn:8090/vt/mvt", + "https://supermap13.wh-nf.cn:8090/vt/mvt", + "https://supermap14.wh-nf.cn:8090/vt/mvt", + "https://supermap15.wh-nf.cn:8090/vt/mvt" + ], + "geojson": "https://supermap13.wh-nf.cn:8090/vt/geojson", "sprites": [ "/static/libs/mapbox/style/sprite/sprite" ], @@ -1143,7 +1160,7 @@ "rgba(255,0,0,1)" ], "text-halo-width": 1.5, - "text-opacity": ["step", ["zoom"], 0, 14, 1] + "text-opacity": ["step", ["zoom"], 0, 11, 1] }, "layout": { "icon-image": [ @@ -1203,7 +1220,7 @@ "temporary", "selectedLocation", "tran" ], - "icon-allow-overlap": true, + "icon-allow-overlap": false, "icon-anchor": "center", "icon-size": [ "match", @@ -1215,18 +1232,24 @@ "sewage_pipeline_quality_city",0.7, 1 ], - "text-allow-overlap": false, "text-field": "{name}", "text-font": [ "KlokanTech Noto Sans Regular" ], + "text-allow-overlap": false, "text-size": 13, "text-justify": "left", "text-anchor": "bottom", "text-line-height": 1.3, "text-max-width": 10, - "text-offset": [4.5,-2.0], - "text-optional": true + "text-offset": [ + "match", + ["get","name"], + "绣球山污水泵站",[0,3], + "湖滨泵站",[0,3], + "关东泵站",[0,3], + [3.5,-1.0] + ] }, "mType": "geojson" }, diff --git a/src/components/Map/Map.vue b/src/components/Map/Map.vue index c04c677..0d55f15 100644 --- a/src/components/Map/Map.vue +++ b/src/components/Map/Map.vue @@ -48,7 +48,7 @@ const initeMap = async () => { console.log("baseUrl", baseUrl); config = (await axios.get(baseUrl + props.initJson)).data; - isMvtCache = config.params.mvt.includes("/v1/mvt"); + isMvtCache = config.params.mvt[0].includes("/v1/mvt"); isGeojsonCache = config.params.geojson.includes("/v1/geojson"); const { basemap } = config.params; const { style, localStyle } = config.params.init; @@ -162,42 +162,18 @@ }); async function getGeoJSON() { config.geojsonMvts = {}; - let url = config.mapbox - .filter((i) => i.mType == "geojsonMvt") - .map((item) => { + let url = config.mapbox.filter((i) => i.mType == "geojsonMvt").map((item) => { let { mType, columns, geom_column, id, key } = item; let sourceID = geom_column ? key + "_" + (geom_column || "") : key; let params = []; if (columns) params.push(`columns=${columns}`); if (geom_column) params.push(`geom_column=${geom_column}`); - return ( - config.params.geojson + - `/${key}${ - !isGeojsonCache ? "_" + (geom_column || "geometrys") + ".geojson" : "" - }?` + - params.join("&") - ); - }); + return (config.params.geojson + `/${key}${!isGeojsonCache ? "_" + (geom_column || "geometrys") + ".geojson" : ""}?` + params.join("&")); + }); url = Array.from(new Set(url)); let fetchs = url.map((url) => axios.get(url)); let results = await Promise.all(fetchs); - url.forEach( - (url, index) => - (config.geojsonMvts[url] = { - ...results[index].data, - features: - results[index].data.features && - results[index].data.features.map((i) => ({ - ...i, - properties: { - ...i.properties, - name: i.properties.name - ? i.properties.name.replaceAll("\\n", "\n") - : undefined, - }, - })), - }) - ); + url.forEach((url, index) => (config.geojsonMvts[url] = {...results[index].data, features: results[index].data.features && results[index].data.features.map((i) => ({...i, properties: {...i.properties, name: i.properties.name ? i.properties.name.replaceAll("\\n", "\n") : undefined}}))})); } async function setGifImage(item) { @@ -314,29 +290,16 @@ ...(mType == "mvt" ? { type: "vector", - tiles: [ - config.params.mvt + - `/${key}/{z}/{x}/{y}${!isMvtCache ? ".pbf" : ""}?` + - params.join("&"), - ], + tiles:config.params.mvt.map(i => i + `/${key}/{z}/{x}/{y}${!isMvtCache ? ".pbf" : ""}?` + params.join("&")), + /* tiles: [ + config.params.mvt + `/${key}/{z}/{x}/{y}${!isMvtCache ? ".pbf" : ""}?` + params.join("&"), + ],*/ tileSize: 512, scheme: "xyz", maxzoom: 14, minzoom: 1, } - : { - type: "geojson", - data: - config.geojsonMvts[ - config.params.geojson + - `/${key}${ - !isGeojsonCache - ? "_" + (geom_column || "geometrys") + ".geojson" - : "" - }?` + - params.join("&") - ], - }), + : {type: "geojson", data: config.geojsonMvts[config.params.geojson + `/${key}${!isGeojsonCache ? "_" + (geom_column || "geometrys") + ".geojson" : ""}?` + params.join("&")],}), }); } map.addLayer({ ...item, source: sourceID }); diff --git a/src/views/pictureOnMap/LayerControl.vue b/src/views/pictureOnMap/LayerControl.vue index 59036aa..73af3e6 100644 --- a/src/views/pictureOnMap/LayerControl.vue +++ b/src/views/pictureOnMap/LayerControl.vue @@ -159,6 +159,14 @@ value: "sewage_pipeline_quality_city", label: "市政污水监测", }, + { + value: "outlet_quality", + label: "排口水质", + }, + { + value: "outlet_water_level", + label: "排口水位", + }, ], }, {