Link to home
Start Free TrialLog in
Avatar of Evan Cutler
Evan CutlerFlag for United States of America

asked on

google map boundaries

Greetings,
quick question...

I know how to get the corner lat/longs for a google maps window boundary...
How do I get the top/bottom/left/right?  I want to query against a database for markers after the map moves.

Thanks.
Avatar of aumudin
aumudin
Flag of United States of America image

https://developers.google.com/maps/articles/toomanymarkers?hl=en

Go down to the "Viewport Market Managment"

You will get an object back that lets you query the NorthEast and SouthWest points. They have something similar on all platforms.
Avatar of Evan Cutler

ASKER

ok...I need you to help me bridge the gap here.
I have about 40,000 items with lat and long columns...
I need to do a query based on viewport and return markers from that query.
The site is good, but no physical code to work from.
Help?
It will be hard to help you with code without first seeing what your doing currently and what your ultimately wanting to do.

But basically find out what your north east and south west lat/long is. From here you will be able to easily find out your four corners. From there you can query your database something like:

Where dblat < nelat and dblat > selat  and dblog > swlog and dblog < nelog   from there youll get your list and can plot them with the api like normal.

I dont know if this helps you any! :(
ASKER CERTIFIED SOLUTION
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This was what I needed...thanks much my friend.