From f6cbc65cdc30930fb9857e86381d0826baa9a7da Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Tue, 23 Nov 2021 15:03:37 +0100 Subject: [PATCH] always detect source type for custom background sources. fixes #8057 --- CHANGELOG.md | 2 ++ modules/renderer/background_source.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6b764ecc..dbe049cbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ _Breaking developer changes, which may affect downstream projects or sites that #### :bug: Bugfixes * Fix hidden tooltips on map control toolbar ([#8781]) * Fix glitching out turn restriction minimap on narrow sidebars ([#8792]) +* Fix a bug which made it impossible to switch to a custom TMS imagery layer after using a custom WMS source and vice versa ([#8057]) #### :earth_asia: Localization #### :hourglass: Performance #### :mortar_board: Walkthrough / Help @@ -61,6 +62,7 @@ _Breaking developer changes, which may affect downstream projects or sites that * Add colours for preset categories ([#8799]) #### :hammer: Development +[#8057]: https://github.com/openstreetmap/iD/issues/8057 [#8771]: https://github.com/openstreetmap/iD/issues/8771 [#8781]: https://github.com/openstreetmap/iD/issues/8781 [#8792]: https://github.com/openstreetmap/iD/pull/8792 diff --git a/modules/renderer/background_source.js b/modules/renderer/background_source.js index 764fd6fd5..0c42b5a22 100644 --- a/modules/renderer/background_source.js +++ b/modules/renderer/background_source.js @@ -117,7 +117,7 @@ export function rendererBackgroundSource(data) { // Guess a type based on the tokens present in the template // (This is for 'custom' source, where we don't know) - if (!source.type) { + if (!source.type || source.id === 'custom') { if (/SERVICE=WMS|\{(proj|wkid|bbox)\}/.test(_template)) { source.type = 'wms'; source.projection = 'EPSG:3857'; // guess