码迷,mamicode.com
首页 > 微信 > 详细

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

时间:2020-02-18 20:21:30      阅读:348      评论:0      收藏:0      [点我收藏+]

标签:赋值   git   idt   指定   类型   简单   sharp   div   程序   

其实很简单

控制

<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:"同上"  
})

  

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

标签:赋值   git   idt   指定   类型   简单   sharp   div   程序   

原文地址:https://www.cnblogs.com/huichaoboke/p/12327681.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!