本地geojson删除

dianlixunjian
徐景良 2024-08-19 17:26:11 +08:00
parent 4758f47632
commit 3a887b70ce
9 changed files with 112 additions and 589131 deletions

View File

@ -1286,7 +1286,6 @@
//
let currentIndex = null;
imageList.value?.forEach((item,index)=>{
console.log("filePath123",item.filePath,fileName);
if(item.filePath?.match(fileName)){
currentIndex = index;
}

View File

@ -152,6 +152,7 @@
<a-image-preview-group
:preview="{
getContainer:getContainer,
onVisibleChange:handlerImageChange
}"
>
<template v-for="(imageItem, imageIndex) in anjianzhaopianList" :key="imageIndex">
@ -500,7 +501,7 @@
zhengshiImageList.push(imageList.value[index]);
}
})
// console.log("imageList",imageList.value);
// console.log("anjianzhaopianList",anjianzhaopianList.value);
// console.log("zhengshiImageList",zhengshiImageList);
@ -518,12 +519,39 @@
}
const isInitImageLisener = ref<Boolean>(false);
//
function handlerImageChange(e):void{
if(e && !isInitImageLisener.value){
setTimeout(function(){
const targetNode = document.getElementsByClassName('ant-image-preview-img');
//
const observer = new MutationObserver((mutationsList) => {
for (const mutation of mutationsList) {
if (mutation.type === 'attributes') {
if(targetNode[0].getAttribute(mutation.attributeName).match("http")){
handlerPreviewImage(0,targetNode[0].getAttribute(mutation.attributeName))
}
}
}
});
//
const config = { attributes: true };
//
observer.observe(targetNode[0], config);
isInitImageLisener.value = true;
},250)
}
}
onBeforeMount(()=>{
})
const anjianzhaopianList = computed(() => {
getCaseImgList();
return anjianzhaopian ? anjianzhaopian.split(',') : [];

View File

@ -513,8 +513,21 @@ const handlerLoadCountyLayer = (geojson)=>{
)
}
}
function getMaskData(){
axios({
method:"get",
url:`http://120.222.154.7:8090/geoserver/linyishi/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=linyishi%3Ashijie&maxFeatures=50&outputFormat=application%2Fjson`,
}).then(res=>{
let geojson = {DATA:res.data.features[0].geometry.coordinates[0][0]}
handlerLoadMaskLayer(geojson);
});
}
//
function handlerLoadMaskLayer(){
function handlerLoadMaskLayer(geojson){
map.addLayer({
// //
id: 'mb-tag',
@ -533,7 +546,7 @@ function handlerLoadMaskLayer(){
[180, -90],
[-180, -90],
],
waiData.DATA,
geojson.DATA,
],
},
},
@ -705,7 +718,8 @@ onMounted(()=>{
// });;
handlerCheckUserOrgs();
handlerLoadMaskLayer();
// handlerLoadMaskLayer();
getMaskData();
handlerDealStreet();
handlerDealCountry();

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,6 @@ import { generateUUID} from '@/components/MapboxMaps/src/tool'
import { WktToGeojson } from '@/components/MapboxMaps/src/WktGeojsonTransform';
import mapboxgl,{ Map, Popup } from 'mapbox-gl';
import {MAPBOX_TOKEN,TINADITU_TOKEN,MAP_VIEWER} from './config.ts'
import heatGeoJson from './data.json'
import {getPolygonCenter} from '@/api/tiankongdi'
import axios from 'axios'
import { waiData } from "./linyishi";
@ -280,41 +279,57 @@ async function handlerDealPoint(code=""){
map.moveLayer("unclustered-point","heatLayer")
}
}
//
function getMaskData(){
axios({
method:"get",
url:`http://120.222.154.7:8090/geoserver/linyishi/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=linyishi%3Ashijie&maxFeatures=50&outputFormat=application%2Fjson`,
}).then(res=>{
let geojson = {DATA:res.data.features[0].geometry.coordinates[0][0]}
handlerLoadMaskLayer(geojson);
});
}
//
function handlerLoadMaskLayer(){
function handlerLoadMaskLayer(geojson){
map.addLayer({
// //
id: 'mb-tag',
type: 'fill',
source: {
type: 'geojson',
data: {
type: 'Feature',
geometry: {
type: 'Polygon',
coordinates: [
[
//
[-180, 90],
[180, 90],
[180, -90],
[-180, -90],
],
waiData.DATA,
// //
id: 'mb-tag',
type: 'fill',
source: {
type: 'geojson',
data: {
type: 'Feature',
geometry: {
type: 'Polygon',
coordinates: [
[
//
[-180, 90],
[180, 90],
[180, -90],
[-180, -90],
],
},
geojson.DATA,
],
},
},
paint: {
'fill-color': '#ffffff',
'fill-opacity': 1 /* 透明度 */,
},
layout: {
visibility: 'visible',
},
});
},
},
paint: {
'fill-color': '#ffffff',
'fill-opacity': 1 /* 透明度 */,
},
layout: {
visibility: 'visible',
},
});
if(map.getLayer('countyLayer')){
map.moveLayer("countyLayer","mb-tag")
}
}
//
@ -511,9 +526,9 @@ const handlerLoadCountyLayer = (geojson)=>{
}
}
)
// map.moveLayer("heatLayer","countLayer");
// map.moveLayer("historyLayerLine","countLayer");
// map.moveLayer("historyLayerFill","countLayer");
if(map.getLayer('mb-tag')){
map.moveLayer("countyLayer","mb-tag")
}
}
}
@ -651,7 +666,8 @@ onMounted(()=>{
// handlerDealCountry();
// handlerDealPoint();
// handlerLoadPolygon();
handlerLoadMaskLayer();
// handlerLoadMaskLayer();
getMaskData();
emits("onload");
map.on("click",(e)=>{
var center = map.getCenter(); //

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,6 @@
import heatGeoJson from './data.json';
import { getPolygonCenter } from '@/api/tiankongdi';
import axios from 'axios';
import { waiData } from './linyishi';
import { getAppEnvConfig } from '@/utils/env';
const { VITE_GLOB_API_URL } = getAppEnvConfig();
const VITE_GLOB_API_URL_VAR = ref<String>(VITE_GLOB_API_URL);
@ -319,8 +318,20 @@
}
}
//
function getMaskData(){
axios({
method:"get",
url:`http://120.222.154.7:8090/geoserver/linyishi/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=linyishi%3Ashijie&maxFeatures=50&outputFormat=application%2Fjson`,
}).then(res=>{
let geojson = {DATA:res.data.features[0].geometry.coordinates[0][0]}
handlerLoadMaskLayer(geojson);
});
}
//
function handlerLoadMaskLayer() {
function handlerLoadMaskLayer(geojson) {
map.addLayer({
// //
id: 'mb-tag',
@ -339,7 +350,7 @@
[180, -90],
[-180, -90],
],
waiData.DATA,
geojson.DATA,
],
},
},
@ -661,7 +672,8 @@
// handlerDealCountry();
// handlerDealPoint();
// handlerLoadPolygon();
handlerLoadMaskLayer();
// handlerLoadMaskLayer();
getMaskData();
loadMonitorLayer();
loadFuFeiLayer();
getHangFeiPlanData();