微信小程序地图移动到指定的位置

其实很简单

控制

<map id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="14" controls="{{controls}}" bindcontroltap="controltap" markers="{{markers}}" bindmarkertap="markertap" polyline="{{polyline}}" polygons="{{polygons}}" bindregionchange="regionchange"
     show-location style="width: 100%; height: 100vh;">

  map里的longitude和latitude属性

在js文件里给longitude和latitude赋值就可以了

this.setData({
   longitude:"要赋的值“//必须是num类型
   latitude:"同上"  
})

  

猜你喜欢

转载自www.cnblogs.com/huichaoboke/p/12327681.html