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
It should be possible to programatically change the ScaleControl's unit of distance and have the ScaleControl instantly update. This is helpful for applications that may need to show scale's in different units based on a site's location.
Design Alternatives
You could remove the scale and add it back when you want to change the unit.
Alternatively, you could provide a method to update the scale's internal unit and update the scale.
Design
Removing and re-adding the control is inefficient and can result in layout issues if multiple controls are in the same container. Updating the internal unit is fairly straightforward and only requires calling the existing updateScale method. I believe exposing this method is the proper way to achieve this goal.
Motivation
It should be possible to programatically change the ScaleControl's unit of distance and have the ScaleControl instantly update. This is helpful for applications that may need to show scale's in different units based on a site's location.
Design Alternatives
You could remove the scale and add it back when you want to change the unit.
Alternatively, you could provide a method to update the scale's internal unit and update the scale.
Design
Removing and re-adding the control is inefficient and can result in layout issues if multiple controls are in the same container. Updating the internal unit is fairly straightforward and only requires calling the existing
updateScale
method. I believe exposing this method is the proper way to achieve this goal.Mock-Up
N/A
Concepts
N/A
Implementation
Proposed pull request here
The text was updated successfully, but these errors were encountered: