当前位置: 首页 > article >正文

日常工作技术点总结

1,在el-input中只能输入数值与小数点,且不会有其他的校验影响

//在模板中
<el-col :span="7">
     <el-form-item label="建设单位支付(元)" prop="unitAmount" label-width="120px">
      el-input v-model="look_detil.unitAmount" @input="handleInputunit"
                placeholder="请输入建设单位支付"></el-input>
      </el-form-item>
 </el-col>


//在方法中使用
 handleInputunit(value) {
        this.look_detil.unitAmount = value.replace(/[^\d.]/g, '');
 },

2,在arcgis中给点位文字添加文字并且文字描边

return new esri.Graphic({
                geometry: {
                  type: "point", // autocasts as new Point()
                  longitude: w.proLong,
                  latitude: w.proLat,
                  spatialReference: {
                    wkid: 4326,
                  },
                },
                symbol: {
                  type: "text", // autocasts as new PictureMarkerSymbol()
                  text: w.proName,//显示文字文本
                  // color: "#409EFF",
                  xoffset: 0, //文字的x轴偏移量
                  yoffset: -15,//文字的y轴偏移量
                  color: "#FFF", //文字的颜色
                  haloColor: [0, 0, 0], // 阴影颜色
                  haloSize: "2px", //阴影部分加粗
                  font: {
                    size: 12, //文字字号
                    weight:'bold'//文字加粗
                  }
                },
                attributes: attributes,
              });

3,arcgis重新设定中心点(点击树形菜单时,动态切换点位置弹窗)

mapview.goTo({
        center: [item.lgtd, item.lttd] // 设置新的中心点坐标
 });

4,在arcgis中自定义设定弹窗,并且传赋值数据

//在模板中
<div ref="infoBox" class="popupinfo">
        <div class="content">
          <div class="left-content">站点编码 :</div>
          <div class="right-content">{{attributes.stcd || '-'}} </div>
        </div>
</div>


//在任意位置需要赋值的情况下
 mapview.popup.open({
        content: this.$refs.infoBox,
        location: [item.lgtd, item.lttd],
 })

