suerprisePlus
2024-10-15 afd3fe35aeaae4f3984c94ca29d57b5a3a52107f
src/components/mapOl/index.vue
@@ -61,7 +61,7 @@
        initOlMap() {
            const baseLayer = mapData.baseLayer;
            const vecUrl = baseLayer.sUrl + baseLayer.vecLayer + baseLayer.lUrl
            const geo= config.geoServer;
            const geo = config.geoServer;
            var vectorLayer = new TileLayer({
                source: new XYZ({
                    url: vecUrl + config.tdToken,
@@ -96,7 +96,7 @@
                }),
            });
console.log(geo.url + geo.wms)
            var layer2 = new Image({
                name: "Wms_Layer",
                source: new ImageWMS({
@@ -113,12 +113,17 @@
            if (this.parentData) {
                if (this.parentData.indexOf('type') > -1) {
                    const data = JSON.parse(this.parentData)[0];
                    console.log(data);
                    this.isShow = data.isShow
                    if (data.type == 'point') {
                        const obj = mapConfig.getWKTParse(data.val.point)
                        const obj = data.val.point.split(" ");
                        console.log(obj);
                        this.formInline = {
                            lon: obj.coordinates[0],
                            lat: obj.coordinates[1],
                            lon: obj[0],
                            lat: obj[1],
                        }
                        this.addPointData(obj);
                    } else if (data.type == 'line') {
@@ -176,12 +181,12 @@
            this.mapol.addLayer(vectorLayer);
            this.mapol.getView().fit(extent, {
                size: this.mapol.getSize(),
                padding: [100, 100,200,100], // 四个方向的边距,可选
                padding: [100, 100, 200, 100], // 四个方向的边距,可选
                constrainResolution: false, // 是否限制分辨率,可选
            });
        },
        addPointData(res) {
            const coord = res.coordinates;
            const coord = res;
            const urlImg = config.sdkImg + 'Workers/image/mark.png';
            var geom = transform(