北京经济技术开发区经开区虚拟城市项目-【前端】-移动端Web
lixuliang
2024-03-22 5206e7a4f4c5b71c9ddeccdbbe5e7fba5b3eeb9b
src/utils/map2.js
@@ -2376,6 +2376,7 @@
        window.mapapi.forEachFeatureAtPixel(e.pixel, function (feature) {
            console.log(feature.getProperties(), 'aaa');
            //搜索的点位
            if (window.pointArr.length > 0) {
                let obj = feature.getProperties().desc
@@ -2391,7 +2392,7 @@
                for (const propertyNames in properties) {
                    if (propertyNames.indexOf("监控名") !== -1) {
                        const infoM = Message({
                            message: '该点位视频监控查询中,请稍后',
                            message: '该点位视频监控加载中,请稍后',
                            type: 'info',
                            offset: 75,
                            center: true,
@@ -2402,7 +2403,10 @@
                                // 请求在线状态
                                window.gisBaseUrl + "BEApi/getCameraDetails?cameraIndexCode=" +
                                properties["JK内码"]
                            ).then(res => {
                                , {
                                    timeout: 6000
                                })
                            .then(res => {
                                if (res.data.data.status == 1) {
                                    infoM.close();
                                    Message({
@@ -2432,14 +2436,25 @@
                                } else {
                                    infoM.close();
                                    Message({
                                        message: '该点位视频监控离线中',
                                        type: 'errer',
                                        message: '该视频监控离线中',
                                        type: 'error',
                                        offset: 75,
                                        center: true,
                                        duration: 2000,
                                    });
                                    return
                                }
                            })
                            .catch(err => {
                                infoM.close();
                                Message({
                                    message: '该视频监控请求超时',
                                    type: 'error',
                                    offset: 75,
                                    center: true,
                                    duration: 2000,
                                });
                                return
                            })
                        return
                    } else if (propertyNames.indexOf("部件名称") !== -1) {
@@ -2498,6 +2513,7 @@
export function flyToPoint(posisitons) {
    window.mapapi.getView().animate({
        center: ol.proj.fromLonLat(posisitons),
        projection: "EPSG:3857",
        zoom: 18,
        duration: 1500
    })
@@ -2513,6 +2529,7 @@
        if (len === 2) {
            window.mapapi.getView().animate({
                center: window.mapapi.getView().getCenter(),
                projection: "EPSG:3857",
                zoom: window.mapapi.getView().getZoom() - 1,
                duration: 1000,
            });