Skip to content

Commit

Permalink
always detect source type for custom background sources.
Browse files Browse the repository at this point in the history
fixes #8057
  • Loading branch information
tyrasd committed Nov 23, 2021
1 parent 770a43b commit f6cbc65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/renderer/background_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f6cbc65

Please sign in to comment.