From 19d26f24c73756001ef349c093c498a24d2c05f8 Mon Sep 17 00:00:00 2001 From: guoshipeng <3194674006@qq.com> Date: Wed, 06 Sep 2023 14:16:11 +0800 Subject: [PATCH] fix:查询添加区域 --- src/components/map/pickCoordinate1.vue | 67 ++++++++------------------------- 1 files changed, 16 insertions(+), 51 deletions(-) diff --git a/src/components/map/pickCoordinate1.vue b/src/components/map/pickCoordinate1.vue index 3fe8e5c..26078de 100644 --- a/src/components/map/pickCoordinate1.vue +++ b/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,50 +165,22 @@ // 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 }); - var placeSearch = new AMap.PlaceSearch({ - pageSize: 5, // ������������������������ - pageIndex: 1, // ������ - city: "������", // ��������������� - citylimit: false, //��������������������������������������������� - panel: "panel", // ��������������������������������������������� - map: map, // ��������������������������� - autoFitView: true // ������������������������������������������ Marker��������������������������������� - }); + var placeSearch = new AMap.PlaceSearch({ + pageSize: 5, // ������������������������ + pageIndex: 1, // ������ + city: "������", // ��������������� + citylimit: false, //��������������������������������������������� + panel: "panel", // ��������������������������������������������� + map: map, // ��������������������������� + autoFitView: true // ������������������������������������������ Marker��������������������������������� + }); //��������������� placeSearch.search(this.input) var salf=this @@ -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 === '' ? [ -- Gitblit v1.8.0