mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-30 08:50:32 +02:00
trim hash part from custom imagery source URLs
before trying to detect the imagery source's type, fixes #8822
This commit is contained in:
@@ -112,19 +112,19 @@ export function rendererBackgroundSource(data) {
|
||||
|
||||
|
||||
source.url = function(coord) {
|
||||
var result = _template;
|
||||
var result = _template.replace(/#.*/su, ''); // strip hash part of URL
|
||||
if (result === '') return result; // source 'none'
|
||||
|
||||
|
||||
// Guess a type based on the tokens present in the template
|
||||
// (This is for 'custom' source, where we don't know)
|
||||
if (!source.type || source.id === 'custom') {
|
||||
if (/SERVICE=WMS|\{(proj|wkid|bbox)\}/.test(_template)) {
|
||||
if (/SERVICE=WMS|\{(proj|wkid|bbox)\}/.test(result)) {
|
||||
source.type = 'wms';
|
||||
source.projection = 'EPSG:3857'; // guess
|
||||
} else if (/\{(x|y)\}/.test(_template)) {
|
||||
} else if (/\{(x|y)\}/.test(result)) {
|
||||
source.type = 'tms';
|
||||
} else if (/\{u\}/.test(_template)) {
|
||||
} else if (/\{u\}/.test(result)) {
|
||||
source.type = 'bing';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user