uni-app nvue 页面 map 地图 polygons 不显示
uni-app nvue 页面 map 地图 polygons 不显示
测试过的手机
- 华为nova3
- 小米8
- iphone8plus
- iphone x
示例代码:
appAddPoint.nvue 页面地图部分代码 且在subNvue 也不能显示ploygons
<map class="map" id="map" ref="map" @regionchange="regionchange"
style="{width:'750rpx',height:windowHeight +'px',}" :latitude="latitude" :longitude="longitude"
scale="18" :markers="marker" :polygons="polygon" :show-location="false">
</map>
data() {
return {
windowHeight: 250,
markers: [],
polygons: [],
latitude: null,
longitude: null
}
},
computed: {
marker: function() {
return this.markers
},
polygon: function() {
console.log(111)
return this.polygons
}
}
操作步骤:
- nvue 地图map polygons 需要显示出来
预期结果:
- nvue 地图map polygons 显示
实际结果:
- nvue 地图map polygons 不显示
bug描述:
nvue 页面 map ploygons 不显示 文档上写的很清楚 map ploygons 2.1.5+ nvue支持
附件是矩形 数据
手机直接真机调试
| 项目信息 | 描述 |
|---|---|
| 产品分类 | uniapp/App |
| PC开发环境操作系统 | Windows |
| PC开发环境操作系统版本号 | Windows 10 专业版 19042.1052 |
| HBuilderX类型 | 正式 |
| HBuilderX版本号 | 3.1.22 |
| 手机系统 | 全部 |
| 手机厂商 | 华为 |
| 页面类型 | nvue |
| 打包方式 | 云端 |
| 项目创建方式 | HBuilderX |
更多关于uni-app nvue 页面 map 地图 polygons 不显示的实战教程也可以访问 https://www.itying.com/category-93-b0.html
有没有人碰到通用问题来顶下问题啊
更多关于uni-app nvue 页面 map 地图 polygons 不显示的实战教程也可以访问 https://www.itying.com/category-93-b0.html
<map id=“map” ref=“map” @regionchange=“regionchange” :style="{width:‘750rpx’,height:windowHeight +‘px’,}"
latitude=“latitude” :longitude=“longitude” :scale=“18” :markers=“marker” :polygons=“polygon”
polyline=“polyline” :show-location=“false”>
<cover-image style=" width:100rpx; height: 100rpx; position: absolute; bottom: 10px;right: 10px;"
src=‘https://oss.4j3c.com/user/images/cart/gopoint.png’ @click=“getLocation”>
</cover-image>
</map>
肯定是nvue 页面 加了这个条件判断一样
<map id="map" ref="map" @regionchange="regionchange" :style="{width:'750rpx',height:windowHeight +'px',}"
:latitude="latitude" :longitude="longitude" :scale="18" :markers="marker" :polygons="polygon"
:polyline="polyline" :show-location="false">
<cover-image style=" width:100rpx; height: 100rpx; position: absolute; bottom: 10px;right: 10px;"
src='https://oss.4j3c.com/user/images/cart/gopoint.png' @click="getLocation">
</cover-image>
</map>
找到原因 polygons data里绑定数据写死有效,网络请求重新赋值无效
求官方尽快处理
polygons 初始化后赋值无效
唉,这么久了bug还在
我也遇到了,这个bug还没解决吗
还没解决吗,官方这都测试通过了?这么大的问题
根据你的描述,nvue页面中map组件的polygons不显示,这通常与数据格式或渲染时机有关。以下是排查建议:
- 检查polygons数据格式:确保polygons数组中的每个对象包含
points数组(至少3个坐标点)和strokeWidth、strokeColor等必要属性。示例:
polygons: [{
points: [{latitude: 39.909, longitude: 116.397}, ...],
strokeWidth: 2,
strokeColor: '#FF0000',
fillColor: 'rgba(255,0,0,0.2)'
}]

