How to develop a Mini Program Map component similar to Watermelon footprints
This article mainly introduces how to develop map components similar to watermelon footprint Mini programs. The content is detailed and easy to understand. The operation is simple and fast. It has certain reference value. I believe everyone will gain something after reading this article on how to develop map components similar to watermelon footprint Mini programs. Let's take a look at it together.
类似西瓜足迹小程序地图组件:
wxml:
class="button" bindtap="getlocation" style="margin-top:30px" markers="{{markers}}">定位longitude="{{longitude}}" latitude="{{latitude}}" markers="{{markers}}" covers="{{covers}}" style="width: 100%; height: 300px;margin-top:30px">js:
//获取应用实例var app = getApp()Page({data: {latitude: 0,//纬度longitude: 0,//经度speed: 0,//速度accuracy: 16,//位置精准度markers: [],covers: [],},onLoad: function () {},getlocation: function () {var markers = [{latitude: 28.211400,longitude: 112.914250,name: '喜地大厦',desc: '我的位置'}]var covers = [{latitude: 28.211400,longitude: 112.914250,iconPath: '/image/ic_position.png',rotate: 0}]this.setData({longitude: 112.914250,latitude: 28.211400,markers: markers,covers: covers,})wx.getLocation({type: 'gcj02',success: function (res) {var latitude = res.latitudevar longitude = res.longitudevar speed = res.speedvar accuracy = res.accuracyconsole.log("latitude:" + latitude)console.log("longitude:" + longitude)console.log("speed:" + speed)console.log("accuracy:" + accuracy)wx.openLocation({latitude: latitude,longitude: longitude,scale: 28})}})}})关于"类似西瓜足迹小程序地图组件如何开发"这篇文章的内容就介绍到这里,感谢各位的阅读!相信大家对"类似西瓜足迹小程序地图组件如何开发"知识都有一定的了解,大家如果还想学习更多知识,欢迎关注行业资讯频道。