-
Notifications
You must be signed in to change notification settings - Fork 799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make max-width of attribution control configurable #849
make max-width of attribution control configurable #849
Conversation
in the majority of applications it makes sense to leverage as much horizontal space as possible to display attribution, primarily because of small form factor devices, but 55px is a little safer default because it accomodates a bottom oriented zoom control automatically. since other possibly bottom aligned controls like L.Control.Scale and L.Controls.Layers don't have a static predictable width our best bet is to just expose a mechanism to let developers indicate just how much space should be reserved.
@tomwayson reminded me that a generic the snippet below is an example of how a developer could customize the amount of space reserved for other controls. // number of pixels to crop attribution width
L.esri.options.attributionWidthOffset = 200;
var map = L.map('map').setView([37.79, -122.45], 13); technically, the proposed implementation could lead to unexpected behavior if a developer tried to pass unique values to different resizable maps as they were created (because the value will be different when to be honest, i'm perfectly fine with that. edit: |
A little late on this, but LGTM! Only change I would have suggested is naming it |
agreed. i'll push up soon. |
* make max-width of attribution control configurable in the majority of applications it makes sense to leverage as much horizontal space as possible to display attribution, primarily because of small form factor devices, but 55px is a little safer default because it accomodates a bottom oriented zoom control automatically. since other possibly bottom aligned controls like L.Control.Scale and L.Controls.Layers don't have a static predictable width our best bet is to just expose a mechanism to let developers indicate just how much space should be reserved. * better to store the new option in our own namespace * linting * better linting
in the majority of applications it makes sense to leverage as much horizontal space as possible to display attribution, primarily because of small form factor devices, but
55px
is a little safer default because it accommodates a bottom oriented zoom control automatically.since other possibly bottom aligned controls like L.Control.Scale and L.Controls.Layers don't have a static predictable width our best bet is to just expose a mechanism to let developers indicate just how much space should be reserved.
i _think_ its kosher to just tack on a newL.Map
control constructor option and introspect for it ourselves later. if so, we'll need to find a new location in our own API reference to document it.