In my previous implementation, I created the markers, add to array and add listeners, one at a time. By the time all markers are placed on the map, my arrays are all setup. All is good until I uncheck a checkbox, click on a marker to go to another page, then return to the map by click 'Back' on the browser. In that situation, the checkbox I unchecked remain unchecked which means some markers should not be shown, but all markers are created together with map initilization. Link is as followed.
http://www.strathcona-health.ca/vsb/maps/ourschoolsmap0.7.1.html Then I changed the scripts so that it checks the checkbox's checked status before creating the markers. In the same scenario, the markers will not be shown. But then they cannot be shown again because the array for these markers is not filled. http://www.strathcona-health.ca/vsb/maps/ourschoolsmap0.7.2.html So I searched and tried to use MarkerOptions and store the markers options in the arrays first and then show the markers later. I have changed the property from url to MyUrl in my revised code. Same issue. I used FireBug to confirm the value of MyUrl's are in the array. But how do I get them out? http://www.strathcona-health.ca/vsb/maps/ourschoolsmap0.7.html I'm not sure if I'm going the wrong way by trying to work my way thru js. Or there is something else in Map API that I should look into... Any help would be appreciated. Many many thanks. On Dec 17, 2:24 am, Rossko <[email protected]> wrote: > > 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 > > as per your other thread, the usual way is to create and store the > marker objects themselves(not options) one time only. This allows you > to hide and show them ad infinitum, without recreating. > You can assign custom properties to marker objects, such as a url, > class or identifier, so long as you take care not to clash with an > existing Google property. -- 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.
