2016-03-17 62 views

回答

1

主要原因是您在heatLayer参数中评论了gradient属性。

然后你需要增加max属性,因为你的点的强度值高于1。

尝试与

var heat = L.heatLayer(quakepoints,{ 
     radius: 20, 
     blur: 15, 
     maxZoom: 10, 
     max: 4.0, 

     gradient: { 
      0.0: 'green', 
      0.5: 'yellow', 
      1.0: 'red' 
     } 
    }).addTo(map); 

你必须从0%的人认为梯度指数(0.0至1.0)作为光标到您的最大强度

的100%,这是结果.. 。 enter image description here

看看你会得到什么,如果你(在这种情况下3.2)降低最高属性的东西更接近你的最高强度值

enter image description here

+0

我错过了“最大”配置。谢谢。 –