| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
- <script type="text/javascript" src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=pAT8YhkMx1HVQIWOLZcYoQAty1myB4Sn"></script>
- <title>根据关键字本地搜索</title>
- <style>
- body,
- html,
- #container {
- overflow: hidden;
- width: 100%;
- height: 100%;
- margin: 0;
- font-family: "微软雅黑";
- }
- .info {
- z-index: 999;
- width: auto;
- min-width: 22rem;
- padding: .75rem 1.25rem;
- margin-left: 1.25rem;
- position: fixed;
- top: 1rem;
- background-color: #fff;
- border-radius: .25rem;
- font-size: 14px;
- color: #666;
- box-shadow: 0 2px 6px 0 rgba(27, 142, 236, 0.5);
- }
- </style>
- </head>
- <body>
- <div id="container"></div>
- <div class = "info">返回北京市“景点”关键字的检索结果,并展示在地图上</div>
- </body>
- </html>
- <script type="text/javascript">
- // 百度地图API功能
- var map = new BMapGL.Map('container');
- map.centerAndZoom(new BMapGL.Point(116.404, 39.915), 11);
- var local = new BMapGL.LocalSearch(map, {
- renderOptions: {map: map}
- });
- local.search('郑州');
- </script>
|