5,在设置点位,初始加载的时候,添加自定义点的位置信息及数据,设置标点

      loadArcgisMap() {
        const ZHExtent = new esri.Extent({
          xmin: 117.5322298560147,
          ymin: 31.800784614565874,
          xmax: 117.88052778933827,
          ymax: 31.955502222842245,
          spatialReference: {
            wkid: 4326,
          },
        });

        GZJD_Layer = new esri.WebTileLayer({
            id: 'GZ-JD',
            urlTemplate: 'http://10.34.0.13:6080/arcgis/rest/services/BASEMAP/JCYJ_YZT/MapServer/WMTS?service=WMTS&version=1.0.0&request=GetTile&layer=BASEMAP&style=default&tileMatrixSet=default028mm&tileMatrix={level}&TileRow={row}&TileCol={col}&format=image/png',
            //urlTemplate: 'http://10.34.0.106:10009/hhglapi/arcgis12/rest/services/AHSLIMG_CHINA/MapServer/tile/{level}/{row}/{col}',
            //urlTemplate: 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/WorldTimeZones/MapServer/WMTS?service=WMTS&version=1.0.0&request=GetTile&layer=WorldTimeZones&style=default&tileMatrixSet=default028mm&tileMatrix=1&TileRow=0&TileCol=0&format=image/png',
            //urlTemplate: 'http://112.124.21.72:7070/geoserver/gwc/service/wmts?layer=AH-JD2.13&style=&tilematrixset=EPSG:4326_AH-JD2.13&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image/png&TileMatrix=EPSG:4326_AH-JD2.13:{level}&TileRow={row}&TileCol={col}',
            spatialReference: new esri.SpatialReference({
              wkid: 102100
            }),
            visible:false,
            tileInfo: {
              rows: 256,
              cols: 256,
              origin: {
                x: -2.0037508342787E7,
                y: 2.0037508342787E7
              },
              'spatialReference': {
                'wkid': 102100
              },
              'lods': [{
                'level': 0,
                'resolution': 156543.033928,
                'scale': 5.91657527591555E8
              }, {
                'level': 1,
                'resolution': 78271.5169639999,
                'scale': 2.95828763795777E8
              }, {
                'level': 2,
                'resolution': 39135.7584820001,
                'scale': 1.47914381897889E8
              }, {
                'level': 3,
                'resolution': 19567.8792409999,
                'scale': 7.3957190948944E7
              }, {
                'level': 4,
                'resolution': 9783.93962049996,
                'scale': 3.6978595474472E7
              }, {
                'level': 5,
                'resolution': 4891.96981024998,
                'scale': 1.8489297737236E7
              }, {
                'level': 6,
                'resolution': 2445.98490512499,
                'scale': 9244648.868618
              }, {
                'level': 7,
                'resolution': 1222.99245256249,
                'scale': 4622324.434309
              }, {
                'level': 8,
                'resolution': 611.49622628138,
                'scale': 2311162.217155
              }, {
                'level': 9,
                'resolution': 305.748113140558,
                'scale': 1155581.108577
              }, {
                'level': 10,
                'resolution': 152.874056570411,
                'scale': 577790.554289
              }, {
                'level': 11,
                'resolution': 76.4370282850732,
                'scale': 288895.277144
              }, {
                'level': 12,
                'resolution': 38.2185141425366,
                'scale': 144447.638572
              }, {
                'level': 13,
                'resolution': 19.1092570712683,
                'scale': 72223.819286
              }, {
                'level': 14,
                'resolution': 9.55462853563415,
                'scale': 36111.909643
              }, {
                'level': 15,
                'resolution': 4.77731426794937,
                'scale': 18055.954822
              }, {
                'level': 16,
                'resolution': 2.38865713397468,
                'scale': 9027.977411
              }, {
                'level': 17,
                'resolution': 1.19432856685505,
                'scale': 4513.988705
              }, {
                'level': 18,
                'resolution': 0.597164283559817,
                'scale': 2256.994353
              }, {
                'level': 19,
                'resolution': 0.298582141647617,
                'scale': 1128.497176
              }]
            }

        });

      GZYX_Layer0 = new esri.WebTileLayer({

        id: 'GZ-YX0',

        urlTemplate: 'http://10.34.0.106:10009/hhglapi/arcgis12/rest/services/AHSLIMG_CHINA/MapServer/tile/{level}/{row}/{col}',

        spatialReference: new esri.SpatialReference({

          wkid: 102100

        }),

        tileInfo: {

          rows: 256,

          cols: 256,

          origin: {

            x: -2.0037508342787E7,

            y: 2.0037508342787E7

          },

          'spatialReference': {

            'wkid': 102100

          },

          'lods': [{

              'level': 0,

              'resolution': 156543.03392800014,

              'scale': 5.91657527591555E8

            }, {

              'level': 1,

              'resolution': 78271.51696399994,

              'scale': 2.95828763795777E8

            }, {

              'level': 2,

              'resolution': 39135.75848200009,

              'scale': 1.47914381897889E8

            }, {

              'level': 3,

              'resolution': 19567.87924099992,

              'scale': 7.3957190948944E7

            }, {

              'level': 4,

              'resolution': 9783.93962049996,

              'scale': 3.6978595474472E7

            }, {

              'level': 5,

              'resolution': 4891.96981024998,

              'scale': 1.8489297737236E7

            }, {

              'level': 6,

              'resolution': 2445.98490512499,

              'scale': 9244648.868618

            }, {

              'level': 7,

              'resolution': 1222.992452562495,

              'scale': 4622324.434309

            }, {

              'level': 8,

              'resolution': 611.4962262813797,

              'scale': 2311162.217155

            }, {

              'level': 9,

              'resolution': 305.74811314055756,

              'scale': 1155581.108577

            }, {

              'level': 10,

              'resolution': 152.87405657041106,

              'scale': 577790.554289

            }, {

              'level': 11,

              'resolution': 76.43702828507324,

              'scale': 288895.277144

            }, {

              'level': 12,

              'resolution': 38.21851414253662,

              'scale': 144447.638572

            }, {

              'level': 13,

              'resolution': 19.10925707126831,

              'scale': 72223.819286

            }, {

              'level': 14,

              'resolution': 9.554628535634155,

              'scale': 36111.909643

            }, {

              'level': 15,

              'resolution': 4.77731426794937,

              'scale': 18055.954822

            }, {

              'level': 16,

              'resolution': 2.388657133974685,

              'scale': 9027.977411

            }, {

              'level': 17,

              'resolution': 1.1943285668550503,

              'scale': 4513.988705

            }, {

              'level': 18,

              'resolution': 0.5971642835598172,

              'scale': 2256.994353

            }, {

              'level': 19,

              'resolution': 0.29858214164761665,

              'scale': 1128.497176

            }

          ]

        }

      });

      GZYX_Layer1 = new esri.WebTileLayer({

        id: 'GZ-YX1',

        urlTemplate: 'http://10.34.0.106:10009/hhglapi/arcgis12/rest/services/AHSLIMG/MapServer/tile/{level}/{row}/{col}',

        spatialReference: new esri.SpatialReference({

          wkid: 102100

        }),

        tileInfo: {

          rows: 256,

          cols: 256,

          origin: {

            x: -2.0037508342787E7,

            y: 2.0037508342787E7

          },

          'spatialReference': {

            'wkid': 102100

          },

          'lods': [{

            'level': 0,

            'resolution': 156543.03392800014,

            'scale': 5.91657527591555E8

          }, {

            'level': 1,

            'resolution': 78271.51696399994,

            'scale': 2.95828763795777E8

          }, {

            'level': 2,

            'resolution': 39135.75848200009,

            'scale': 1.47914381897889E8

          }, {

            'level': 3,

            'resolution': 19567.87924099992,

            'scale': 7.3957190948944E7

          }, {

            'level': 4,

            'resolution': 9783.93962049996,

            'scale': 3.6978595474472E7

          }, {

            'level': 5,

            'resolution': 4891.96981024998,

            'scale': 1.8489297737236E7

          }, {

            'level': 6,

            'resolution': 2445.98490512499,

            'scale': 9244648.868618

          }, {

            'level': 7,

            'resolution': 1222.992452562495,

            'scale': 4622324.434309

          }, {

            'level': 8,

            'resolution': 611.4962262813797,

            'scale': 2311162.217155

          }, {

            'level': 9,

            'resolution': 305.74811314055756,

            'scale': 1155581.108577

          }, {

            'level': 10,

            'resolution': 152.87405657041106,

            'scale': 577790.554289

          }, {

            'level': 11,

            'resolution': 76.43702828507324,

            'scale': 288895.277144

          }, {

            'level': 12,

            'resolution': 38.21851414253662,

            'scale': 144447.638572

          }, {

            'level': 13,

            'resolution': 19.10925707126831,

            'scale': 72223.819286

          }, {

            'level': 14,

            'resolution': 9.554628535634155,

            'scale': 36111.909643

          }, {

            'level': 15,

            'resolution': 4.77731426794937,

            'scale': 18055.954822

          }, {

            'level': 16,

            'resolution': 2.388657133974685,

            'scale': 9027.977411

          }, {

            'level': 17,

            'resolution': 1.1943285668550503,

            'scale': 4513.988705

          }, {

            'level': 18,

            'resolution': 0.5971642835598172,

            'scale': 2256.994353

          }, {

            'level': 19,

            'resolution': 0.29858214164761665,

            'scale': 1128.497176
          }]
        }
      });

      GZYX_Layer2 = new esri.WebTileLayer({
        id: 'GZ-YX1',
        urlTemplate: 'http://10.34.0.106:10009/hhglapi/arcgis12/rest/services/AHYX_ZH0717/MapServer/tile/{level}/{row}/{col}',
        spatialReference: new esri.SpatialReference({
          wkid: 102100
        }),
        tileInfo: {
          rows: 256,
          cols: 256,
          origin: {
            x: -2.0037508342787E7,
            y: 2.0037508342787E7
          },
          'spatialReference': {
            'wkid': 102100
          },
          'lods': [{
            'level': 0,
            'resolution': 156543.033928,
            'scale': 5.91657527591555E8
          }, {
            'level': 1,
            'resolution': 78271.5169639999,
            'scale': 2.95828763795777E8
          }, {
            'level': 2,
            'resolution': 39135.7584820001,
            'scale': 1.47914381897889E8
          }, {
            'level': 3,
            'resolution': 19567.8792409999,
            'scale': 7.3957190948944E7
          }, {
            'level': 4,
            'resolution': 9783.93962049996,
            'scale': 3.6978595474472E7
          }, {
            'level': 5,
            'resolution': 4891.96981024998,
            'scale': 1.8489297737236E7
          }, {
            'level': 6,
            'resolution': 2445.98490512499,
            'scale': 9244648.868618
          }, {
            'level': 7,
            'resolution': 1222.992452562495,
            'scale': 4622324.434309
          }, {
            'level': 8,
            'resolution': 611.49622628138,
            'scale': 2311162.217155
          }, {
            'level': 9,
            'resolution': 305.748113140558,
            'scale': 1155581.108577
          }, {
            'level': 10,
            'resolution': 152.874056570411,
            'scale': 577790.554289
          }, {
            'level': 11,
            'resolution': 76.4370282850732,
            'scale': 288895.277144
          }, {
            'level': 12,
            'resolution': 38.2185141425366,
            'scale': 144447.638572
          }, {
            'level': 13,
            'resolution': 19.1092570712683,
            'scale': 72223.819286
          }, {
            'level': 14,
            'resolution': 9.55462853563415,
            'scale': 36111.909643
          }, {
            'level': 15,
            'resolution': 4.77731426794937,
            'scale': 18055.954822
          }]
        }
      });

      // GZYX_Layer0,
      map = new esri.Map({
        layers: [GZYX_Layer0,GZYX_Layer1,GZYX_Layer2,GZJD_Layer],
        title: 'AH_YX'
      });

      pointLayer = new GraphicsLayer({
        id: 'pointLayer'
      })
      map.add(pointLayer) // 添加图层至地图中

      mapview = new esri.MapView({
        container: "mapViewId",
        map: map,
        center: [117.35931075867336, 33.340344937300394],
        zoom: 12,
        constraints: {
          minZoom: 9, //调整地图缩小的最大值
          maxZoom: 19, //调整地图放大的最大值,但是低于12就不生效了
        },
        popup: {
          collapseEnabled: false,
          dockEnabled: false,
          dockOptions: {
            position: 'top-right',
            breakpoint: false,
            buttonEnabled: true, //弹窗按钮右侧停靠关闭
            alignment: 'right'
          },
          actions: [],
          //隐藏actions
          // maxInlineActions: 0
          autoOpenEnabled: false // 鼠标左击是否禁止
        }
      });
      //YX_Layer.visible=false;
      mapview.ui.components = []; //清空所有ESRI自带的组件
      //放大镜
      mapview.magnifier.visible = false; //开启/关闭 放大镜
      mapview.magnifier.factor = 1.7; // magnification factor
      mapview.magnifier.size = 150; // magnifier image size
      mapview.popup.actions = []
      mapview.magnifier.offset = {
        x: 75,
        y: 75
      };

      if (this.type === 1) {
        mapview.on("click", (evt) => {
          mapview.hitTest(evt).then(res => {
            if (res.results.length > 0 && res.results != null && res.results != undefined) {
              this.list = res.results[0].graphic.attributes
              if (res.results[0].graphic.geometry.type == 'point') {
                this.times = ''
                mapview.popup.open({
                  content: this.$refs.infoBoxnumber,
                  location: res.results[0].mapPoint,
                })
              }
            }
          })
        });
        this.loadTDData();
      } else if (this.type === 2) {
        mapview.on("click", (evt) => { //添加自定义点的位置及数据弹窗
          console.log(evt, '1111')
          mapview.hitTest(evt).then(res => {
            if (res.results.length > 0 && res.results != null && res.results != undefined) {
              this.attributes = res.results[0].graphic.attributes
              if (res.results[0].graphic.geometry.type == 'point') {
                mapview.popup.open({
                  content: this.$refs.infoBox,
                  location: res.results[0].mapPoint,
                })
              }
            }
          })
        });

        this.loadploydata()
        this.getPoint()
      }
      //设置标点
    },


