mariusandra / pigeon-maps

ReactJS Maps without external dependencies
https://pigeon-maps.js.org/
MIT License
3.45k stars 143 forks source link

A feature to automatically fit the map's bounds to center and display all markers #62

Open aorumbayev opened 5 years ago

aorumbayev commented 5 years ago

First of all, great implementation, just removed a redundant google maps component and this pigeon is blazing fast !

I was wondering if there is an ability to automatically fit all the markers and center the map such that user could see all markers on a map with appropriate zoom level ?

mariusandra commented 5 years ago

Hey, see this issue for a sample solution: https://github.com/mariusandra/pigeon-maps/issues/23

Ideally this code could be brought onto the pigeon maps website as a button to click to give it more visibility than in a closed issue.

Anybody up for the task?

Since this implementation requires importing a few external libraries, it will not be part of pigeon-maps itself. An even better approach would be to extract the relevant code into one independent utility function...