How can I filter google map markers with listboxes?

I want to be able to filter markers on the map using 3 listboxes, each of which may have multiple selections.I haven't found anything on the web about filtering Google Maps as close to what I want as this example with checkboxes.I have borrowed all the code from there, except for the \[code\]show()\[/code\] and \[code\]hide()\[/code\] functions, and made a couple for myself:\[code\]// grabs values of all selected items inside a listbox// pushes them into an array and returns it.// 'listbox' string parameter is mandatoryfunction grabSelectedItems(listbox) { if(document.getElementById(listbox)){ var selectedOptions = []; var listBoxInstitutions = document.getElementById(listbox); for(var i = 0; i < listBoxInstitutions.options.length; i++) { if(listBoxInstitutions.options.selected) { selectedOptions.push(listBoxInstitutions.options.value); } } return selectedOptions; } alert(listbox + " couldn't be found");}// uses 'grabSelectedItems()' to get selected values// from multiple listboxes, puts the returned arrays into// one, big array and returns it.// accepts minimum 1 string parameter(mandatory) or more// treating each parameter as the name of a listboxe// to grab selected values fromfunction grabAllSelectedItems() { if(arguments.length > 0) { var allSelectedOptions = []; for(var i = 0; i < arguments.length; i++) { allSelectedOptions.push(grabSelectedItems(arguments)); } return allSelectedOptions; } alert("Please pass at least one string parameter");}\[/code\]And for now I use it to return the big array of selected values when the input button with id of \[code\]filter\[/code\] is clicked:\[code\]$(function() { $("#filter").click(function() { grabAllSelectedItems('listbox1', 'listbox2', 'listbox3'); });});\[/code\]But I'm stuck now and can't figure out how to plot the markers based on my selections in the listboxes.I have this one big XML file that contains all the data and I want to use it to generate and plot the markers on the map based on what I've selected in the listbox(es). All markers have lat and lng coords, but these markers also contain these sub-markers that also have their own lat and lng coords. I've done it this way because their information is interconnected.Anyone done something like this before?
 
Back
Top