htoooth/Leaflet.ChineseTmsProviders

请高手做一下高德的搜索

2qq2qq opened this issue · 0 comments

把高德的搜索做进去,太实用了。
我自己没搞成功。期待。
是高德官网的这个:https://lbs.amap.com/api/javascript-api/example/poi-search/search-after-enter-prompt

`<!doctype html>

<title>输入提示后查询</title> <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.11&key=您申请的key值&plugin=AMap.Autocomplete,AMap.PlaceSearch"></script> <script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
请输入关键字:
<script type="text/javascript"> //地图加载 var map = new AMap.Map("container", { resizeEnable: true }); //输入提示 var autoOptions = { input: "tipinput" }; var auto = new AMap.Autocomplete(autoOptions); var placeSearch = new AMap.PlaceSearch({ map: map }); //构造地点查询类 AMap.event.addListener(auto, "select", select);//注册监听,当选中某条记录时会触发 function select(e) { placeSearch.setCity(e.poi.adcode); placeSearch.search(e.poi.name); //关键字查询查询 } </script> `