+
@@ -33,22 +33,22 @@
//newfiberMap.setBaseMapByEnum([NewFiberMap.Enum.BaseMap.AMAP_VECTOR_V1]);
newfiberMap.setView({
lng: 114.312,
- lat: 34.502,
+ lat: 34.802,
heading: 2.281299097855777,
- zoom: 16358.12942752382,
+ zoom: 358.12942752382,
pitch: -25.2508969308367,
roll: 0.005453465256790101,
});
- newfiberMap.loadWmsLayer({
- url: '/geoserver/henan_kaifeng/wms',
- layers: 'henan_kaifeng:' + 'henan_kaifeng_lake',
- visible: true,
- });
- newfiberMap.loadWmsLayer({
- url: '/geoserver/henan_kaifeng/wms',
- layers: 'henan_kaifeng:' + 'henan_kaifeng_river',
- visible: true,
- });
+ // newfiberMap.loadWmsLayer({
+ // url: '/geoserver/henan_kaifeng/wms',
+ // layers: 'henan_kaifeng:' + 'henan_kaifeng_lake',
+ // visible: true,
+ // });
+ // newfiberMap.loadWmsLayer({
+ // url: '/geoserver/henan_kaifeng/wms',
+ // layers: 'henan_kaifeng:' + 'henan_kaifeng_river',
+ // visible: true,
+ // });
newfiberMap.registerLeftClickEvt(async (position, point, feature) => {
if (!feature) return;
if (
@@ -81,20 +81,34 @@
});
NewFiberMapUtils.weatherToMap(newfiberMap);
};
-
+//添加三维管网
+const addCesiumPipe = () => {
+ let dataList = [
+ 'https://server1.wh-nf.cn:9000/newfiber-standard-kaifeng/2024/06/24/pipeData/ysline/ysline.scp',
+ 'https://server1.wh-nf.cn:9000/newfiber-standard-kaifeng/2024/06/24/pipeData/YS_Point/YS_Point.scp',
+ 'https://server1.wh-nf.cn:9000/newfiber-standard-kaifeng/2024/06/24/pipeData/wsLine/wsLine.scp',
+ 'https://server1.wh-nf.cn:9000/newfiber-standard-kaifeng/2024/06/24/pipeData/WS_Point/WS_Point.scp',
+ 'https://server1.wh-nf.cn:9000/newfiber-standard-kaifeng/2024/06/24/pipeData/hsLine/hsLine.scp',
+ 'https://server1.wh-nf.cn:9000/newfiber-standard-kaifeng/2024/06/24/pipeData/hs_Point/hs_Point.scp',
+ ];
+ dataList.forEach((url, index) => {
+ newfiberVectorLayer.add3DModelLayers(newfiberMap, url, 'cesiumPipe' + index);
+ });
+};
onMounted(() => {
createIniteMap();
- window.currentWeatherTimer = null;
- newfiberVectorLayer.setCurrentWeather();
- window.currentWeatherTimer = setInterval(() => {
- newfiberVectorLayer.setCurrentWeather();
- }, 300000);
+ addCesiumPipe();
+ // window.currentWeatherTimer = null;
+ // newfiberVectorLayer.setCurrentWeather();
+ // window.currentWeatherTimer = setInterval(() => {
+ // newfiberVectorLayer.setCurrentWeather();
+ // }, 300000);
- bus.on('closeCesiumPopup', () => {
- popupShow.value = false;
- window.PopupInfo && window.PopupInfo.hide();
- window.PopupInfo = null;
- });
+ // bus.on('closeCesiumPopup', () => {
+ // popupShow.value = false;
+ // window.PopupInfo && window.PopupInfo.hide();
+ // window.PopupInfo = null;
+ // });
});
onBeforeUnmount(() => {
clearInterval(window.currentWeatherTimer);
diff --git a/src/views/sponeScreen/gisMF/mapboxVectorLayer.js b/src/views/sponeScreen/gisMF/mapboxVectorLayer.js
index f2a471b..ce517de 100644
--- a/src/views/sponeScreen/gisMF/mapboxVectorLayer.js
+++ b/src/views/sponeScreen/gisMF/mapboxVectorLayer.js
@@ -72,6 +72,7 @@
'icon-size': 0.8,
'text-field': '{name}',
'text-font': ['KlokanTech Noto Sans Regular'],
+ 'icon-rotate': ['get', 'bearing'],
'text-size': 16,
'text-line-height': 3,
'text-anchor': 'bottom',
@@ -253,6 +254,88 @@
});
}
}
+ //添加轨迹动态线
+ static addDynamicRoute = (layerId, geojson, icon) => {
+ window.routeTimer = null;
+ window.routeTimer_1 = null;
+ this.addGeojsonLine(layerId, geojson, 10);
+ let symbolGeojson = turf.featureCollection([
+ turf.point(geojson.features[0].geometry.coordinates[0], {
+ bearing: turf.bearing(
+ turf.point(geojson.features[0].geometry.coordinates[0]),
+ turf.point(geojson.features[0].geometry.coordinates[1])
+ ),
+ }),
+ ]);
+ let symbolGeojson_1 = turf.featureCollection([
+ turf.point(geojson.features[1].geometry.coordinates[0], {
+ bearing: turf.bearing(
+ turf.point(geojson.features[1].geometry.coordinates[0]),
+ turf.point(geojson.features[1].geometry.coordinates[1])
+ ),
+ }),
+ ]);
+ this.addGeojsonSymbol(layerId + '_Symbol', symbolGeojson, icon);
+ this.addGeojsonSymbol(layerId + '_Symbol_1', symbolGeojson_1, icon);
+ const lineDistance = turf.length(geojson.features[0]);
+ const lineDistance_1 = turf.length(geojson.features[1]);
+ const arc = [];
+ const arc_1 = [];
+ const steps = 100;
+ for (let i = 0; i < lineDistance; i += lineDistance / steps) {
+ const segment = turf.along(geojson.features[0], i);
+ arc.push(segment.geometry.coordinates);
+ }
+ for (let i = 0; i < lineDistance_1; i += lineDistance_1 / steps) {
+ const segment = turf.along(geojson.features[1], i);
+ arc_1.push(segment.geometry.coordinates);
+ }
+ geojson.features[0].geometry.coordinates = arc;
+ geojson.features[1].geometry.coordinates = arc_1;
+ let counter = 0;
+ let counter_1 = 0;
+
+ const start_1 = geojson.features[1].geometry.coordinates[counter_1 >= steps ? counter_1 - 1 : counter_1];
+ const end_1 = geojson.features[1].geometry.coordinates[counter_1 >= steps ? counter_1 : counter_1 + 1];
+ setTimeout(() => {
+ window.routeTimer = setInterval(() => {
+ const start = geojson.features[0].geometry.coordinates[counter >= steps ? counter - 1 : counter];
+ const end = geojson.features[0].geometry.coordinates[counter >= steps ? counter : counter + 1];
+ if (!start || !end) {
+ return;
+ }
+ symbolGeojson.features[0].geometry.coordinates = geojson.features[0].geometry.coordinates[counter];
+ symbolGeojson.features[0].properties.bearing = turf.bearing(turf.point(start), turf.point(end));
+
+ newfiberMapbox.map.getSource(layerId + '_Symbol').setData(symbolGeojson);
+ counter = counter + 1;
+ if (counter > steps) {
+ clearInterval(window.routeTimer);
+ }
+ }, 100);
+ window.routeTimer_1 = setInterval(() => {
+ const start_1 = geojson.features[1].geometry.coordinates[counter_1 >= steps ? counter_1 - 1 : counter_1];
+ const end_1 = geojson.features[1].geometry.coordinates[counter_1 >= steps ? counter_1 : counter_1 + 1];
+ if (!start_1 || !end_1) {
+ return;
+ }
+ symbolGeojson_1.features[0].geometry.coordinates = geojson.features[1].geometry.coordinates[counter_1];
+ symbolGeojson_1.features[0].properties.bearing = turf.bearing(turf.point(start_1), turf.point(end_1));
+
+ newfiberMapbox.map.getSource(layerId + '_Symbol_1').setData(symbolGeojson_1);
+ counter_1 = counter_1 + 1;
+ if (counter_1 > steps) {
+ clearInterval(window.routeTimer_1);
+ }
+ }, 100);
+ }, 1000);
+ // if (!start || !end || !start_1 || !end_1) {
+ // return;
+ // }
+
+ // symbolGeojson_1.features[0].geometry.coordinates = geojson.features[1].geometry.coordinates[counter_1];
+ // symbolGeojson_1.features[0].properties.bearing = turf.bearing(turf.point(start_1), turf.point(end_1));
+ };
//移除图层
static removeByIds(layernameList) {
layernameList.forEach(layerName => {
diff --git a/src/assets/geojson/kaifeng/track.json b/src/assets/geojson/kaifeng/track.json
new file mode 100644
index 0000000..0b513ca
--- /dev/null
+++ b/src/assets/geojson/kaifeng/track.json
@@ -0,0 +1,87 @@
+{
+ "type": "FeatureCollection",
+ "features": [
+ {
+ "type": "Feature",
+ "properties": {
+ "fillcolor": "rgba(82, 214, 108,1)"
+ },
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [
+ [
+ 114.35720775300125,
+ 34.794029555366635
+ ],
+ [
+ 114.35723116921616,
+ 34.79331536081194
+ ],
+ [
+ 114.35741459623294,
+ 34.792367004108165
+ ],
+ [
+ 114.35757070433233,
+ 34.79176598792552
+ ],
+ [
+ 114.3567355260006,
+ 34.79178940414043
+ ],
+ [
+ 114.35661063952115,
+ 34.79070640420094
+ ],
+ [
+ 114.35428658019148,
+ 34.790817631221735
+ ],
+ [
+ 114.3540290018275,
+ 34.78942826913719
+ ],
+ [
+ 114.35312357485105,
+ 34.783878626203986
+ ],
+ [
+ 114.35297527215664,
+ 34.782598539789014
+ ],
+ [
+ 114.35307674242124,
+ 34.78218485332564
+ ]
+ ]
+ }
+ },
+ {
+ "type": "Feature",
+ "properties": {
+ "fillcolor": "rgba(82, 214, 108,1)"
+ },
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [
+ [
+ 114.31333162031727,
+ 34.77774357789805
+ ],
+ [
+ 114.3249928953415,
+ 34.77688498335142
+ ],
+ [
+ 114.33248608411208,
+ 34.77629177257375
+ ],
+ [
+ 114.33371933809724,
+ 34.784003512683476
+ ]
+ ]
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/assets/newImgs/car.png b/src/assets/newImgs/car.png
new file mode 100644
index 0000000..e9eb325
--- /dev/null
+++ b/src/assets/newImgs/car.png
Binary files differ
diff --git a/src/views/floodSys/floodYP/riskGisMap.vue b/src/views/floodSys/floodYP/riskGisMap.vue
index 48da94c..8033af8 100644
--- a/src/views/floodSys/floodYP/riskGisMap.vue
+++ b/src/views/floodSys/floodYP/riskGisMap.vue
@@ -6,7 +6,7 @@
diff --git a/src/views/sponeScreen/HaiMianScreen/index.vue b/src/views/sponeScreen/HaiMianScreen/index.vue
index e6c4170..1474319 100644
--- a/src/views/sponeScreen/HaiMianScreen/index.vue
+++ b/src/views/sponeScreen/HaiMianScreen/index.vue
@@ -121,7 +121,9 @@
-
+
+
+