Link to home
Start Free TrialLog in
Avatar of rdurban
rdurbanFlag for United States of America

asked on

How do I span a google map api v3 with a text link?

I have a google map that displays multiple markers.  I am centering the map on the center of the zip code or city/state searched.  I am also finding the closest location based on lat/long distance and displaying that in a text string external to the map.

I need to have a link in the text string that will recenter the map on that location.  What is the bes tway to do this?

Thanks!
Rose
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

If you want to post the code you're using for this, I can probably show you how to recenter the map.  I would pass a "center=" argument in the URL (GET) string.  If present, I would use this geocode (lat/lon pair) to center the map.

I have a Google Maps API class that might be useful to you.  Please see the public method "setCenter" in the code here:
https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_3350.html

HTH, ~Ray
Avatar of rdurban

ASKER

Thanks Ray,

I will give that a try.  It will probably be tomorrow afternoon before I am able to work on it again however.

Thanks!
Rose
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
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
Avatar of rdurban

ASKER

Thanks Ray!  It was great!

Rose
Thanks for the points!  It's a great question, ~Ray