- 发布:2020-07-23 16:12
- 更新:2021-09-07 08:58
- 阅读:999
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: window10
HBuilderX类型: 正式
HBuilderX版本号: 2.7.14
手机系统: 全部
手机厂商: 华为
页面类型: nvue
打包方式: 云端
项目创建方式: HBuilderX
测试过的手机:
示例代码:
<template>
<view>
<map :style="'width: 750rpx; height:'+ mapHeight+'px;'" id="map" ref="map1" :scale="scaleSize" :longitude="coordinates.longitude"
latitude="coordinates.latitude" :show-location="'true'" :markers="markers" @markertap='markertap' @regionchange="moveMapSearchStart"
@end="moveMapSearchEnd" @begin="moveMapSearchStart">
</map>
</view>
</template>
markertap: function(e, otherProp) {
if (this.choosePoiType == 'park') {
this.markers = JSON.parse(JSON.stringify(markers_back))
// 地图停车场tip点击
let logicName = ''
let eParkingLotID = ''
if (otherProp) {
eParkingLotID = otherProp
} else {
eParkingLotID = e.detail.markerId
}
for (let s in poisdatas) {
if (Number(eParkingLotID) == Number((poisdatas[s].latitude).toString().split('.').join(''))) {
if (poisdatas[s].park_type == 'usePark') {
logicName = 'getParkLotByDistanceOne'
} else if (poisdatas[s].park_type == 'importPark') {
logicName = 'getParkLotByDistanceImportOnce'
} else if (poisdatas[s].park_type == 'thirdPark') {
logicName = 'getParkLotByDistanceThirdOnce'
}
__request('/logic/exec', {
logic: logicName,
param: {
parking_lot_id: poisdatas[s].parking_lot_id,
my_latitude: getApp().globalData.userLocaltion.latitude,
my_longitude: getApp().globalData.userLocaltion.longitude
}
}, res => {
res = res.data
this.viewData = res.sql[0].data[0]
if (this.viewData.parking_space_status != poisdatas[s].parking_space_status) {
switch (this.viewData.parking_space_status) {
case 'almost_full': // 红
markers_back[s].iconPath = this.markers[s].iconPath = '/static/app-plus/icon-P.png'
break
case 'crowded': // 橙
markers_back[s].iconPath = this.markers[s].iconPath = '/static/app-plus/icon-P2.png'
break
case 'enough': // 绿
markers_back[s].iconPath = this.markers[s].iconPath = '/static/app-plus/icon-P3.png'
break
default:
markers_back[s].iconPath = this.markers[s].iconPath = '/static/app-plus/icon-PM4.png'
break
}
poisdatas[s] = this.viewData
}
this.setScaleSize()
this.coordinates.longitude = this.viewData.longitude
this.coordinates.latitude = parseFloat(this.viewData.latitude) - 0.0006
this.markers = JSON.parse(JSON.stringify(markers_back))
this.markers[s].height = 40
this.markers[s].width = 36
this.getTimePrice()
__request('/logic/exec', {
logic: "confirmCollectionByUser",
param: {
parking_lot_id: poisdatas[s].parking_lot_id,
}
}, res => {
res = res.data
if (res.success && res.sql[0].data[0].favorite) {
this.navcollection = true
this.viewData.favorite = true
this.viewData = Object.assign({}, this.viewData)
} else {
this.navcollection = true
this.viewData.favorite = false
}
})
this.smallViewShow = true
})
continue
}
}
return
}
},
latitude="coordinates.latitude" :show-location="'true'" :markers="markers" @markertap='markertap' @regionchange="moveMapSearchStart"
@end="moveMapSearchEnd" @begin="moveMapSearchStart">
</map>
</view>
</template>
markertap: function(e, otherProp) {
if (this.choosePoiType == 'park') {
this.markers = JSON.parse(JSON.stringify(markers_back))
// 地图停车场tip点击
let logicName = ''
let eParkingLotID = ''
if (otherProp) {
eParkingLotID = otherProp
} else {
eParkingLotID = e.detail.markerId
}
for (let s in poisdatas) {
if (Number(eParkingLotID) == Number((poisdatas[s].latitude).toString().split('.').join(''))) {
if (poisdatas[s].park_type == 'usePark') {
logicName = 'getParkLotByDistanceOne'
} else if (poisdatas[s].park_type == 'importPark') {
logicName = 'getParkLotByDistanceImportOnce'
} else if (poisdatas[s].park_type == 'thirdPark') {
logicName = 'getParkLotByDistanceThirdOnce'
}
__request('/logic/exec', {
logic: logicName,
param: {
parking_lot_id: poisdatas[s].parking_lot_id,
my_latitude: getApp().globalData.userLocaltion.latitude,
my_longitude: getApp().globalData.userLocaltion.longitude
}
}, res => {
res = res.data
this.viewData = res.sql[0].data[0]
if (this.viewData.parking_space_status != poisdatas[s].parking_space_status) {
switch (this.viewData.parking_space_status) {
case 'almost_full': // 红
markers_back[s].iconPath = this.markers[s].iconPath = '/static/app-plus/icon-P.png'
break
case 'crowded': // 橙
markers_back[s].iconPath = this.markers[s].iconPath = '/static/app-plus/icon-P2.png'
break
case 'enough': // 绿
markers_back[s].iconPath = this.markers[s].iconPath = '/static/app-plus/icon-P3.png'
break
default:
markers_back[s].iconPath = this.markers[s].iconPath = '/static/app-plus/icon-PM4.png'
break
}
poisdatas[s] = this.viewData
}
this.setScaleSize()
this.coordinates.longitude = this.viewData.longitude
this.coordinates.latitude = parseFloat(this.viewData.latitude) - 0.0006
this.markers = JSON.parse(JSON.stringify(markers_back))
this.markers[s].height = 40
this.markers[s].width = 36
this.getTimePrice()
__request('/logic/exec', {
logic: "confirmCollectionByUser",
param: {
parking_lot_id: poisdatas[s].parking_lot_id,
}
}, res => {
res = res.data
if (res.success && res.sql[0].data[0].favorite) {
this.navcollection = true
this.viewData.favorite = true
this.viewData = Object.assign({}, this.viewData)
} else {
this.navcollection = true
this.viewData.favorite = false
}
})
this.smallViewShow = true
})
continue
}
}
return
}
},
操作步骤:
地图上生成一个marker,然后点击marker修改marker样式后安卓是没有反应的 ios有
地图上生成一个marker,然后点击marker修改marker样式后安卓是没有反应的 ios有
预期结果:
安卓端和ios端指定marker样式会根据属性变大
安卓端和ios端指定marker样式会根据属性变大
实际结果:
安卓端,修改属性后无样式变化,ios端指定marker样式会根据属性变大
安卓端,修改属性后无样式变化,ios端指定marker样式会根据属性变大
bug描述:
使用nvue开发map地图,地图上已经渲染marker图标后,点击marker图标,修改marker图标信息在安卓上无法生效,ios上可以看到生效的样式
1 个回复
1***@qq.com
nvue @markertap没有返回回调