Reputation: 686
Is it possible to have checkbox on google map marker? So user can check some markers and then display details of checked places. Thank you
Upvotes: 0
Views: 915
Reputation: 4363
You can toggle the image like this:
marker = new google.maps.Marker({
map:map,
icon: blueIcon,
draggable:true,
animation: google.maps.Animation.DROP,
position: parliament
});
google.maps.event.addListener(marker, 'click', changeIcon);
function changeIcon() {
if (marker.icon != redIcon) {
marker.setIcon(redIcon);
} else {
marker.setIcon(blueIcon);
}
}
Fiddle: http://jsfiddle.net/Mxwxt/7/
The alternative would be to create a custom overlay which can contain markup
Upvotes: 2