kopia lustrzana https://github.com/projecthorus/chasemapper
Add optional Stadia Alidade Dark Map
rodzic
e3107b45cb
commit
3926524007
|
@ -23,6 +23,7 @@ default_config = {
|
|||
"default_alt": 0,
|
||||
"payload_max_age": 180,
|
||||
"thunderforest_api_key": "none",
|
||||
"stadia_api_key": "none",
|
||||
# Predictor settings
|
||||
"pred_enabled": True, # Enable running and display of predicted flight paths.
|
||||
"offline_predictions": False, # Use an offline GFS model and predictor instead of Tawhiri.
|
||||
|
@ -163,6 +164,12 @@ def parse_config_file(filename):
|
|||
logging.info("Missing default_alt setting, using default (0m)")
|
||||
chase_config["default_alt"] = 0
|
||||
|
||||
try:
|
||||
chase_config["stadia_api_key"] = config.get("map", "stadia_api_key")
|
||||
except:
|
||||
logging.info("Missing Stadia API Key setting, using default (none)")
|
||||
chase_config["stadia_api_key"] = "none"
|
||||
|
||||
# Telemetry Source Profiles
|
||||
|
||||
_profile_count = config.getint("profile_selection", "profile_count")
|
||||
|
|
|
@ -108,6 +108,11 @@ payload_max_age = 180
|
|||
# Once you have a key, enter it below:
|
||||
thunderforest_api_key = none
|
||||
|
||||
# Stadia Maps API Key
|
||||
# Stadia provides an excellent Dark map layer (Alidade Smooth Dark), which is looking promising for use in a 'dark mode' theme.
|
||||
# Accessing this requires registering at https://client.stadiamaps.com/signup/ then creating a 'property'
|
||||
# and obtaining an API key. Once you have a key, enter it below:
|
||||
stadia_api_key = none
|
||||
|
||||
# Predictor Settings
|
||||
# By default this will attempt to get predictions from the online Tawhiri Predictions API.
|
||||
|
|
|
@ -240,6 +240,7 @@
|
|||
attribution: '© '+esrimapLink+', '+esriwholink,
|
||||
maxZoom: 18,
|
||||
});
|
||||
// Dark Matter map layer, one of the maps suitable for 'dark mode'
|
||||
var dark_matter_map = L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/dark_all/{z}/{x}/{y}.png', {
|
||||
attribution: '© <a href="https://carto.com/help/building-maps/basemap-list/">Carto</a>'
|
||||
});
|
||||
|
@ -259,6 +260,16 @@
|
|||
|
||||
}
|
||||
|
||||
if (chase_config.stadia_api_key !== 'none'){
|
||||
// Stadia Alidade Smooth Dark Layer.
|
||||
var alidade_smooth_dark = L.tileLayer('https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z}/{x}/{y}{r}.png?apikey='+chase_config.stadia_api_key,
|
||||
{
|
||||
attribution: '© <a href="https://stadiamaps.com/">Stadia Maps</a>, © <a href="https://openmaptiles.org/">OpenMapTiles</a> © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors'
|
||||
});
|
||||
map_layers['Alidade Smooth Dark'] = alidade_smooth_dark;
|
||||
|
||||
}
|
||||
|
||||
// Add Offline map layers, if we have any.
|
||||
for (var i = 0, len = chase_config.offline_tile_layers.length; i < len; i++) {
|
||||
var _layer_name = chase_config.offline_tile_layers[i];
|
||||
|
|
Ładowanie…
Reference in New Issue