• uniapp使用小程序地图地位功能实现方法


    <map style=" 100%; height: 300px;" :latitude="latitude" :longitude="longitude" :markers="markers" @markertap="markertap"
          @callouttap="callouttap" :polyline="polylines" show-location :enable-traffic="true"> </map>
    	data() {
    			return {
    				remnant:0,
    				content:"",
    				title:"",
    				role:false,
    				latitude: 39.909,
    				longitude: 116.39742,
    				markers: [{
    						 40,
    						height: 40,
    						latitude: 39.9345,
    						longitude: 119.61063,
    						iconPath: '../../static/logo.png',
    						id: 1,
    						customCallout: {
    							anchorX: 0,
    							anchorY: 0,
    							display: "BYCLICK"
    						}
    					},
    					{
    						 40,
    						height: 40,
    						latitude: 39.989,
    						longitude: 116.39742,
    						iconPath: '../../static/logo.png',
    						id: 2,
    						callout: {
    							color: '#ffffff',
    							content: '气泡内容',
    							fontSize: 16,
    							borderRadius: 5,
    							bgColor: '#FF0000',
    							padding: 20,
    							textAlign: 'center',
    							display: "BYCLICK"
    						}
    					}
    				],
    				polylines: [],
    				markers: [], //标记点数组
    

      

    Location() { //本地位置权限获取
                    let that = this
                    wx.getLocation({
                        type: 'gcj02',
                        timeout:"1000",
                        success(res) {
                            console.log(res)
                            that.latitude = res.latitude
                            that.longitude = res.longitude
                            // that.markers[0].latitude = res.latitude
                            // that.markers[0].longitude = res.longitude
                            const speed = res.speed
                            const accuracy = res.accuracy
                        }
                    })
    
                },
  • 相关阅读:
    [PHP] Layui + jquery 实现 实用的文章自定义标签
    个人总结第五周
    个人总结第四周
    个人总结第三周
    个人总结第二周
    个人总结第一周
    用户体验评价
    第二阶段scrum冲刺
    单词统计
    用户模块和用户场景
  • 原文地址:https://www.cnblogs.com/ly1368489670/p/14240564.html
Copyright © 2020-2023  润新知