How to get bounds from map?

Hi,

How to calculate area, or get bounds from map?

I need to insert markers depending on the area the map is currently covering. So I need the bounds (north east: lat, lng and south west: lat, lng).

How can I get these values?
In case it is not possible, it would be necessary to be able to calculate based on the latitude and longitude of the location point, plus the zoom value, plus the width and height of the map … !! … a little complex!

Thank you all.

If you google “how wide is zoom level 1 google maps” or something’s similar you will find your answer.

Here is one promising result

https://wiki.openstreetmap.org/wiki/Zoom_levels

1 Like

Thank you @jared for your answer.

It looks like it won’t be easy.

When working with maps, bounds are one of the basic and necessary information.

I realized now that the user cannot move the map.
No matter how much I try to move my fingers, it always returns to its original location! … is it supposed to be like this?

I think this has to do with using a API for google maps vs an embedded map or a custom coded map insertion.

The api is complicated but this would be a good feature request. Are you familiar with how to do those?

Seems like it asks for a starting reference point. And it snaps back to that location. One way I worked around is to update the map location after each click. But that could be annoying.

It seems that after all it allows the user to move the map, but only after giving permission for the APP to access the location …

If you do not like the google map component, you could do extra work to embed a mapquest map. It may have the features you need.

Alternatively studying the google maps api and learning how to master it could help. It’s a beast.

Again, I recommend submitting either a bug report or a feature request on the github.

:+1:

I’m trying to do the same thing, show x markers depending on the zoon level (farther away, less markers). If only there was a block where you could get the current zoom level, it would be very easy, but you can only get latitude and longitude data.