北京经济技术开发区经开区虚拟城市项目-【前端】-移动端Web
lixuliang
2024-03-22 5206e7a4f4c5b71c9ddeccdbbe5e7fba5b3eeb9b
YOUHAU
已修改6个文件
53 ■■■■■ 文件已修改
src/components/leftMenu/bottom2.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/leftMenu/sousuo2.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/rightMenu/bottom2.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sideMenu/layerTreePanel/layerTreePanel2.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/map2.js 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/tool.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/leftMenu/bottom2.vue
@@ -171,6 +171,7 @@
      window.mapapi.getView().animate({
        // 只设置需要的属性即可
        center: [116.52217697339846, 39.75979421847914], // 中心点
        projection: "EPSG:3857",
        zoom: 12, // 缩放级别
        rotation: undefined, // 缩放完成view视图旋转弧度
        duration: 1000, // 缩放持续时间,默认不需要设置
src/components/leftMenu/sousuo2.vue
@@ -429,18 +429,13 @@
                  );
                })
                .forEach((val) => {
                  let poiarr = val.location.split(",");
                  let poi = {
                    lon: parseFloat(poiarr[0]),
                    lat: parseFloat(poiarr[1]),
                  };
                  let obj = {
                    address: val.address,
                    adname: val.area,
                    cityname: val.city,
                    id: val.uid,
                    lat: val.location.lat,
                    lng: val.location.lng,
                    lat: parseFloat(val.location.lat),
                    lng: parseFloat(val.location.lng),
                    name: val.name,
                    pname: val.province,
                  };
src/components/rightMenu/bottom2.vue
@@ -105,6 +105,7 @@
      window.mapapi.getView().animate({
        // 只设置需要的属性即可
        center: window.mapapi.getView().getCenter(), // 中心点
        projection: "EPSG:3857",
        zoom: zoom + 1, // 缩放级别
        rotation: undefined, // 缩放完成view视图旋转弧度
        duration: 1000, // 缩放持续时间,默认不需要设置
@@ -116,6 +117,7 @@
      window.mapapi.getView().animate({
        // 只设置需要的属性即可
        center: window.mapapi.getView().getCenter(), // 中心点
        projection: "EPSG:3857",
        zoom: zoom - 1, // 缩放级别
        rotation: undefined, // 缩放完成view视图旋转弧度
        duration: 1000, // 缩放持续时间,默认不需要设置
@@ -125,6 +127,7 @@
      window.mapapi.getView().animate({
        // 只设置需要的属性即可
        center: ol.proj.fromLonLat([116.52217697339846, 39.75979421847914]), // 中心点
        projection: "EPSG:3857",
        zoom: 12, // 缩放级别
        rotation: undefined, // 缩放完成view视图旋转弧度
        duration: 1000, // 缩放持续时间,默认不需要设置
@@ -134,6 +137,7 @@
      window.mapapi.getView().animate({
        // 只设置需要的属性即可
        center: window.personalPoi, // 中心点
        projection: "EPSG:3857",
        zoom: 17, // 缩放级别
        rotation: undefined, // 缩放完成view视图旋转弧度
        duration: 1500, // 缩放持续时间,默认不需要设置
src/components/sideMenu/layerTreePanel/layerTreePanel2.vue
@@ -2005,8 +2005,6 @@
          window.mapapi.getView().getZoom() ==
          window.mapapi.getView().getMaxZoom()
        ) {
          console.log("max");
          clusterSource.setDistance(0);
        } else {
          clusterSource.setDistance(40);
@@ -2106,8 +2104,6 @@
          window.mapapi.getView().getZoom() ==
          window.mapapi.getView().getMaxZoom()
        ) {
          console.log("max");
          clusterSource.setDistance(0);
        } else {
          clusterSource.setDistance(40);
@@ -2381,16 +2377,19 @@
      window.mapapi.removeLayer(window.jkspclusterLayer);
      window.mapapi.addLayer(window.qiyeclusterLayer);
      loading.close();
      //监听最大层级 聚合距离为0 取消聚合
      window.mapapi.getView().on("change:resolution", function (event) {
        if (
          window.mapapi.getView().getZoom() ==
          window.mapapi.getView().getMaxZoom()
        ) {
          clusterSource.setDistance(0);
          // clusterSource.getSource().clear()
          // console.log("企业");
        } else {
          clusterSource.setDistance(40);
        }
      });
      });
      // 监听地图单击事件
      // window.mapapi.on("singleclick", function (e) {
      //   var pixel = window.mapapi.getEventPixel(e.originalEvent);
@@ -2507,7 +2506,7 @@
      //     cluster.billboard.height = 40;
      //   }
      // });
    },
    },
    testSDKcluster() {
      let clusterLayer1 = new SmartEarth.ClusterLayer(Viewer, {
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,
            });
src/utils/tool.js
@@ -132,7 +132,8 @@
            url: `https://skyzt.bda.gov.cn/yzAdapter/Vector/?request=1&year=${layerName}&type=Sate&level={z}&x={x}&y={y}`,
        })
    });
    window.mapapi.addLayer(_GLOBAL.historyLayer);
    // window.mapapi.addLayer(_GLOBAL.historyLayer);
    layersArray.insertAt(1, _GLOBAL.historyLayer);
}
var topResolution = 896.0859375;
var resolutions = [];