piaoyi_UI
piaoyi_UI
  • 发布:2023-05-30 14:44
  • 更新:2023-11-08 14:24
  • 阅读:325

【报Bug】mapContext.setLocMarkerIcon方法存在但运行没有效果?

分类:uni-app

产品分类: uniapp/小程序/微信

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 64位

HBuilderX类型: 正式

HBuilderX版本号: 3.7.3

第三方开发者工具版本号: 稳定版 Stable Build (1.06.2303220)

基础库版本号: 2.32.0

项目创建方式: HBuilderX

示例代码:
<template>  
	<view class="map">  
		<map id="mymap" name="map" :show-location="true" :longitude="longitude" :latitude="latitude"></map>  
	</view>  
</template>  
  
<script>  
	export default {  
		data() {  
			return {  
				longitude: 0,  
				latitude: 0,  
				mapContext: null  
			};  
		},  
		mounted() {  
			var that = this  
			uni.getLocation({  
				success(res) {  
					var { latitude, longitude } = res  
					that.latitude = latitude  
					that.longitude = longitude  
				},  
				fail(err) {  
					console.log(err)  
				}  
			})  
			var mapContext = uni.createMapContext('mymap',this)  
			mapContext.setLocMarkerIcon({  
				iconPath: '/static/logo.png',  
				success: (res) => {  
					console.log(res)  
				},  
				fail: err => {  
					console.log(err)  
				},  
				complete: () => {  
					console.log(1111)  
				}  
			})  
		}  
	}  
</script>  
  
<style lang="scss" scoped>  
.map {  
	map {  
		width: 100vw;  
		height: 100vh;  
	}  
}  
</style>

操作步骤:

直接复制上面提供的代码即可

预期结果:

mapContext.setLocMarkerIcon成功和失败的回调应该有一个会运行

实际结果:

既没有成功的回调也没有失败的回调

bug描述:

代码示例直接复制运行,打印mapContext.setLocMarkerIcon有值但是运行没有效果,即没有进入成功的回调也没有失败的回调

2023-05-30 14:44 负责人:无 分享
已邀请:
piaoyi_UI

piaoyi_UI (作者) - 【插件开发】【专治疑难杂症】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=193663(微信搜索飘逸科技UI小程序直接体验)】【骗子请绕道】问题咨询请加QQ群:120594820,代表作灵感实用工具小程序

有人吗

piaoyi_UI

piaoyi_UI (作者) - 【插件开发】【专治疑难杂症】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=193663(微信搜索飘逸科技UI小程序直接体验)】【骗子请绕道】问题咨询请加QQ群:120594820,代表作灵感实用工具小程序

官方来个大佬看看

while

while - 为3

还没解决吗 这个问题 安卓手机出不来,但是进入了success回调了

while

while - 为3

代码这样的,还有就是不能控制show-location的显示隐藏吗?隐藏一次就不能再次显示了

要回复问题请先登录注册