kopia lustrzana https://github.com/OpenDroneMap/WebODM
rodzic
7ab2b14ba6
commit
446fdb7987
|
@ -384,12 +384,14 @@ class Map extends React.Component {
|
||||||
|
|
||||||
const customLayer = L.layerGroup();
|
const customLayer = L.layerGroup();
|
||||||
customLayer.on("add", a => {
|
customLayer.on("add", a => {
|
||||||
|
const defaultCustomBm = window.localStorage.getItem('lastCustomBasemap') || 'https://a.tile.openstreetmap.org/{z}/{x}/{y}.png';
|
||||||
|
|
||||||
let url = window.prompt([_('Enter a tile URL template. Valid coordinates are:'),
|
let url = window.prompt([_('Enter a tile URL template. Valid coordinates are:'),
|
||||||
_('{z}, {x}, {y} for Z/X/Y tile scheme'),
|
_('{z}, {x}, {y} for Z/X/Y tile scheme'),
|
||||||
_('{-y} for flipped TMS-style Y coordinates'),
|
_('{-y} for flipped TMS-style Y coordinates'),
|
||||||
'',
|
'',
|
||||||
_('Example:'),
|
_('Example:'),
|
||||||
'https://a.tile.openstreetmap.org/{z}/{x}/{y}.png'].join("\n"), 'https://a.tile.openstreetmap.org/{z}/{x}/{y}.png');
|
'https://a.tile.openstreetmap.org/{z}/{x}/{y}.png'].join("\n"), defaultCustomBm);
|
||||||
|
|
||||||
if (url){
|
if (url){
|
||||||
customLayer.clearLayers();
|
customLayer.clearLayers();
|
||||||
|
@ -400,6 +402,7 @@ _('Example:'),
|
||||||
});
|
});
|
||||||
customLayer.addLayer(l);
|
customLayer.addLayer(l);
|
||||||
l.bringToBack();
|
l.bringToBack();
|
||||||
|
window.localStorage.setItem('lastCustomBasemap', url);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.basemaps[_("Custom")] = customLayer;
|
this.basemaps[_("Custom")] = customLayer;
|
||||||
|
|
Ładowanie…
Reference in New Issue