Skip to content

Add Leaflet scale control to real maps#481

Open
kwod wants to merge 1 commit into
javalent:mainfrom
kwod:feature/leaflet-scale-control
Open

Add Leaflet scale control to real maps#481
kwod wants to merge 1 commit into
javalent:mainfrom
kwod:feature/leaflet-scale-control

Conversation

@kwod

@kwod kwod commented Jul 4, 2026

Copy link
Copy Markdown

Pull Request Description

Leaflet already provides a built-in scale control, but it is never added to real maps.

This patch adds the standard Leaflet scale control after the map has been created. The control respects the existing noUI option and is only added when the map UI is enabled.

The change has been tested locally with OpenStreetMap and CARTO Voyager tile servers.

Changes Proposed

  • Add the built-in Leaflet scale control to real maps.
  • Respect the existing noUI option.
  • Display metric units only (imperial: false).

Related Issues

None.

Checklist

  • I have read the contribution guidelines and code of conduct.
  • I have tested the changes locally and they are working as expected.
  • I have added appropriate comments and documentation for the code changes.
  • My code follows the coding style and standards of this project.
  • I have rebased my branch on the latest main (or master) branch.
  • All tests (if applicable) have passed successfully.
  • I have run linters and fixed any issues.
  • I have checked for any potential security issues or vulnerabilities.

Screenshots

Before

grafik

After

grafik

Additional Notes

This change uses Leaflet's built-in Scale control and does not introduce any additional dependencies.

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.

1 participant