Skip to content

Support multiple saved custom background layers - #5

Closed
tordans wants to merge 57 commits into
developfrom
multiple-custom-backgrounds
Closed

Support multiple saved custom background layers#5
tordans wants to merge 57 commits into
developfrom
multiple-custom-backgrounds

Conversation

@tordans

@tordans tordans commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Testing

  • x

Note to self: Edit redirect URL at https://www.openstreetmap.org/oauth2/applications/12061/edit

Summary

iD can now remember more than one custom background imagery layer. If you regularly switch between a local WMS server, a specialty tile set, and OpenStreetMap tiles, you no longer have to re-enter the URL each time — save each one, give it an optional name, and pick it from the Background list like any other layer.

What you get:

  • Several custom backgrounds at once — add as many tile URL templates as you need; each appears as its own entry in the Background pane.
  • Optional names — label layers (e.g. “City orthophoto 2024”) so long URLs don’t clutter the list.
  • Edit and delete — change a saved URL or remove a layer you no longer need, with a confirmation before delete.
  • Quick switching — custom layers stay at the top of the background list and work with the existing background toggle.
  • Shareable links#background=custom:<url> still works: the URL is added to your saved list (if new) and selected.
  • Seamless upgrade — an existing single custom background from older iD versions is migrated automatically on first use.

Reimplements #8874.

Test plan

  • npm test — lint, build, typecheck, and all specs pass locally
  • Add two custom backgrounds with different URLs; confirm both appear in the list and can be selected
  • Edit a saved custom background (name and/or URL); confirm the map updates and the entry stays stable
  • Delete a custom background; confirm it is removed and the map falls back to None when that layer was active
  • Open iD with #background=custom:<url>; confirm the URL is saved and selected
  • Upgrade from a profile with only the legacy single custom template; confirm it migrates to one saved entry

Made with Cursor

@netlify

netlify Bot commented Aug 2, 2026

Copy link
Copy Markdown

Deploy Preview for tordans-id-experiments ready!

Name Link
🔨 Latest commit 8f1f8d5
🔍 Latest deploy log https://app.netlify.com/projects/tordans-id-experiments/deploys/6a778b0260eba40008710155
😎 Deploy Preview https://deploy-preview-5--tordans-id-experiments.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread data/core.yaml
@tordans
tordans force-pushed the multiple-custom-backgrounds branch from 8fc9c27 to 0f19c10 Compare August 2, 2026 05:22
Comment thread modules/renderer/custom_backgrounds.ts Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Left a non-blocking comment: Cursor Bugbot finished as skipping and reported unresolved findings (including a medium-severity legacy custom-id toggle issue), so this run is not approving. Requesting human reviewers for the custom-background changes.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dependabot Review and Auto Merge

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ebc39fb. Configure here.

Comment thread modules/renderer/background.js

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Left a non-blocking comment: Cursor Bugbot finished as skipping and reported an unresolved medium finding (deduped custom background ignores the new name), so this run is not approving. Requesting human reviewers for the custom-background changes.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dependabot Review and Auto Merge

tyrasd and others added 18 commits August 4, 2026 12:21
allows to find presets by their raw tags in `addTags` as well
…map#12677)

Bumps the types group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 26.1.1 to 26.1.2
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 26.1.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…peed-single-digit

Delete the unused lane parsing code
* hide "add tag" row
* fix rounded borders at corners
* drop unused css class
* add missing padding in tag editor section
* remove line between heading and properties list
with full (raw) tag value and description if available

Co-authored-by: Martin Raifer <martin@raifer.tech>
…ap#12685)

`options` is only set from `field.options`, so it stays undefined for
check fields without an explicit list (e.g. `backrest`). Calling
`options.includes()` then threw while rendering the entity editor, which
aborted mode select before it applied the mode class, leaving the map
without select cursors and the raw tag editor showing the previous
feature. Compare against `values`, which always falls back to yes/no.

Co-authored-by: Cursor <cursoragent@cursor.com>
Bumps [jsdom](https://github.com/jsdom/jsdom) from 30.0.0 to 30.0.1.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Commits](jsdom/jsdom@v30.0.0...v30.0.1)

---
updated-dependencies:
- dependency-name: jsdom
  dependency-version: 30.0.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
tordans and others added 5 commits August 8, 2026 18:14
The active list/text toggle does nothing when clicked again, so a hand
cursor is misleading.

Co-authored-by: Cursor <cursoragent@cursor.com>
Generalize the heading-line icon button classes so other disclosures can
reuse the same chrome without a second CSS path.

Co-authored-by: Cursor <cursoragent@cursor.com>
The star is informational (tooltip only), so show the question cursor
instead of a text I-beam.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Replaces the single custom background with a saved list: add/edit/delete
rows, optional names, cleaned URL templates, collapsible WMS/TMS help,
and `#background=custom:<url>` / legacy `#background=custom` hash support.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tordans
tordans force-pushed the multiple-custom-backgrounds branch from ebc39fb to eb4208f Compare August 8, 2026 16:16
@cursor

cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_0dce5adb-a904-464f-b870-bf232fe33ed1)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Left a non-blocking comment: Cursor Bugbot finished as skipping on this synchronize, so this run is not approving. Assigned human reviewers for the custom-background changes.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dependabot Review and Auto Merge

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_3b84d9b6-8113-45c3-8b1d-967f35fdfd85)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Left a non-blocking comment: Cursor Bugbot finished as skipping on this synchronize, so this run is not approving. Assigning human reviewers for the custom-background changes.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dependabot Review and Auto Merge

tordans and others added 15 commits August 8, 2026 21:07
Place add/view controls in the summary and hide them with
:not(:open), removing the negative-margin layout hack.

Co-authored-by: Cursor <cursoragent@cursor.com>
Reuse the shared 200px tooltip width; scrollContainer and
word-break already keep long URLs inside the pane.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep this PR focused on custom backgrounds; leave that
validation string bug for a separate fix.

Co-authored-by: Cursor <cursoragent@cursor.com>
The optional label is enough; an example string is unnecessary.

Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid a noise-only const/let rewrite in the PR diff.

Co-authored-by: Cursor <cursoragent@cursor.com>
TypeScript can type reads as string|null and writes as boolean,
so callers no longer need a local cast.

Co-authored-by: Cursor <cursoragent@cursor.com>
Run template + last-used migration only when needed, clear the
old key, and stop writing an empty list on fresh installs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the global hyphenation rules and stop wiring scrollContainer
onto ordinary background-list tooltips.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pass the entry via d3 selection.call instead of a forEntry
helper, and drop unnecessary type casts.

Co-authored-by: Cursor <cursoragent@cursor.com>
Type uiModal/uiConfirm and utilNoAuto at the source so the
settings modal no longer needs as-any workarounds.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the thin setPref/getPref wrappers now that prefs is typed.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Apply selected/hover/active styles to label and button cells so
custom edit controls don't need a background-pane override.

Co-authored-by: Cursor <cursoragent@cursor.com>
Put the example URL under the template field, drop the help-icon column, and fix extra gaps from inline textarea baseline and disclosure line-height.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_ed478cd3-90a7-42fa-b295-61240e5172a4)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a non-blocking comment: Cursor Bugbot finished as skipping on this synchronize, so this run is not approving. Assigning human reviewers for the custom-background changes.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dependabot Review and Auto Merge

@tordans

tordans commented Aug 9, 2026

Copy link
Copy Markdown
Owner Author

This is now on openstreetmap#12703

@tordans tordans closed this Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants