不拖动地图,热图在传单地图上不起作用

时间:2019-05-19 09:09:37

标签: javascript leaflet

当我在传单地图上绘制热层时,仅在拖动地图时显示。

 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)

0 个答案:

没有答案