Merge remote-tracking branch 'upstream/pull/2994'

This commit is contained in:
Tom Hughes 2021-01-13 20:40:48 +00:00
commit 4abd9cfcf1
4 changed files with 21 additions and 0 deletions

View file

@ -39,6 +39,8 @@ window.onload = function () {
if (!args.layer || args.layer === "mapnik" || args.layer === "osmarender" || args.layer === "mapquest") {
new L.OSM.Mapnik(mapnikOptions).addTo(map);
} else if (args.layer === "cyclosm") {
new L.OSM.CyclOSM().addTo(map);
} else if (args.layer === "cyclemap" || args.layer === "cycle map") {
new L.OSM.CycleMap(thunderforestOptions).addTo(map);
} else if (args.layer === "transportmap") {

View file

@ -18,6 +18,7 @@ L.OSM.Map = L.Map.extend({
var copyright = I18n.t("javascripts.map.copyright", { copyright_url: "/copyright" });
var donate = I18n.t("javascripts.map.donate_link_text", { donate_url: "https://donate.openstreetmap.org" });
var terms = I18n.t("javascripts.map.terms", { terms_url: "https://wiki.osmfoundation.org/wiki/Terms_of_Use" });
var cyclosm = I18n.t("javascripts.map.cyclosm", { cyclosm_url: "https://www.cyclosm.org", osmfrance_url: "https://openstreetmap.fr/" });
var thunderforest = I18n.t("javascripts.map.thunderforest", { thunderforest_url: "https://www.thunderforest.com/" });
var memomaps = I18n.t("javascripts.map.opnvkarte", { memomaps_url: "https://memomaps.de/" });
var hotosm = I18n.t("javascripts.map.hotosm", { hotosm_url: "https://www.hotosm.org/", osmfrance_url: "https://openstreetmap.fr/" });
@ -31,6 +32,13 @@ L.OSM.Map = L.Map.extend({
name: I18n.t("javascripts.map.base.standard")
}));
this.baseLayers.push(new L.OSM.CyclOSM({
attribution: copyright + ". " + cyclosm + ". " + terms,
code: "Y",
keyid: "cyclosm",
name: I18n.t("javascripts.map.base.cyclosm")
}));
if (OSM.THUNDERFOREST_KEY) {
this.baseLayers.push(new L.OSM.CycleMap({
attribution: copyright + ". " + thunderforest + ". " + terms,

View file

@ -2696,6 +2696,7 @@ en:
other: You are within %{count} feet of this point
base:
standard: Standard
cyclosm: CyclOSM
cycle_map: Cycle Map
transport_map: Transport Map
hot: Humanitarian
@ -2710,6 +2711,7 @@ en:
copyright: "© <a href='%{copyright_url}'>OpenStreetMap contributors</a>"
donate_link_text: "<a class='donate-attr' href='%{donate_url}'>Make a Donation</a>"
terms: "<a href='%{terms_url}' target='_blank'>Website and API terms</a>"
cyclosm: "Tiles style by <a href='%{cyclosm_url}' target='_blank'>CyclOSM</a> hosted by <a href='%{osmfrance_url}' target='_blank'>OpenStreetMap France</a>"
thunderforest: "Tiles courtesy of <a href='%{thunderforest_url}' target='_blank'>Andy Allan</a>"
opnvkarte: "Tiles courtesy of <a href='%{memomaps_url}' target='_blank'>MeMoMaps</a>"
hotosm: "Tiles style by <a href='%{hotosm_url}' target='_blank'>Humanitarian OpenStreetMap Team</a> hosted by <a href='%{osmfrance_url}' target='_blank'>OpenStreetMap France</a>"

View file

@ -19,6 +19,15 @@ L.OSM.Mapnik = L.OSM.TileLayer.extend({
}
});
L.OSM.CyclOSM = L.OSM.TileLayer.extend({
options: {
url: 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png',
maxZoom: 20,
subdomains: 'abc',
attribution: '© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors. Tiles courtesy of <a href="https://www.openstreetmap.fr" target="_blank">OpenStreetMap France</a>'
}
});
L.OSM.CycleMap = L.OSM.TileLayer.extend({
options: {
url: 'https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}{r}.png?apikey={apikey}',