I need to show a marker for each user that falls within the visible portion of google map. To do so, I get the bounding box from google map, and send it down to the database and I receive a list of users that fall within the box. Then loop through the list of users and place a marker on the map for each user.
All works well, however, if the lat/lng falls just bellow the top border, then only the bottom of the marker is visible. If the lat/lng falls next to the side borders, then only 1/2 of the marker is visible.
One way to tackle this problem is to send a reduced version of the bounding box to the database. This way, you'd have a bounding box with margins, but you don't show anything within the margins.
Now, what is the best way of shrinking down the bounding box before sending it down to the database?
Is there any better way of doing this?
Check the image, 1/2 of the marker is hidden. (top)
Best Answer
First I suggest you to take a look at the docs of the geometry library
Then here are the steps that are recommended:
I think it will be exactly what you need.