OK Guys. Thank you very much for the help. There's always one thing after
another, right. So the custom overlay is now underneath the markers. I'm
trying to make all checkboxes work perfectly between clicks. Here's what I
have.
I load all arrays with data using MarkerOption.
...
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);
} else if ....
...
Then i tested the checkbox and set the markers
...
// set markers
function setMarkers(locations) {
for (i = 0; i < locations.length; i++) {
var marker = new google.maps.Marker(locations[i]);
setListeners(marker, locations[i]);
//
}; // end for statement
};// end function
...
Then I try to set a listener for every marker.
...
// set listeners
function setListeners(marker, location) {
google.maps.event.addListener(marker, 'click', function () {
window.open(location[7]);
});
};// end of function
...
And of course it fails to open any page. How do I get the urls from the
array of map option?
Besides, if I call the setmarkers function every time the corresponding
checkbox is checked, would a whole new bunch of listeners be created again?
On Thu, Dec 15, 2011 at 2:24 PM, Johnny K Lo <[email protected]> wrote:
> OMG. It worked. I was pointing to the wrong file. Setting it to false
> fix the stacking and title error. Thank you very very much!
>
>
> On Thu, Dec 15, 2011 at 2:18 PM, Johnny K Lo <[email protected]> wrote:
>
>> Just tried. Have it set to false. it doesn't seem to change anything
>> regarding title and stack order...
>>
>>
>> On Thu, Dec 15, 2011 at 11:58 AM, Rossko <[email protected]>wrote:
>>
>>> Have you tried your markers non-optimized?
>>>
>>> http://code.google.com/apis/maps/documentation/javascript/reference.html#MarkerOptions
>>>
>>> --
>>> 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.
>>>
>>>
>>
>
--
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.