guoshipeng
2023-08-30 0a94001b2ca46314bef91c62eecd43c873d6f383
src/components/map/pickCoordinate1.vue
@@ -26,7 +26,12 @@
          ></a-input> -->
          <input v-model="input" id="tipinput" /><button
            @click="searchAddress"
            style="background-color: #1890ff; color:white; border:none;margin-left:5px"
            style="
              background-color: #1890ff;
              color: white;
              border: none;
              margin-left: 5px;
            "
          >
            搜索
          </button>
@@ -160,37 +165,9 @@
    // console.log(this.clickPoint,'clickPoint');
  }
  // 初始化地图
  // private handler({BMap, map}) {
  //   this.center.lng =  this.typeOperation === 'add' ? '120.726838' : this.lnglat.split(',')[1]
  //   this.center.lat =  this.typeOperation === 'add' ? '31.3421' : this.lnglat.split(',')[0]
  //   this.zoom = 19
  // }
  // private selectPoi(e){
  //   console.log(e);
  //   let poi = e
  //     if (poi.length > 0) {
  //        this.clickPoint = [poi[0].lng, poi[0].lat]
  //        }
  // }
  private input:any=''
  private mark:any=''
  // private searchMap(){
  //    var autoOptions = {
  //       input: "tipinput"
  //   };
  //   var self=this
  //   var auto = new AMap.Autocomplete(autoOptions);
  //   const placeSearch = new AMap.PlaceSearch(self.input);
  //   // console.log(window);
  //    auto.on("select", select);//注册监听,当选中某条记录时会触发
  //       function select(e) {
  //           placeSearch.setCity(e.poi.adcode);
  //           placeSearch.search(e.poi.name);  //关键字查询查询
  //           self.clickPoint = [e.poi.location.lng, e.poi.location.lat]
  //       }
  // }
  private searchAddress() {
           var map = new AMap.Map("amap", {
                resizeEnable: true
@@ -221,18 +198,6 @@
          })
          markerone=1
        }
        // function click(e){
        //   console.log(e);
        //   salf.clickPoint=[e.lnglat.lng,e.lnglat.lat]
        // }
        // placeSearch.search(this.input,function(status, result){
        //   console.log(result);
        //   auto.on('click',click);
        //     function click(e){
        //      console.log(e);
        //     }
        // });
        // console.log(this.input);
    }
  // 初始定位到星虹国际
  private clickPoint: any = this.lnglat === '' ?  [