微信小程序地圖移動到指定的位置


其實很簡單

控制

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

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM