Add Tracestrack Topo as featured layer
This commit is contained in:
parent
cfcb89a9c9
commit
00d085ed5d
6 changed files with 34 additions and 1 deletions
|
@ -51,6 +51,13 @@ L.OSM.Map = L.Map.extend({
|
|||
}).prop("outerHTML");
|
||||
var thunderforest = I18n.t("javascripts.map.thunderforest_credit", { thunderforest_link: thunderforest_link });
|
||||
|
||||
var tracestrack_link = $("<a>", {
|
||||
href: "https://www.tracestrack.com/",
|
||||
target: "_blank",
|
||||
text: I18n.t("javascripts.map.tracestrack")
|
||||
}).prop("outerHTML");
|
||||
var tracestrack = I18n.t("javascripts.map.tracestrack_credit", { tracestrack_link: tracestrack_link });
|
||||
|
||||
var memomaps_link = $("<a>", {
|
||||
href: "https://memomaps.de/",
|
||||
target: "_blank",
|
||||
|
@ -99,6 +106,15 @@ L.OSM.Map = L.Map.extend({
|
|||
}));
|
||||
}
|
||||
|
||||
if (OSM.TRACESTRACK_KEY) {
|
||||
this.baseLayers.push(new L.OSM.TracestrackTopo({
|
||||
attribution: copyright + ". " + tracestrack + ". " + terms,
|
||||
apikey: OSM.TRACESTRACK_KEY,
|
||||
code: "P",
|
||||
keyid: "tracestracktopo",
|
||||
name: I18n.t("javascripts.map.base.tracestracktop_topo")
|
||||
}));
|
||||
}
|
||||
this.baseLayers.push(new L.OSM.OPNVKarte({
|
||||
attribution: copyright + ". " + memomaps + ". " + terms,
|
||||
code: "O",
|
||||
|
|
|
@ -25,6 +25,10 @@ OSM = {
|
|||
THUNDERFOREST_KEY: <%= Settings.thunderforest_key.to_json %>,
|
||||
<% end %>
|
||||
|
||||
<% if Settings.key?(:tracestrack_key) %>
|
||||
TRACESTRACK_KEY: <%= Settings.tracestrack_key.to_json %>,
|
||||
<% end %>
|
||||
|
||||
MARKER_GREEN: <%= image_path("marker-green.png").to_json %>,
|
||||
MARKER_RED: <%= image_path("marker-red.png").to_json %>,
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ csp_policy = {
|
|||
:form_action => %w['self'],
|
||||
:frame_ancestors => %w['self'],
|
||||
:frame_src => %w['self'],
|
||||
:img_src => %w['self' data: www.gravatar.com *.wp.com tile.openstreetmap.org *.tile.openstreetmap.org *.tile.thunderforest.com tileserver.memomaps.de *.openstreetmap.fr],
|
||||
:img_src => %w['self' data: www.gravatar.com *.wp.com tile.openstreetmap.org *.tile.openstreetmap.org *.tile.thunderforest.com tileserver.memomaps.de tile.tracestrack.com *.openstreetmap.fr],
|
||||
:manifest_src => %w['self'],
|
||||
:media_src => %w['none'],
|
||||
:object_src => %w['self'],
|
||||
|
|
|
@ -2966,6 +2966,7 @@ en:
|
|||
cyclosm: CyclOSM
|
||||
cycle_map: Cycle Map
|
||||
transport_map: Transport Map
|
||||
tracestracktop_topo: Tracestrack Topo
|
||||
hot: Humanitarian
|
||||
opnvkarte: ÖPNVKarte
|
||||
layers:
|
||||
|
@ -2986,6 +2987,8 @@ en:
|
|||
andy_allan: Andy Allan
|
||||
opnvkarte_credit: "Tiles courtesy of %{memomaps_link}"
|
||||
memomaps: MeMoMaps
|
||||
tracestrack_credit: "Tiles courtesy of %{tracestrack_link}"
|
||||
tracestrack: Tracestrack
|
||||
hotosm_credit: "Tiles style by %{hotosm_link} hosted by %{osm_france_link}"
|
||||
hotosm_name: Humanitarian OpenStreetMap Team
|
||||
site:
|
||||
|
|
|
@ -117,6 +117,8 @@ fossgis_valhalla_url: "https://valhalla1.openstreetmap.de/route"
|
|||
#wikipedia_auth_secret: ""
|
||||
# Thunderforest authentication details
|
||||
#thunderforest_key: ""
|
||||
# Tracestrack authentication details
|
||||
#tracestrack_key: ""
|
||||
# Key for generating TOTP tokens
|
||||
#totp_key: ""
|
||||
# Enforce Content-Security-Policy
|
||||
|
|
8
vendor/assets/leaflet/leaflet.osm.js
vendored
8
vendor/assets/leaflet/leaflet.osm.js
vendored
|
@ -61,6 +61,14 @@ L.OSM.HOT = L.OSM.TileLayer.extend({
|
|||
}
|
||||
});
|
||||
|
||||
L.OSM.TracestrackTopo = L.OSM.TileLayer.extend({
|
||||
options: {
|
||||
url: 'https://tile.tracestrack.com/topo__/{z}/{x}/{y}.png?key={apikey}',
|
||||
maxZoom: 19,
|
||||
attribution: '© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors. Tiles courtesy of <a href="https://www.tracestrack.com/" target="_blank">Tracestrack Maps</a>'
|
||||
}
|
||||
});
|
||||
|
||||
L.OSM.GPS = L.OSM.TileLayer.extend({
|
||||
options: {
|
||||
url: 'https://gps.tile.openstreetmap.org/lines/{z}/{x}/{y}.png',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue