后浪云百度小程序教程:MapContext

  • MapContext
    • 示例
      • 图片示例
      • 代码示例

    MapContext

    解释:map 返回值。

    示例

    跳转编辑工具

    在开发者工具中打开

    在 WEB IDE 中打开

    扫码体验

    代码示例

    后浪云百度小程序教程:MapContext插图

    请使用百度APP扫码

    图片示例

    后浪云百度小程序教程:MapContext插图1

    代码示例

    • SWAN
    • JS
     
     
     
    1. <view class="wrap">
    2. <map id="myMap"
    3. longitude="{{longitude}}"
    4. latitude="{{latitude}}"
    5. style="width: 100%"
    6. markers="{{markers}}"
    7. show-location>
    8. </map>
    9. <button type="primary" bindtap="includePoints">缩放视野展示所有经纬度</button>
    10. <button type="primary" bindtap="getCenterLocation">获取位置</button>
    11. <button type="primary" bindtap="translateMarker">平移 marker</button>
    12. <button type="primary" bindtap="moveToLocation">移动位置</button>
    13. <button type="primary" bindtap="getRegion">获取当前地图的视野范围</button>
    14. <button type="primary" bindtap="getScale">获取当前地图的缩放级别</button>
    15. </view>
    THE END