Leaflet-heat热力图插件

官方标配写法:

var heat = L.heatLayer([
	[50.5, 30.5, 0.2], // lat, lng, intensity
	[50.6, 30.4, 0.5],
	...
], {radius: 25}).addTo(map);复制代码

想让半径随着地图的放大层级倍数相应的改变,咋整?

map.on("zoomend", function(){
    heatLayer.setOptions({radius: map.getZoom()});
});
复制代码

转载自:https://blog.csdn.net/weixin_34214500/article/details/88204463

You may also like...