I would like to offer two kinds of filtering in my Google Map web page.
Each kind is based on different logic:
- the first is based on the location type “house, building, shopping mall…”
- the second is based on a time stamp “when the user visited this place”.
What I am able to do now is to show or hide the markers according the location type (using check boxes).
My questions are:
1- How can I show or hide the markers according a time stamp? Using a time line or something like.
2- Can I define two categories for one single marker? like this I can show and hide markers using check boxes like in the case of location type?
For example here is the function that I am using to show and hide markers according to location type:
// == shows all markers of a particular location type, and ensures the checkbox is checked ==
function show(category)
{
var markers = oms.getMarkers();
for (var i=0; i<markers.length; i++)
{
if (markers[i].mycategory == category)
markers[i].setVisible(true);
else
markers[i].setVisible(false);
}
// == check the checkbox ==
document.getElementById(category+"Box").checked = true;
}
Thank you
Add a
markers[i].mytimestampproperty to the markerAdd show/hide functions that use that to do what you want.