1
0
Fork 0

BrowserMap: some cleanup

This commit is contained in:
Torsten Dreyer 2014-10-09 22:11:52 +02:00
parent 56b76e860c
commit a790930acd

View file

@ -108,65 +108,14 @@ html,body,#map {
zoom : 10
});
var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
var osm = new L.TileLayer(
'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
{
maxZoom : 18,
attribution : 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors'
});
map.addLayer(osm);
var mqroad = new L.TileLayer(
'http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png',
{
maxZoom : 18,
subdomains : [ '1', '2', '3', '4' ],
attribution : 'Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a>. Map data (c) <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> contributors, CC-BY-SA.'
});
var mqsat = new L.TileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', {
maxZoom : 18,
subdomains : [ '1', '2', '3', '4' ],
attribution : 'Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a>.'
});
var vfrMap = new L.TileLayer(
'http://vfrmap.com/20140918/tiles/vfrc/{z}/{y}/{x}.jpg',
{
maxZoom : 12,
minZoom : 3,
attribution : '(c) <a href="VFRMap.com">VFRMap.com</a>',
tms: true,
opacity: 0.5,
bounds: L.latLngBounds(L.latLng(16.0,-179.0), L.latLng(72.0,-60.0) ),
});
var icaoGermany = new L.TileLayer('https://secais.dfs.de/static-maps/ICAO500-2014-DACH-Reprojected/tiles/{z}/{x}/{y}.png', {
maxZoom : 15,
attribution : 'Map data © <a href="http://www.dfs.de">DFS</a>'
});
var lowerGermany = new L.TileLayer('https://secais.dfs.de/static-maps/lower_20131114/tiles/{z}/{x}/{y}.png', {
maxZoom : 15,
attribution : 'Map data © <a href="http://www.dfs.de">DFS</a>'
});
var owmPrecipitation = new L.TileLayer("http://{s}.tile.openweathermap.org/map/precipitation/{z}/{x}/{y}.png", {
maxZoom : 14,
minZoom : 0,
subdomains : '12',
format : 'image/png',
transparent : true,
opacity : 0.5
});
var owmPressure = new L.TileLayer("http://{s}.tile.openweathermap.org/map/pressure_cntr/{z}/{x}/{y}.png", {
maxZoom : 7,
minZoom : 0,
subdomains : '12',
format : 'image/png',
transparent : true,
opacity : 0.5
});
var MAP_ICON = {};
MAP_ICON["VOR"] = L.icon({
iconSize : [ 30, 30 ],
@ -521,20 +470,92 @@ html,body,#map {
map.addLayer(aiLayer);
var baseLayers = {
"OpenStreetMaps" : osm,
"MapQuest Satelite" : mqsat,
"MapQuest Roads" : mqroad,
"MapQuest Satelite" : new L.TileLayer(
'http://otile{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png',
{
maxZoom : 18,
subdomains : [ '1', '2', '3', '4' ],
attribution : 'Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a>.'
}),
"MapQuest Roads" : new L.TileLayer(
'http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png',
{
maxZoom : 18,
subdomains : [ '1', '2', '3', '4' ],
attribution :
'Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a>. Map data (c) <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> contributors, CC-BY-SA.'
}),
};
var overlays = {
"NAVDB" : navdbLayer,
"AI" : aiLayer,
"VFRMap.com" : vfrMap,
//"ICAO VFR (Germany)" : icaoGermany,
//"Lower Airspace (Germany)" : lowerGermany,
"Precipitation" : owmPrecipitation,
"Isobares" : owmPressure,
"VFRMap.com Sectionals (US)" : new L.TileLayer(
'http://vfrmap.com/20140918/tiles/vfrc/{z}/{y}/{x}.jpg',
{
maxZoom : 12,
minZoom : 3,
attribution : '(c) <a href="VFRMap.com">VFRMap.com</a>',
tms: true,
opacity: 0.5,
bounds: L.latLngBounds(L.latLng(16.0,-179.0), L.latLng(72.0,-60.0) ),
}),
"VFRMap.com - Low IFR (US)" : new L.TileLayer(
'http://vfrmap.com/20140918/tiles/ifrlc/{z}/{y}/{x}.jpg',
{
maxZoom : 12,
minZoom : 5,
attribution : '© <a href="VFRMap.com">VFRMap.com</a>',
tms: true,
opacity: 0.5,
bounds: L.latLngBounds(L.latLng(16.0,-179.0), L.latLng(72.0,-60.0) ),
}),
"dfs.de VFR" : new L.TileLayer(
'https://secais.dfs.de/static-maps/ICAO500-2014-DACH-Reprojected_01/tiles/{z}/{x}/{y}.png',
{
minZoom : 5,
maxZoom : 15,
attribution : 'Map data © <a href="http://www.dfs.de">DFS</a>',
bounds: L.latLngBounds(L.latLng(46.0,5.0), L.latLng(55.1,16.5) ),
}),
"Lower Airspace (Germany)" : new L.TileLayer(
'https://secais.dfs.de/static-maps/lower_20131114/tiles/{z}/{x}/{y}.png',
{
minZoom : 5,
maxZoom : 15,
attribution : 'Map data © <a href="http://www.dfs.de">DFS</a>',
bounds: L.latLngBounds(L.latLng(46.0,5.0), L.latLng(55.1,16.5) ),
}),
"Precipitation" : new L.TileLayer(
'http://{s}.tile.openweathermap.org/map/precipitation/{z}/{x}/{y}.png',
{
maxZoom : 14,
minZoom : 0,
subdomains : '12',
format : 'image/png',
transparent : true,
opacity : 0.5
}),
"Isobares" : new L.TileLayer(
'http://{s}.tile.openweathermap.org/map/pressure_cntr/{z}/{x}/{y}.png',
{
maxZoom : 7,
minZoom : 0,
subdomains : '12',
format : 'image/png',
transparent : true,
opacity : 0.5
}),
};
var aircraftMarker = new L.RotatedMarker(map.getCenter(), {
@ -652,6 +673,7 @@ html,body,#map {
L.control.scale().addTo(map);
info.addTo(map);
FollowAircraftControl.addTo(map);
L.control.layers(baseLayers, overlays).addTo(map);
map.on('resize', function(e) {