Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JS methods to get current center and zoom values #35

Closed
lindseydiloreto opened this issue Jul 25, 2021 · 2 comments
Closed

Add JS methods to get current center and zoom values #35

lindseydiloreto opened this issue Jul 25, 2021 · 2 comments
Labels
Feature Request New feature or request
Milestone

Comments

@lindseydiloreto
Copy link
Collaborator

If a front-end map has been moved or zoomed by the user, we may need to know the current center coordinates and zoom level. It's already possible to get this information, but it's a little ugly...

let map = googleMaps.getMap('MAPID');
let center = map._map.center;
let zoom   = map._map.zoom;

We should add a couple of methods to make this a little more intuitive...

let map = googleMaps.getMap('MAPID');
let center = map.getCenter();
let zoom   = map.getZoom();
@lindseydiloreto lindseydiloreto added the Feature Request New feature or request label Aug 16, 2021
@lindseydiloreto lindseydiloreto added this to the 4.1.x milestone Sep 17, 2021
@lindseydiloreto
Copy link
Collaborator Author

Similarly, we should elevate getBounds...

// Wrapper for `map._map.getBounds()`
let bounds = map.getBounds();

@lindseydiloreto
Copy link
Collaborator Author

This is done, and will be available in v4.1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant