Add public gps tiles layer for debugging purposes
Fixes #1239 Closes #1406
This commit is contained in:
parent
ea93c0338c
commit
df17b997b3
5 changed files with 21 additions and 0 deletions
|
@ -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';
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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>"
|
||||
|
|
10
vendor/assets/leaflet/leaflet.osm.js
vendored
10
vendor/assets/leaflet/leaflet.osm.js
vendored
|
@ -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'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue