Add public gps tiles layer for debugging purposes

Fixes #1239
Closes #1406
This commit is contained in:
Lars Sonchocky-Helldorf 2017-01-04 19:24:23 +00:00 committed by Tom Hughes
parent ea93c0338c
commit df17b997b3
5 changed files with 21 additions and 0 deletions

View file

@ -157,6 +157,10 @@ $(document).ready(function () {
if (params.layers.indexOf(map.dataLayer.options.code) >= 0) {
map.addLayer(map.dataLayer);
}
if (params.layers.indexOf(map.gpsLayer.options.code) >= 0) {
map.addLayer(map.gpsLayer);
}
}
var placement = $('html').attr('dir') === 'rtl' ? 'right' : 'left';

View file

@ -176,6 +176,7 @@ L.OSM.layers = function(options) {
addOverlay(map.noteLayer, 'notes', OSM.MAX_NOTE_REQUEST_AREA);
addOverlay(map.dataLayer, 'data', OSM.MAX_REQUEST_AREA);
addOverlay(map.gpsLayer, 'gps', Number.POSITIVE_INFINITY);
}
options.sidebar.addPane($ui);

View file

@ -55,6 +55,11 @@ L.OSM.Map = L.Map.extend({
this.dataLayer = new L.OSM.DataLayer(null);
this.dataLayer.options.code = 'D';
this.gpsLayer = new L.OSM.GPS({
code: "G",
name: I18n.t("javascripts.map.base.gps")
});
},
updateLayers: function(layerParam) {

View file

@ -2211,6 +2211,7 @@ en:
header: Map Layers
notes: Map Notes
data: Map Data
gps: Public GPS Traces
overlays: Enable overlays for troubleshooting the map
title: "Layers"
copyright: "© <a href='%{copyright_url}'>OpenStreetMap contributors</a>"

View file

@ -64,6 +64,16 @@ L.OSM.HOT = L.OSM.TileLayer.extend({
}
});
L.OSM.GPS = L.OSM.TileLayer.extend({
options: {
url: document.location.protocol === 'https:' ?
'https://{s}.gps-tile.openstreetmap.org/lines/{z}/{x}/{y}.png' :
'http://{s}.gps-tile.openstreetmap.org/lines/{z}/{x}/{y}.png',
maxZoom: 20,
subdomains: 'abc'
}
});
L.OSM.DataLayer = L.FeatureGroup.extend({
options: {
areaTags: ['area', 'building', 'leisure', 'tourism', 'ruins', 'historic', 'landuse', 'military', 'natural', 'sport'],