2、代码如下
/**
* 关键字检索
*/
function keySearch(){
AMap.plugin('AMap.Autocomplete', function(){
var mapSearch = new AMap.Autocomplete({
input: "mapSearch",
});
AMap.event.addListener(mapSearch, "select", keySearchSelect);//注册监听,当选
});
}
/**
* 关键字检索返回
*/
function keySearchSelect(result){
{
"type": "select",
"poi": {
"id": "B000A80X4B",
"name": "辽宁//",
"district": "辽宁//////",
"adcode": "111///",
"location": {
"I": 10.123,
"C": 116.351675,
"lng": 12.2,
"lat": 31.23
},
"address": "168号",
"typecode": "11//"
}
}