Skip to content

Extend fitToBounds with a user determined buffer #226

@dannyleech

Description

@dannyleech

The fitToBounds method when called scales the map so that the bounds is displayed as large as possible within the safe zone. This is fine polygons but when displaying points it can be necessary to add some extra padding so that features aren't rendered to close to the edges. For example a bounds object that encompasses two points would place them both near the edge, whereas it would be visiaully better if the were placed some distance from the edge and closer to each other.

This proposal is to extend the fitToBounds methods with an option padding parameter to create the extra margin inside the safezone

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreSits within the core of the interactive map component

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions