北京经济技术开发区经开区虚拟城市项目-【前端】-移动端Web
少年
2024-02-27 c6df06bd690486739067ee1ee7124ac66da720fb
src/utils/map2.js
@@ -134,7 +134,7 @@
    )
        // axios.get(window.gisBaseUrl + '/gisserver/wfsserver/qiyelianqiye?version=1.3.0&request=GetFeature&format=json&typename=企业链企业')
        .then(dataSource => {
            console.log(dataSource);
            // console.log(dataSource);
            store.qiyeJsonInfo = dataSource
        })
        .catch((err) => {
@@ -2252,6 +2252,7 @@
                .get(
                    // "http://10.10.4.115:8022/geowinmap_xncs/ds?r=0.9158559377752831&serviceproviderid=map.vectorserviceprovider&serviceid=queryfeature&featcls=225%25E8%258C%2583%25E5%259B%25B4%25E5%2588%2586%25E5%258C%25BA%25E8%25A7%2584%25E5%2588%2592.geojson&lng=" +
                    window.gisBaseUrl + "yzxncsApi/geowinmap_xncs/ds?r=0.9158559377752831&serviceproviderid=map.vectorserviceprovider&serviceid=queryfeature&featcls=225%25E8%258C%2583%25E5%259B%25B4%25E5%2588%2586%25E5%258C%25BA%25E8%25A7%2584%25E5%2588%2592.geojson&lng=" +
                    // window.gisBaseUrl + "cs/geowinmap_xncs/ds?&lng=" +
                    e.coordinate[0] +
                    "&lat=" +
                    e.coordinate[1] +
@@ -2269,26 +2270,28 @@
                    window.tdglLine = new ol.layer.Vector({
                        source: new ol.source.Vector({
                            features: [feature] // 将要素对象加入到图层源中
                        }),
                        style: new ol.style.Style({
                            stroke: new ol.style.Stroke({
                                color: 'red',
                                width: 3
                            }),
                        })
                    });
                    window.mapapi.addLayer(window.tdglLine)
                    axios
                        .get(
                    axios.get(
                            // "http://10.10.4.115:8022//poisearch/guihuacon/getInfo?ydbm=" +
                            window.gisBaseUrl + "yzxncsApi/poisearch/guihuacon/getInfo?ydbm=" +
                            response.data.NO
                        )
                        .then(
                            info => {
                        window.gisBaseUrl + "yzxncsApi/poisearch/guihuacon/getInfo?ydbm=" + response.data.NO
                    ).then((info) => {
                                let data = info.data.data;
                                if (data.yongdishuju === null) {
                                    objdata = {
                                        POITYPE: "NOTDGL",
                                        zwxx: "暂无信息",
                                        lon: window.clickPOI.lon,
                                        lat: window.clickPOI.lat,
                                lon: e.coordinate[0],
                                lat: e.coordinate[1],
                                    }
                                } else {
                                    qiyexinxi = info.data.data.qiyexinxi;
@@ -2365,9 +2368,18 @@
        }
        window.mapapi.forEachFeatureAtPixel(e.pixel, function (feature) {
            console.log(feature.getProperties(), 'aaa');
            //搜索的点位
            if (window.pointArr.length > 0) {
                let obj = feature.getProperties().desc
                objdata = {
                    POITYPE: "POINT",
                    name: obj.name,
                    address: obj.address,
                }
            } else {
            let properties = feature.getProperties().features[0].values_;
            console.log(properties, 'aaa');
            console.log(properties.values_, 'bbb');
            for (const propertyNames in properties) {
                if (propertyNames.indexOf("监控名") !== -1) {
                    // objdata = {
@@ -2388,11 +2400,11 @@
                        center: true,
                        duration: 1000,
                    });
                    layerOpen(properties["JK名称"]._value, {
                        layerOpen(properties["JK名称"], {
                        width: "100%",
                        height: "40%",
                        // offset: [offsetTop + "px", "380px"],
                        url: "../../static/video/video.html?code=" + properties["JK内码"]._value,
                            url: "../../static/video/video.html?code=" + properties["JK内码"],
                        fn: {
                            success: (layero, index) => {
                                SmartEarthPopupData.layerContainer = layero;
@@ -2442,26 +2454,11 @@
                    }
                }
            }
            if (feature && feature.values_.desc) {
                let obj = feature.values_.desc
                objdata = {
                    POITYPE: "POINT",
                    name: obj.name,
                    address: obj.address,
                }
                // if (window.instance) {
                //     window.instance.$destroy();
                // }
                // window.instance = new PoiLayerConstructor({
                //     data: {
                //         list: objdata
                //     }
                // });
                // window.instance.$mount();
            }
            store.setTdglShow(false);
            store.setTdlgInfo({});