-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map的includePoints设置无效 #7178
Comments
taro-bot2
bot
added
F-react
Framework - React
T-weapp
Target - 编译到微信小程序
V-3
Version - 3.x
labels
Jul 27, 2020
@qilovehua 复现仓库你这样写:github.com/no-demo,别人如何帮你定位问题? |
实在抱歉,已经更新了 |
@qilovehua 关于这个问题,Taro 和你的写法都要修改。 Taro 需要修改的地方(3.0.7修复)
你需要修改的地方
export default function () {
const longitude = (121.474275 + 121.549892) / 2
const latitude = (31.233541 + 31.242274) / 2
const ms = [{
longitude: 121.474275,
latitude: 31.233541,
width: 40,
height: 40,
iconPath: icon,
}, {
longitude: 121.549892,
latitude: 31.242274,
width: 40,
height: 40,
iconPath: icon,
}]
const points = ms.map(item => ({ longitude: item.longitude, latitude: item.latitude }))
return (
<View>
<Map style='width: 100vw; height: 100vh;' longitude={longitude} scale={0} latitude={latitude} markers={ms} includePoints={points} setting={{}} />
</View>
)
} |
我微信小程序里这么写是有效的,include-points的优先级更高,会忽略scale、longitude与latitude |
还是不行 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
相关平台
微信小程序
复现仓库
https://github.com/qilovehua/taro-map
小程序基础库: 2.1.2
使用框架: React
复现步骤
markers里有两个marker,points也有两个点,map上显示了两个marker,但没有同时显示这两个marker
输出的wxml里没有include_points字段,被忽略了?
微信小程序会优先显示所有include_points重新计算中心位置的
期望结果
两个marker能显示出来
实际结果
只显示了其中一个marker,另一个距离远点无法显示,移动地图才能看到
环境信息
The text was updated successfully, but these errors were encountered: