I've been working via the google maps API tutorial, I've got my map
working with encoded polylines and it is all working great.
The last thing I want to add to my map is a search box (geocoding
search box) so that one can find out which sky train or subway station
is closest to their destination.
I just would like a search box that puts the marker on the map...
I have tried to paste into my code the geocoding codes, but I just
dont know enough to place it properly...or if I have a bracket out of
place or what.
This is the code I "think" is what I need:
var map = new GMap2(document.getElementById("map_canvas"));
var geocoder = new GClientGeocoder();
function showAddress(address) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " not found");
} else {
map.setCenter(point, 13);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(address);
Here is a link to a page where I have my map loaded (I have not
inserted the code as I dont have a clue where to put it):
http://www.thailandgentlemenstravelclub.com/googlemaptest.html
Here is the link to my XML. file where I pull the polyline data etc...
if you need to review it:
http://www.thailandgentlemenstravelclub.com/googletestmap.xml
If one of you gurus would be kind enough to tell me or show me or
anything where to put the code for the geocodeing (if I have even got
the right code).
Thanks so much !!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---