http://www.kler.cn/a/326753.html

相关文章:

  • 【JAVA】java 企业微信信息推送
  • contenteditable实现需要一个像文本域一样的可编辑框
  • 盘点 2024 十大免费/开源 WAF
  • 1251. 平均售价(left join on后面加条件和where 后面加条件的区别、nvl()函数的使用)
  • 【测试工具】Fastbot 客户端稳定性测试
  • 中国雕塑、
  • 关于uniapp wifi调用走过的坑
  • 应用层协议 --- HTTP
  • 将Docker镜像推送到阿里云仓库,使用Docker-compose将mysql、redis、jar包整合在一起
  • spring如何解决循环依赖
  • NAND Flash虚拟层垃圾回收机制
  • 【微信小程序前端开发】入门Day01 —— 小程序页面组成、组件使用及协同开发发布指南
  • 深度探索与实战编码:利用Python与AWS签名机制高效接入亚马逊Product Advertising API获取商品详情
  • Web端云剪辑解决方案,提供前端产品源码
  • 使用 MongoDB 在 Spring Boot 中构建安全的 RBAC 系统
  • 【GESP】C++一级练习BCQM3016,初识输入
  • 实用工具推荐---- PDF 转换
  • 利用 Local Data 导入文件到 OceanBase 的方法
  • elasticsearch实战应用JAVA案例
  • Codeforces Round 975 (Div. 2)(A,B,C,D线段树解法,E)
  • 浅谈音频采集方案
  • Elasticsearch深度攻略:核心概念与实践应用
  • 前端使用 Konva 实现可视化设计器(23)- 绘制曲线、属性面板
  • vue3.0 + element plus 全局自定义指令:select滚动分页
  • 现代前端框架实战指南:React、Vue.js、Angular核心概念与应用
  • elasticsearch 向量检索 ann