日常工作技术点总结

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()
      }
      //设置标点
    },

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

共创splendid--与您携手

鼓励会让我为您创造出更优质作品

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值