(以“<div id="examples_api_center"><div class="title-hd">点覆盖物详情查看</div></div><div class="demos_wrap"><div class="header"><div class="active">功能场景<...”为内容创建页面) |
|||
第1行: | 第1行: | ||
<div id="examples_api_center"><div class="title-hd">点覆盖物详情查看</div></div><div class="demos_wrap"><div class="header"><div class="active">功能场景</div></div><div class="wrap-mi">该示例介绍如何在地图上添加点标记,并如何给点标记添加点击弹出信息窗口。</div><div class="header"><div class="active">DEMO</div></div><div class="andiord-wrap wrap"><div class="wrap-wp"><div class="pc-video"><div class="video-box infor"><div class="video-control1"></div><pre>https://mapopen-website-wiki.cdn.bcebos.com/wiki/android-loc-sdk/sdkgetAK.mov</pre> | <div id="examples_api_center"><div class="title-hd">点覆盖物详情查看</div></div><div class="demos_wrap"><div class="header"><div class="active">功能场景</div></div><div class="wrap-mi">该示例介绍如何在地图上添加点标记,并如何给点标记添加点击弹出信息窗口。</div><div class="header"><div class="active">DEMO</div></div><div class="andiord-wrap wrap"><div class="wrap-wp"><div class="pc-video"><div class="video-box infor"><div class="video-control1"></div><pre>https://mapopen-website-wiki.cdn.bcebos.com/wiki/android-loc-sdk/sdkgetAK.mov</pre> | ||
− | </div><div class="video-title1"> | + | </div><div class="video-title1">绘制点覆盖物,并为其添加信息窗口</div></div></div><div class="api-table-box"><div class="api-info-box"><div class="pre-nav"><div class="left-icon"></div><div>核心接口</div><br/></div> |
{| width="370" border="1" | {| width="370" border="1" | ||
|- | |- | ||
第8行: | 第8行: | ||
| width="90" | '''参考文档''' | | width="90" | '''参考文档''' | ||
|- | |- | ||
− | | | + | | Marker |
− | | | + | | map.addOverlay(marker) |
− | | | + | | 绘制覆盖物标注点 |
− | | [[jspopularGL/guide/ | + | | [[jspopularGL/guide/addOverlay|绘制点、线、面]] |
|- | |- | ||
− | | | + | | InfoWindow |
− | | | + | | map.openInfoWindow(infoWindow, point) |
− | | | + | | 信息窗口展示 |
− | | [[jspopularGL/guide/ | + | | [[jspopularGL/guide/infoWindow|信息窗口]] |
|} | |} | ||
− | </div></div><div class="header"><div class="active">核心代码</div></div><div class="pre-wrap"><div class="pre-wrap-w pre-wrap-w-and"><pre class="prettyprint prettyprinted pre-and"> | + | </div></div><div class="header"><div class="active">核心代码</div></div><div class="pre-wrap"> |
− | + | <div class="pre-wrap-w pre-wrap-w-and"><pre class="prettyprint prettyprinted pre-and"> | |
− | + | var map = new BMapGL.Map('container'); | |
− | + | var point = new BMapGL.Point(116.404, 39.928); | |
− | + | map.centerAndZoom(point, 15); | |
− | + | map.enableScrollWheelZoom(true); | |
− | + | ||
− | + | var marker1 = new BMapGL.Marker(new BMapGL.Point(116.404, 39.925)); | |
− | + | map.addOverlay(marker1); // 将标注添加到地图中 | |
− | + | var opts1 = { | |
− | + | title: '故宫博物馆', | |
− | + | content: '故宫博物馆的简介', | |
− | + | width: 220, | |
− | + | height: 80 | |
− | + | }; | |
− | + | var infoWindow1 = new BMapGL.InfoWindow('地址:北京市东城区王府井大街88号乐天银泰百货八层', opts1); | |
− | + | marker1.addEventListener('click', function () { | |
− | + | map.openInfoWindow(infoWindow1, point1); | |
− | + | }); | |
− | + | </pre> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<div class="pre-btn"><div class="pre-btn-copy-and">复制</div><div class="pre-btn-cb-and">深色</div></div><div class="success">复制成功</div></div></div></div></div> | <div class="pre-btn"><div class="pre-btn-copy-and">复制</div><div class="pre-btn-cb-and">深色</div></div><div class="success">复制成功</div></div></div></div></div> |
2020年10月9日 (五) 14:30的版本
点覆盖物详情查看
功能场景
该示例介绍如何在地图上添加点标记,并如何给点标记添加点击弹出信息窗口。
DEMO
https://mapopen-website-wiki.cdn.bcebos.com/wiki/android-loc-sdk/sdkgetAK.mov
绘制点覆盖物,并为其添加信息窗口
核心代码
var map = new BMapGL.Map('container'); var point = new BMapGL.Point(116.404, 39.928); map.centerAndZoom(point, 15); map.enableScrollWheelZoom(true); var marker1 = new BMapGL.Marker(new BMapGL.Point(116.404, 39.925)); map.addOverlay(marker1); // 将标注添加到地图中 var opts1 = { title: '故宫博物馆', content: '故宫博物馆的简介', width: 220, height: 80 }; var infoWindow1 = new BMapGL.InfoWindow('地址:北京市东城区王府井大街88号乐天银泰百货八层', opts1); marker1.addEventListener('click', function () { map.openInfoWindow(infoWindow1, point1); });
复制
深色
复制成功