jd.html 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
  5. <script type="text/javascript" src="https://api.map.baidu.com/api?type=webgl&v=1.0&ak=5uvFMzYEFZOsAIoUawGvWc5v1WvrWfPr"></script>
  6. <title>本地搜索的结果面板</title>
  7. <style type="text/css">
  8. body, html,#allmap {width: 100%;height: 100%; margin:0;font-family:"微软雅黑";}
  9. #l-map{height:100%;width:100%;}
  10. .anchorBL{
  11. display:none;
  12. }
  13. </style>
  14. </head>
  15. <body style="overflow:hidden">
  16. <div id="l-map"></div>
  17. <div id="r-result"></div>
  18. </body>
  19. </html>
  20. <script type="text/javascript">
  21. // 百度地图API功能
  22. var map = new BMapGL.Map("l-map"); // 创建Map实例
  23. map.centerAndZoom(new BMapGL.Point(88.245431,29.448884), 11.5);
  24. map.setMapStyleV2({
  25. styleId: '1da39f818ce462dc76ab4361834334df'
  26. });
  27. var myKeys = ["酒店",];
  28. var local = new BMapGL.LocalSearch(map, {
  29. renderOptions:{map: map, panel:"r-result"},
  30. pageCapacity:5
  31. });
  32. local.searchInBounds(myKeys, map.getBounds());
  33. </script>