-
-
Save josselin-c/d1ea2b6e1c0fddea4f1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>World fleet livemap</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> | |
<script type="text/javascript" src="js/leaflet-heat.js"></script> | |
<script type="text/javascript"> | |
var heatmap; | |
function initmap() { | |
var map = new L.map('map') | |
var osmURL = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; | |
osmURL = "http://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png" | |
var osm = L.tileLayer(osmURL, { | |
maxZoom: 16, | |
attribution: '<a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>' | |
}); | |
map.setView(new L.LatLng(48.8567, 2.3508),12); | |
map.addLayer(osm); | |
heatmap = L.heatLayer([ | |
[48.8567, 2.3508, 129], // lat, lng, intensity | |
], { | |
}).addTo(map); | |
} | |
function refresh() { | |
heatmap.setLatLngs([[48.8567, 2.3508, 129]]); | |
} | |
window.setInterval(refresh, 1000); | |
</script> | |
</head> | |
<body onload="initmap()"> | |
<div id="map" style="width: 800px; height: 600px"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment