Skip to content

Provide a way to do a best fit based on a list of map pins #10718

@smitha-cgi

Description

@smitha-cgi

Description

I have a map with many pins spread across different parts of the country. I want to be able to programmatically zoom in on certain areas so that I can see all pins within a particular region, e.g. 'zoom to best fit all of the pins in Texas'. There does not seem to be any way to do this with the existing MapSpan class - the FromCenterAndRadius does not help as I don't know the center point of my pin list, nor do I know what the radius of all of the pins in the region is.

Public API Changes

List<Pin> pins = new();

<some code here to populate the list of pins however you want>

MapSpan span = MapSpan.FromPins(pins);
map.MoveToRegion(span);

Intended Use-Case

Simple way to zoom in to a particular group of pins on a map

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions