Skip to content

Commit

Permalink
fix draw demo bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Feb 3, 2014
1 parent 9c4e73c commit e412eb6
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions demo/draw.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,17 @@
id: 'examples.map-20v6611k'
}).addTo(map);

var heat = L.heatLayer(addressPoints).addTo(map);

map.on('mousemove', function (e) {
heat.addLatLng(e.latlng);
var heat = L.heatLayer(addressPoints).addTo(map),
draw = true;

map.on({
movestart: function () { draw = false; },
moveend: function () { draw = true; },
mousemove: function (e) {
if (draw) {
heat.addLatLng(e.latlng);
}
}
})

</script>
Expand Down

0 comments on commit e412eb6

Please sign in to comment.