I think it is better to start a new discussion as the nature of the
problem I have has changed.

I want to be able to control which set of markers to show by using
checkboxes.  Therefore I load them into different arrays using
markerOptions, attempting to place them on the map and add listener to
them one by one.  Not sure if that's the way it should be done but it
seems logical to me.  Nevertheless, I get the markers placed on the
map, but when click on the marker it doesn't open right.  Can't seem
to retrieve the url from the array.  Here's short chunk of my code.
Please help.

For some reasons, it only works in IE, not FF, Chrome or Safari.
Another thing I need to solve...

http://www.strathcona-health.ca/vsb/maps/ourschoolsmap0.7.html

....
    for (var i = 0; i < locations.length; i++) {
        var school = locations[i];
        var myLatLng = new google.maps.LatLng(school[1], school[2]);
        var myMarkerOptions = {
            position: myLatLng,
            map: map,
            icon: image,
            shape: shape,
            zIndex: school[5],
            optimized: false,
            url: '../schoolmap/school.aspx?s=' + school[3],
            title: school[0] + ' at ' + school[4],
            contentinfo: school[0]
        };
        // select which array to push data into
        if (schoollevel == 'e') {
            ElementaryMarkerArray.push(myMarkerOptions);
        }
....
// set markers
function setMarkers(locations) {
    for (i = 0; i < locations.length; i++) {
        var marker = new google.maps.Marker(locations[i]);
        // get
        var url = $('#map_canvas').gmap('option', 'url');
        google.maps.event.addListener(marker, 'click', function () {
            window.open(url);
        });
        //
    }; // end for statement
};// end function

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to