-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Provide a way to do a best fit based on a list of map pins #10718
Copy link
Copy link
Open
Labels
area-controls-mapMap / MapsMap / Mapsproposal/opent/enhancement ☀️New feature or requestNew feature or request
Milestone
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-controls-mapMap / MapsMap / Mapsproposal/opent/enhancement ☀️New feature or requestNew feature or request