uniapp开发微信小程序,用地图map组件 MapContext.on('markerClusterClick', (res) => {})点击聚合点事件在微信开发者工具中正常执行,在真机调试中不生效
// 创建地图对象
this._mapContext = uni.createMapContext("map", this);
// 仅调用初始化,才会触发 on.("markerClusterCreate", (e) => {})
this._mapContext.initMarkerCluster({ // 初始化点聚合的配置
enableDefaultStyle: false, // 是否使用默认样式
zoomOnClick: false,
gridSize: 60,
complete(res) {
console.log('initMarkerCluster', res)
}
});
this._mapContext.on('markerClusterClick', (e) => {
console.log(e, 'markerClusterClick---e');
})
0 个回复