A google maps problem.

Status
Not open for further replies.

Muzos

Smack-Fu Master, in training
99
I working on a google map and have a bunch of markers with infowindows attached to them. I would like to make a list of links to the markers in the sidebar so when you click a link it goes to the pin on the map and opens the infowindow for for that marker. Any ideas go to go about this? I know nothing about javascript. I assume I need to use a onclick in the link and call the code to open the infowindow. This is where I am getting stumped.

This is the code I am using so the info window opens when I click on a marker:
Code:
	google.maps.event.addListener(marker1, 'click', function() {
	  infowindow1.open(map, marker1);
	});

And this is the site.http://stfudamnit.com/ryan/fluther/maps/

I would like it to function like this. http://econym.org.uk/gmap/example_map15.htm

Thanks in advance.
 

KrispyK

Ars Scholae Palatinae
911
Muzos":21voi11c said:
I know nothing about javascript.

Then i'm afraid you're going to have to start learning!

Code:
      function myclick(i) {
        gmarkers[i].openInfoWindowHtml(htmls[i]);
      }

The way they're doing it in the example, is when they load the marker, they also create the text link. They're then using a couple of global arrays to reference which marker. You're going to have to modify your cm_createMarker() function to do something similar.
 
Status
Not open for further replies.