Skip to content

fitBounds with padding zooms the map really far out #4528

@theashyster

Description

@theashyster

I am not sure if this is a regression or not, but I have experienced that since the RC1 release the map fitBounds function with padding option does not work the same way as it worked before.

Some examples:
Leaflet 0.7.5 http://playground-leaflet.rhcloud.com/niv/edit?html,output
Leaflet 1.0.0-beta.2 http://playground-leaflet.rhcloud.com/jasi/edit?html,output
Leaflet 1.0.0-rc.1 http://playground-leaflet.rhcloud.com/cipe/edit?html,output

The padding is just really big and the map is zoomed far out. We have used this function with the padding on layer containing SVG polygon also and since RC1 that also started to act strange by zooming the map really far out.

I can get the same result on RC1 by setting the padding option on a point that is really small L.point(0.001, 0.001).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions