微信小程序map 简单使用

wxml:

<map id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="18" controls="{{controls}}" bindcontroltap="controltap" markers="{{markers}}" circles="{{circles}}" bindmarkertap="markertap" polyline="{{polyline}}" bindregionchange="regionchange" show-location style="width: 100%; height: {{view.Height}}px;"></map>

 js:

data: {
    //
    longitude:'121.765900',
    latitude:'39.048490',
    markers: [{
      iconPath: "../../img/marker_red.png",
      id: 0,
      latitude: 39.048490,
      longitude: 121.765900,
      width: 35,
      height: 45
    }],
    ... //省略代码
    }

猜你喜欢

转载自blog.csdn.net/weixin_42694072/article/details/83538775