Blame view
src/main/resources/leafletmap/Leaflet.heat/demo/draw.html
1.72 KB
79b001037 heat map |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
<!DOCTYPE html> <html> <head> <title>Leaflet.heat demo</title> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" /> <script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script> <style> #map { width: 800px; height: 600px; } body { font: 16px/1.4 "Helvetica Neue", Arial, sans-serif; } .ghbtns { position: relative; top: 4px; margin-left: 5px; } a { color: #0077ff; } </style> </head> <body> <p> A dynamic demo of <a href="https://github.com/Leaflet/Leaflet.heat">Leaflet.heat</a>, a tiny and fast Leaflet heatmap plugin. <iframe class="ghbtns" src="http://ghbtns.com/github-btn.html?user=Leaflet&repo=Leaflet.heat&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="90" height="20"></iframe> </p> <div id="map"></div> <!-- <script src="../node_modules/simpleheat/simpleheat.js"></script> <script src="../src/HeatLayer.js"></script> --> <script src="../dist/leaflet-heat.js"></script> <script src="http://leaflet.github.io/Leaflet.markercluster/example/realworld.388.js"></script> <script> var map = L.map('map').setView([-37.82109, 175.2193], 16); var tiles = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors', }).addTo(map); addressPoints = addressPoints.map(function (p) { return [p[0], p[1]]; }); 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> </body> </html> |