<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.11&key=9de88a718781910c9a1c81230827d1ce&plugin=AMap.Autocomplete,AMap.PlaceSearch"></script> <title>searchNearby</title> <style> *{ padding: 0; margin: 0; list-style: none; } #container{ position: absolute; top: 0; left: 0; 100%; height: 100%; } #searchNode{ position: absolute; z-index: 9; 300px; height: 100px; background: white; text-align: center; padding-top: 20px; } #setCenterNode{ position: absolute; z-index: 9; 300px; background: white; top: 100px; } </style> </head> <body> <div id="container"></div> <div id="searchNode"> <input type="" name="" id="searchInput" /> <button id="btn">搜索</button> </div> <div id="setCenterNode"></div> <script> var map = new AMap.Map('container',{ zoom:10, center:[116.379391,39.861536] }); AMap.service(['AMap.PlaceSearch'],function(){ btn.onclick = function(){ new AMap.PlaceSearch({ type:'餐饮', pageSize:5, pageIndex:1, city:'010', citylimit:true, map:map, panel:'setCenterNode' }).searchNearBy('',[116.379391,39.861536],200,function(){ }); } }); </script> </body> </html>