diff --git a/index.html b/index.html index a401043..c0c17e2 100644 --- a/index.html +++ b/index.html @@ -235,7 +235,7 @@ - + + + diff --git a/index.html b/index.html index a401043..c0c17e2 100644 --- a/index.html +++ b/index.html @@ -235,7 +235,7 @@ - + + + diff --git a/public/static/libs/mapbox/style/wh_dhgx.json b/public/static/libs/mapbox/style/wh_dhgx.json index 1660e35..36d0179 100644 --- a/public/static/libs/mapbox/style/wh_dhgx.json +++ b/public/static/libs/mapbox/style/wh_dhgx.json @@ -50,6 +50,11 @@ ] }, "mapbox": { + "models": { + "maple2-lod1": "https://supermap0.wh-nf.cn:8090/resource/glb/maple2-lod1.glb", + "tower": "https://supermap0.wh-nf.cn:8090/resource/glb/tower.glb", + "pine1-lod2": "https://supermap0.wh-nf.cn:8090/resource/glb/pine1-lod2.glb" + }, "images": [ {"name": "水库水位@2x", "url": "/static/libs/mapbox/images/水库水位@2x.png"}, {"name": "污水处理站", "url": "/static/libs/mapbox/images/污水处理站.png"}, @@ -1046,7 +1051,12 @@ "text-transform": "uppercase" }, "paint": { - "text-color": "#22acfa", + "text-color": [ + "match", + ["get", "is_flag"], + 1,"rgba(60,60,60,1)", + "#22acfa" + ], "text-halo-color": "rgba(255,255,255,1)", "text-halo-width": 2 }, @@ -1367,6 +1377,7 @@ "layout": {}, "minzoom": 7, "maxzoom": 24, + "isNotCache": true, "mType": "geojsonMvt", "columns": "pipeline_code AS 管段编码, pipeline_texture AS 管线材质, pipeline_diameter AS 管径, pipeline_type AS 管段类型, flow_direction AS 流向, drainage_system AS 流域, ys as 雨水系统, ws as 污水系统,st_asText(geometrys) as geometry" }, @@ -1417,6 +1428,7 @@ }, "minzoom": 17, "maxzoom": 24, + "isNotCache": true, "mType": "geojsonMvt", "columns": "point_number AS 外业点号,appendage AS 附属物, point_type AS 类型, area_water_name as 流域, ys as 雨水系统, ws as 污水系统,st_asText(geometrys) as geometry" }, @@ -1471,6 +1483,7 @@ "text-halo-color": "hsl(0, 0%, 100%)", "text-halo-width": 2 }, + "isNotCache": true, "mType": "geojsonMvt", "columns": "pipeline_code AS 管段编码, pipeline_texture AS 管线材质, pipeline_diameter AS 管径, pipeline_type AS 管段类型, flow_direction AS 流向, drainage_system AS 流域, ys as 雨水系统, ws as 污水系统,st_asText(geometrys) as geometry" }, @@ -1529,6 +1542,26 @@ }, "mType": "geojsonMvt", "columns": "height" + }, + { + "id": "trees", + "key": "hb_wh_dhgx_models", + "type": "model", + "minzoom": 10, + "layout": { + "model-id": ["get","model_id"], + "visibility": "none" + }, + "paint": { + "model-cutoff-fade-range":0.5, + "model-color": ["get","color"], + "model-color-mix-intensity": ["get","mix_intensity"], + "model-opacity": ["get","opacity"], + "model-rotation": ["get","rotation"], + "model-scale": ["get","scale"] + }, + "mType": "geojsonMvt", + "columns": "id,st_asText ( geometrys ) AS geometry,color,mix_intensity :: FLOAT as mix_intensity,fade_range :: FLOAT as fade_range,opacity :: FLOAT as opacity,string_to_array( rotation, ',' ) :: FLOAT [] as rotation,string_to_array( SCALE, ',' ) :: FLOAT [] as scale,model_id " } ], "orders": [ @@ -1621,3 +1654,6 @@ "五加湖": {"layerName": ["港渠", "港渠_text"], "filter": [[],[]]} } } + + + diff --git a/index.html b/index.html index a401043..c0c17e2 100644 --- a/index.html +++ b/index.html @@ -235,7 +235,7 @@ - + + + diff --git a/public/static/libs/mapbox/style/wh_dhgx.json b/public/static/libs/mapbox/style/wh_dhgx.json index 1660e35..36d0179 100644 --- a/public/static/libs/mapbox/style/wh_dhgx.json +++ b/public/static/libs/mapbox/style/wh_dhgx.json @@ -50,6 +50,11 @@ ] }, "mapbox": { + "models": { + "maple2-lod1": "https://supermap0.wh-nf.cn:8090/resource/glb/maple2-lod1.glb", + "tower": "https://supermap0.wh-nf.cn:8090/resource/glb/tower.glb", + "pine1-lod2": "https://supermap0.wh-nf.cn:8090/resource/glb/pine1-lod2.glb" + }, "images": [ {"name": "水库水位@2x", "url": "/static/libs/mapbox/images/水库水位@2x.png"}, {"name": "污水处理站", "url": "/static/libs/mapbox/images/污水处理站.png"}, @@ -1046,7 +1051,12 @@ "text-transform": "uppercase" }, "paint": { - "text-color": "#22acfa", + "text-color": [ + "match", + ["get", "is_flag"], + 1,"rgba(60,60,60,1)", + "#22acfa" + ], "text-halo-color": "rgba(255,255,255,1)", "text-halo-width": 2 }, @@ -1367,6 +1377,7 @@ "layout": {}, "minzoom": 7, "maxzoom": 24, + "isNotCache": true, "mType": "geojsonMvt", "columns": "pipeline_code AS 管段编码, pipeline_texture AS 管线材质, pipeline_diameter AS 管径, pipeline_type AS 管段类型, flow_direction AS 流向, drainage_system AS 流域, ys as 雨水系统, ws as 污水系统,st_asText(geometrys) as geometry" }, @@ -1417,6 +1428,7 @@ }, "minzoom": 17, "maxzoom": 24, + "isNotCache": true, "mType": "geojsonMvt", "columns": "point_number AS 外业点号,appendage AS 附属物, point_type AS 类型, area_water_name as 流域, ys as 雨水系统, ws as 污水系统,st_asText(geometrys) as geometry" }, @@ -1471,6 +1483,7 @@ "text-halo-color": "hsl(0, 0%, 100%)", "text-halo-width": 2 }, + "isNotCache": true, "mType": "geojsonMvt", "columns": "pipeline_code AS 管段编码, pipeline_texture AS 管线材质, pipeline_diameter AS 管径, pipeline_type AS 管段类型, flow_direction AS 流向, drainage_system AS 流域, ys as 雨水系统, ws as 污水系统,st_asText(geometrys) as geometry" }, @@ -1529,6 +1542,26 @@ }, "mType": "geojsonMvt", "columns": "height" + }, + { + "id": "trees", + "key": "hb_wh_dhgx_models", + "type": "model", + "minzoom": 10, + "layout": { + "model-id": ["get","model_id"], + "visibility": "none" + }, + "paint": { + "model-cutoff-fade-range":0.5, + "model-color": ["get","color"], + "model-color-mix-intensity": ["get","mix_intensity"], + "model-opacity": ["get","opacity"], + "model-rotation": ["get","rotation"], + "model-scale": ["get","scale"] + }, + "mType": "geojsonMvt", + "columns": "id,st_asText ( geometrys ) AS geometry,color,mix_intensity :: FLOAT as mix_intensity,fade_range :: FLOAT as fade_range,opacity :: FLOAT as opacity,string_to_array( rotation, ',' ) :: FLOAT [] as rotation,string_to_array( SCALE, ',' ) :: FLOAT [] as scale,model_id " } ], "orders": [ @@ -1621,3 +1654,6 @@ "五加湖": {"layerName": ["港渠", "港渠_text"], "filter": [[],[]]} } } + + + diff --git a/src/components/Map/Map.vue b/src/components/Map/Map.vue index 5552a13..de276b2 100644 --- a/src/components/Map/Map.vue +++ b/src/components/Map/Map.vue @@ -66,7 +66,7 @@ styleJson.sprite = styleJson.sprite.includes("http") ? styleJson.sprite : location.origin + baseUrl + styleJson.sprite; - + config.params.mapbox.models && (styleJson.models = config.params.mapbox.models) window.newfiberMap = new mapboxL7.Scene({ id: "cesiumContainer", map: new mapboxL7.Mapbox({ @@ -163,12 +163,12 @@ async function getGeoJSON() { config.geojsonMvts = {}; let url = config.mapbox.filter((i) => i.mType == "geojsonMvt").map((item) => { - let { mType, columns, geom_column, id, key } = item; + let { mType, columns, geom_column, id, key,isNotCache } = 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}`); - params.push(`t=${new Date().getTime()}`); + if(isNotCache) params.push(`t=${new Date().getTime()}`); return (config.params.geojson + `/${key}${!isGeojsonCache ? "_" + (geom_column || "geometrys") + ".geojson" : ""}?` + params.join("&")); }); url = Array.from(new Set(url)); diff --git a/index.html b/index.html index a401043..c0c17e2 100644 --- a/index.html +++ b/index.html @@ -235,7 +235,7 @@ - + + + diff --git a/public/static/libs/mapbox/style/wh_dhgx.json b/public/static/libs/mapbox/style/wh_dhgx.json index 1660e35..36d0179 100644 --- a/public/static/libs/mapbox/style/wh_dhgx.json +++ b/public/static/libs/mapbox/style/wh_dhgx.json @@ -50,6 +50,11 @@ ] }, "mapbox": { + "models": { + "maple2-lod1": "https://supermap0.wh-nf.cn:8090/resource/glb/maple2-lod1.glb", + "tower": "https://supermap0.wh-nf.cn:8090/resource/glb/tower.glb", + "pine1-lod2": "https://supermap0.wh-nf.cn:8090/resource/glb/pine1-lod2.glb" + }, "images": [ {"name": "水库水位@2x", "url": "/static/libs/mapbox/images/水库水位@2x.png"}, {"name": "污水处理站", "url": "/static/libs/mapbox/images/污水处理站.png"}, @@ -1046,7 +1051,12 @@ "text-transform": "uppercase" }, "paint": { - "text-color": "#22acfa", + "text-color": [ + "match", + ["get", "is_flag"], + 1,"rgba(60,60,60,1)", + "#22acfa" + ], "text-halo-color": "rgba(255,255,255,1)", "text-halo-width": 2 }, @@ -1367,6 +1377,7 @@ "layout": {}, "minzoom": 7, "maxzoom": 24, + "isNotCache": true, "mType": "geojsonMvt", "columns": "pipeline_code AS 管段编码, pipeline_texture AS 管线材质, pipeline_diameter AS 管径, pipeline_type AS 管段类型, flow_direction AS 流向, drainage_system AS 流域, ys as 雨水系统, ws as 污水系统,st_asText(geometrys) as geometry" }, @@ -1417,6 +1428,7 @@ }, "minzoom": 17, "maxzoom": 24, + "isNotCache": true, "mType": "geojsonMvt", "columns": "point_number AS 外业点号,appendage AS 附属物, point_type AS 类型, area_water_name as 流域, ys as 雨水系统, ws as 污水系统,st_asText(geometrys) as geometry" }, @@ -1471,6 +1483,7 @@ "text-halo-color": "hsl(0, 0%, 100%)", "text-halo-width": 2 }, + "isNotCache": true, "mType": "geojsonMvt", "columns": "pipeline_code AS 管段编码, pipeline_texture AS 管线材质, pipeline_diameter AS 管径, pipeline_type AS 管段类型, flow_direction AS 流向, drainage_system AS 流域, ys as 雨水系统, ws as 污水系统,st_asText(geometrys) as geometry" }, @@ -1529,6 +1542,26 @@ }, "mType": "geojsonMvt", "columns": "height" + }, + { + "id": "trees", + "key": "hb_wh_dhgx_models", + "type": "model", + "minzoom": 10, + "layout": { + "model-id": ["get","model_id"], + "visibility": "none" + }, + "paint": { + "model-cutoff-fade-range":0.5, + "model-color": ["get","color"], + "model-color-mix-intensity": ["get","mix_intensity"], + "model-opacity": ["get","opacity"], + "model-rotation": ["get","rotation"], + "model-scale": ["get","scale"] + }, + "mType": "geojsonMvt", + "columns": "id,st_asText ( geometrys ) AS geometry,color,mix_intensity :: FLOAT as mix_intensity,fade_range :: FLOAT as fade_range,opacity :: FLOAT as opacity,string_to_array( rotation, ',' ) :: FLOAT [] as rotation,string_to_array( SCALE, ',' ) :: FLOAT [] as scale,model_id " } ], "orders": [ @@ -1621,3 +1654,6 @@ "五加湖": {"layerName": ["港渠", "港渠_text"], "filter": [[],[]]} } } + + + diff --git a/src/components/Map/Map.vue b/src/components/Map/Map.vue index 5552a13..de276b2 100644 --- a/src/components/Map/Map.vue +++ b/src/components/Map/Map.vue @@ -66,7 +66,7 @@ styleJson.sprite = styleJson.sprite.includes("http") ? styleJson.sprite : location.origin + baseUrl + styleJson.sprite; - + config.params.mapbox.models && (styleJson.models = config.params.mapbox.models) window.newfiberMap = new mapboxL7.Scene({ id: "cesiumContainer", map: new mapboxL7.Mapbox({ @@ -163,12 +163,12 @@ async function getGeoJSON() { config.geojsonMvts = {}; let url = config.mapbox.filter((i) => i.mType == "geojsonMvt").map((item) => { - let { mType, columns, geom_column, id, key } = item; + let { mType, columns, geom_column, id, key,isNotCache } = 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}`); - params.push(`t=${new Date().getTime()}`); + if(isNotCache) params.push(`t=${new Date().getTime()}`); return (config.params.geojson + `/${key}${!isGeojsonCache ? "_" + (geom_column || "geometrys") + ".geojson" : ""}?` + params.join("&")); }); url = Array.from(new Set(url)); diff --git a/vite.config.js b/vite.config.js index 9ba7c16..dbc197c 100644 --- a/vite.config.js +++ b/vite.config.js @@ -5,9 +5,9 @@ import autoprefixer from 'autoprefixer'; const Timestamp = new Date().getTime(); //随机时间戳 -// let ipLink = 'https://server1.wh-nf.cn:8201/prod-api'; +let ipLink = 'https://dhgx.wh-nf.cn:8201/prod-api'; // let ipLink = 'http://192.168.16.135:9100'; -let ipLink = 'http://192.168.16.124:9100'; +// let ipLink = 'http://192.168.16.124:9100'; // let ipLink = 'http://192.168.20.43:9100'; // 刘总 /* */ // https://vitejs.dev/config/