赞
踩
谷歌地图点聚合功能的实现,及参数设置
npm install @googlemaps/markerclusterer
import { MarkerClusterer } from "@googlemaps/markerclusterer";
const markerCluster = new MarkerClusterer({ map, markers });
import { MarkerClusterer,defaultOnClusterClickHandler } from "@googlemaps/markerclusterer";
let markerClusterer = null;
function initMap() {
//初始化地图
const map = new google.maps.Map(document.getElementById("map"), {
zoom: 3,
center: { lat: -28.024, lng: 140.887 },
});
const labels = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
// 创建一个设置markers方法
const setMarkers = (setmarkers) &
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。