1
0
Fork 0

Add a track layer to the browser map

This commit is contained in:
Torsten Dreyer 2015-02-25 10:49:55 +01:00
parent 82e96ac757
commit a25375aaf3

View file

@ -186,6 +186,25 @@ html,body,#map {
}
});
var TrackLayer = new L.geoJson(null, {
});
TrackLayer.update = function() {
var url = "/flighthistory/track.json";
var jqxhr = $.get(url).done(function(data) {
TrackLayer.clearLayers();
TrackLayer.addData(data);
}).fail(function() {
}).always(function() {
});
setTimeout(function() {
TrackLayer.update()
}, 10000);
};
map.addLayer(TrackLayer);
var navdbLayer = new L.geoJson(null, {
pointToLayer : function(feature, latlng) {
var options = {
@ -493,6 +512,7 @@ html,body,#map {
};
var overlays = {
"Track" : TrackLayer,
"NAVDB" : navdbLayer,
"AI" : aiLayer,
"VFRMap.com Sectionals (US)" : new L.TileLayer(
@ -762,6 +782,7 @@ html,body,#map {
navdbLayer.update();
aiLayer.update();
TrackLayer.update();
var latlng;
var i = 0;