shramov / leaflet-plugins

Plugins for Leaflet library
http://psha.org.ru/b/leaflet-plugins.html
MIT License
722 stars 289 forks source link

Attribution can disappear when map getBounds( ) return out range values #229

Closed sinaru closed 8 years ago

sinaru commented 8 years ago

Steps to reproduce the error:

  1. Go to near meridian
  2. Be in a zoom level that is around 16
  3. Scroll left

What happens is since map.getBounds() can return an out of range longitude value from leaflet behavior as noted in https://github.com/Leaflet/Leaflet/issues/1885, the attribution value will be set as empty on these occasions.

Check the method definision _update_attribution and how getBounds( ) is used.

I was expecting to use wrap( ) method inside _updateMapAttribution so that the bound ranges will be in a valid range.
PS: Take a look at how eaflet-bing-layer do this.

brunob commented 8 years ago

Thx for the bur report, this should be fixed, could you confirm before i release a new tag ?

sinaru commented 8 years ago

Thanks. Works as expected.

brunob commented 8 years ago

Thx for the feedback, version 1.7.0 published.