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
I added a custom attribution to the source ("nj.gov")
added minzoom=10 to the layer to make it initially hidden (appear after couple of zoom ins)
=> the custom attribution is never shown.
Comment out "minzoom" and the attribution shows.
Checking the code I think the AttributionControl:onAdd/onRemove methods need to nudge _updateAttributions also on "moveend" event, otherwise an initially hidden attribution never get's a chance to appear.
Sizing: needs investigation
The text was updated successfully, but these errors were encountered:
Seems to work!
But.. now I want more ;) Ideally I think attributions should match what's actually visible on the screen, regardless of expressions. If you have several overlays or sources spread across the globe, you'd like the ones not visible to not show attribution.
Or at least layers that are bounded with the new "within" expression (that's my case now)
That's how Google maps does it for example, local map data providers' attributions only show for the local area.
Is that feasible to add you think?
Updating custom attributions is missed if the source layer is not initially visible.
This codepen https://codepen.io/blqute/pen/PoZjbpp illustrates it (based on https://docs.mapbox.com/mapbox-gl-js/example/wms/ )
Only changes:
=> the custom attribution is never shown.
Comment out "
minzoom
" and the attribution shows.Checking the code I think the
AttributionControl:onAdd/onRemove
methods need to nudge_updateAttributions
also on "moveend
" event, otherwise an initially hidden attribution never get's a chance to appear.Sizing: needs investigation
The text was updated successfully, but these errors were encountered: