1***@163.com
1***@163.com
  • 发布:2025-10-16 21:51
  • 更新:2025-10-16 21:51
  • 阅读:8

【报Bug】 nvue 中ios的 自定义聚合点无效 enableDefaultStyle: false失效

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

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

HBuilderX类型: 正式

HBuilderX版本号: 4.76

手机系统: iOS

手机系统版本号: iOS 18

手机厂商: 苹果

手机机型: 苹果12

页面类型: nvue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

enableDefaultStyle: false,

操作步骤:

enableDefaultStyle: false,

预期结果:

像安卓一样 消失掉 用markerClusterCreate设置自定义样式

实际结果:

聚合点默认样式

bug描述:

            this.mapCtx = uni.createMapContext("mymap", this);  

            // 仅调用初始化,才会触发 on.("markerClusterCreate", (e) => {})  
            this.mapCtx.initMarkerCluster({  
                enableDefaultStyle: false,  
                zoomOnClick: true,  
                gridSize: 60,  
                complete(res) {  
                    console.log('initMarkerCluster', res)  
                }  
            });  

enableDefaultStyle: false,无效 还是使用默认的样式  

        this.mapCtx.on('markerClusterCreate', (e) => {  
                console.log('markerClusterCreate', e);  
                const clusters = e.clusters;  
                const markers = clusters.map((cluster) => {  
                    const {  
                        center,  
                        clusterId,  
                        markerIds  
                    } = cluster;  
                    return {  
                        ...center,  
                        width:1,  
                        height:1,  
                        clusterId, // 必须  
                        // iconPath:'',  
                        label: {  
                            content: markerIds.length + '', // 显示聚合的数量  
                            fontSize: 16,  
                            color: '#fff',  
                            width: 50,  
                            height: 50,  
                            bgColor: 'rgb(255, 0, 0)', // 聚合标记的背景颜色  
                            borderRadius: 25,  
                            textAlign: 'center',  
                            anchorX: -25,  
                            anchorY: -50,  
                        },  
                    };  
                });  

markerClusterCreate 也没有效果

2025-10-16 21:51 负责人:无 分享
已邀请:

要回复问题请先登录注册