微信模拟定位,微信小程序简单的地理定位
效果图
viewclass='container'mapid="map"longitude="{{lon}}"latitude="{{lat}}"scale="14"markers="{{markers}}"/map/view.container{width:750rpx;height:100%;}.containermap{width:100%;height:100%;}Page({data:{lat:'',lon:'',markers:[]},onLoad:function(options){console.log('options',options)letthat=thisletlat=options.latletlon=options.lonconsole.log(options)that.setData({lat:lat,lon:lon,markers:[{iconPath:"/img/img/weizhi.png",//图片id:0,latitude:lat,longitude:lon,width:25,height:25}]})}})
viewclass='container'mapid="map"longitude="{{lon}}"latitude="{{lat}}"scale="14"markers="{{markers}}"/map/view.container{width:750rpx;height:100%;}.containermap{width:100%;height:100%;}Page({data:{lat:'',lon:'',markers:[]},onLoad:function(options){console.log('options',options)letthat=thisletlat=options.latletlon=options.lonconsole.log(options)that.setData({lat:lat,lon:lon,markers:[{iconPath:"/img/img/weizhi.png",//图片id:0,latitude:lat,longitude:lon,width:25,height:25}]})}})声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

