diff --git a/src/views/sponeScreen/cityGK/PhysicalGeography.vue b/src/views/sponeScreen/cityGK/PhysicalGeography.vue index d6afb0e..31ba4f6 100644 --- a/src/views/sponeScreen/cityGK/PhysicalGeography.vue +++ b/src/views/sponeScreen/cityGK/PhysicalGeography.vue @@ -265,6 +265,13 @@ }); clearInterval(mapboxTimer); }); + setTimeout(() => { + newfiberMapbox.map.easeTo({ + center: [114.315, 34.852], + zoom: 10.4, + pitch: 10, + }); + }, 3000); // newfiberVectorLayer.addGeojsonPolygon(newfiberMap, oneCenter1, 'oneCenter'); // newfiberVectorLayer.addGeojsonPolygon(newfiberMap, oneCenter2, 'oneCenter'); // newfiberVectorLayer.addGeojsonPolygon(newfiberMap, oneCenter, 'oneCenter'); diff --git a/src/views/sponeScreen/cityGK/PhysicalGeography.vue b/src/views/sponeScreen/cityGK/PhysicalGeography.vue index d6afb0e..31ba4f6 100644 --- a/src/views/sponeScreen/cityGK/PhysicalGeography.vue +++ b/src/views/sponeScreen/cityGK/PhysicalGeography.vue @@ -265,6 +265,13 @@ }); clearInterval(mapboxTimer); }); + setTimeout(() => { + newfiberMapbox.map.easeTo({ + center: [114.315, 34.852], + zoom: 10.4, + pitch: 10, + }); + }, 3000); // newfiberVectorLayer.addGeojsonPolygon(newfiberMap, oneCenter1, 'oneCenter'); // newfiberVectorLayer.addGeojsonPolygon(newfiberMap, oneCenter2, 'oneCenter'); // newfiberVectorLayer.addGeojsonPolygon(newfiberMap, oneCenter, 'oneCenter'); diff --git a/src/views/sponeScreen/projectHM/ProjectDisplay_1.vue b/src/views/sponeScreen/projectHM/ProjectDisplay_1.vue index df78115..3b7e523 100644 --- a/src/views/sponeScreen/projectHM/ProjectDisplay_1.vue +++ b/src/views/sponeScreen/projectHM/ProjectDisplay_1.vue @@ -198,6 +198,16 @@ zoom: 12.9, pitch: 55, }); + newfiberMapbox.map.on('click', ['polygonGeojson', 'lineGeojson', 'pointGeojson'], e => { + const feature = newfiberMapbox.map + .queryRenderedFeatures([ + [e.point.x - 10 / 2, e.point.y - 10 / 2], + [e.point.x + 10 / 2, e.point.y + 10 / 2], + ]) + .filter(i => !!i.layer.id)[0]; + let properties = feature.properties; + console.log('feature--', '海绵项目点击事件', properties); + }); // newfiberMap.setCenter({ // lng: 114.322, // lat: 34.602, diff --git a/src/views/sponeScreen/cityGK/PhysicalGeography.vue b/src/views/sponeScreen/cityGK/PhysicalGeography.vue index d6afb0e..31ba4f6 100644 --- a/src/views/sponeScreen/cityGK/PhysicalGeography.vue +++ b/src/views/sponeScreen/cityGK/PhysicalGeography.vue @@ -265,6 +265,13 @@ }); clearInterval(mapboxTimer); }); + setTimeout(() => { + newfiberMapbox.map.easeTo({ + center: [114.315, 34.852], + zoom: 10.4, + pitch: 10, + }); + }, 3000); // newfiberVectorLayer.addGeojsonPolygon(newfiberMap, oneCenter1, 'oneCenter'); // newfiberVectorLayer.addGeojsonPolygon(newfiberMap, oneCenter2, 'oneCenter'); // newfiberVectorLayer.addGeojsonPolygon(newfiberMap, oneCenter, 'oneCenter'); diff --git a/src/views/sponeScreen/projectHM/ProjectDisplay_1.vue b/src/views/sponeScreen/projectHM/ProjectDisplay_1.vue index df78115..3b7e523 100644 --- a/src/views/sponeScreen/projectHM/ProjectDisplay_1.vue +++ b/src/views/sponeScreen/projectHM/ProjectDisplay_1.vue @@ -198,6 +198,16 @@ zoom: 12.9, pitch: 55, }); + newfiberMapbox.map.on('click', ['polygonGeojson', 'lineGeojson', 'pointGeojson'], e => { + const feature = newfiberMapbox.map + .queryRenderedFeatures([ + [e.point.x - 10 / 2, e.point.y - 10 / 2], + [e.point.x + 10 / 2, e.point.y + 10 / 2], + ]) + .filter(i => !!i.layer.id)[0]; + let properties = feature.properties; + console.log('feature--', '海绵项目点击事件', properties); + }); // newfiberMap.setCenter({ // lng: 114.322, // lat: 34.602, diff --git a/src/views/sponeScreen/projectHM/index.vue b/src/views/sponeScreen/projectHM/index.vue index f81f0a8..6f73580 100644 --- a/src/views/sponeScreen/projectHM/index.vue +++ b/src/views/sponeScreen/projectHM/index.vue @@ -58,14 +58,7 @@ function closed(v) { visibleqipao.value = v; } -onMounted(() => { - // 默认缩放比、中心点 - newfiberMapbox.map.easeTo({ - center: [114.35, 34.802], - zoom: 8.9, - pitch: 55, - }); -}); +onMounted(() => {});