赞
踩
npm install leaflet.markercluster
- // 引入 leaflet.markercluster
- import "leaflet.markercluster/dist/MarkerCluster.css"
- import "leaflet.markercluster/dist/MarkerCluster.Default.css"
- import "leaflet.markercluster";
markerClusterGroup = L.markerClusterGroup()
markerClusterGroup.addLayer(marker)
map.addLayer(markerClusterGroup)
- .marker-cluster-large div {
- background-color: rgba(254, 179, 0, 0.7) !important;
- color: #fff;
- }
- .marker-cluster-medium div {
- background-color: rgba(0, 167, 254, 0.7) !important;
- color: #fff;
- }
- .marker-cluster-small div {
- background-color: rgba(4, 241, 205, 0.7) !important;
- color: #fff;
- }
- .marker-cluster-small {
- background-color: rgba(4, 241, 205, 0.3);
- }
- .marker-cluster-medium {
- background-color: rgba(0, 167, 254, 0.3);
- }
- .marker-cluster-large {
- background-color: rgba(254, 179, 0, 0.3);
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。