You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a ScaleControl to the map like so: map.addControl(new mapboxgl.ScaleControl({ unit: 'nautical' })
Zoom in to zoomlevel 12+.
The scalebar stays at 1 nm but grows indefinitely.
Expected Behavior
Alternative 1: For scales < 1 nm the scalebar should respect the maxWidth and instead display decimal units, like 0.5 nm and so on.
Alternative 2: For scales < 1 nm the scalebar should respect the maxWidth and instead switch to an alternative unit, for example 'metric'.
Alternative 3: For scales < 1 nm the scalebar should respect the maxWidth and instead display scale in cable length units.
I'm not sure which alternative I like best, but probably alt. 1.
Actual Behavior
Scalebar never displays units smaller than 1 nm, and instead grows horizontally indefinitely.
The text was updated successfully, but these errors were encountered:
I think it's just a matter of fixing the getRoundNum() function in scale_control.js. I'll give it a try. This will of course then apply to all units, not only nautical.
@mourner I have a fix ready, but I'm unable to push my feature branch. I'm getting:
remote: Permission to mapbox/mapbox-gl-js.git denied to MichaelHedman.
fatal: unable to access 'https://github.com/mapbox/mapbox-gl-js.git/': The requested URL returned error: 403
@MichaelHedman you need to fork the repository (see the Fork button on the top right), change your GitHub client repo settings so that it points to your fork instead of the main repo, and push there. Then you can create a pull request.
mapbox-gl-js version: 0.50.0
browser: Chrome 69.0.3497.100 (Official Build) (64-bit)
Steps to Trigger Behavior
Expected Behavior
Alternative 1: For scales < 1 nm the scalebar should respect the maxWidth and instead display decimal units, like 0.5 nm and so on.
Alternative 2: For scales < 1 nm the scalebar should respect the maxWidth and instead switch to an alternative unit, for example 'metric'.
Alternative 3: For scales < 1 nm the scalebar should respect the maxWidth and instead display scale in cable length units.
I'm not sure which alternative I like best, but probably alt. 1.
Actual Behavior
Scalebar never displays units smaller than 1 nm, and instead grows horizontally indefinitely.
The text was updated successfully, but these errors were encountered: