1.uniapp官方文档说明


2.关键代码片段
// 仅调用初始化,才会触发 on.("markerClusterCreate", (e) => {})
this._mapContext.initMarkerCluster({
enableDefaultStyle: false, // 是否使用默认样式
zoomOnClick: true, // 点击聚合的点,是否改变地图的缩放级别
gridSize: 60, // 聚合计算时网格的像素大小,默认60
complete(res) {
console.log('initMarkerCluster', res)
}
});
3.全部代码
<template>
<view class="content">
<map id="map" :latitude="latitude" :longitude="longitude"
:style="{ width: '100%', height: windowHeight + 'px' }" :scale="10" @markertap="markTap"></map>
</view>
</template>
<script>
export default {
data() {
return {
_mapContext: null,
windowHeight: 0,
latitude: 23.099994,
longitude: 113.324520,
}
},
onLoad() {
},
onReady() {
uni.getSystemInfo({
success: (res) => {
this
3783



被折叠的 条评论
为什么被折叠?



