当我在传单地图上绘制热层时,仅在拖动地图时显示。
coords = [];
var lightningLayer = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {icon: myIcon});
},
onEachFeature: function (feature, layer) {
layer.bindPopup(' Lightning detected on ' + ' <br> ' +
feature.properties.Lightning_Time + ' UTC' + ' <br> ' + 'at ' +
feature.properties.La + 'N' + ', ' +
feature.properties.Lo + 'E'
);
coords.push([feature.properties.La,feature.properties.Lo]);
}
});
var heat = L.heatLayer(coords, { minOpacity: 0.9, radius: 5, blur: 7,
maxZoom: 6, max: 1.0, gradient: null }).addTo(map)