javascript - Google maps show and hide markers using checkboxes -


how show , hide markers using javascript , google maps?

i use checkboxes show , hide markers, @ minute have 2 markers , 3 checkboxes. 1 show , hide , others show , hide each marker. not sure how connect them checkboxes , show/hide them respectively.

sample of marker using:

 var jorvik = createmarker({        position: {lat: 53.95697, lng: -1.08100},   map: map,       icon: 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png'},             "<h1>jorvik viking centre</h1><p>this home marker.<br/>test</p>"); 

codepen: https://codepen.io/mike43237/pen/qmevle

you can use setvisible(true/false) method markers working fiddle

see togglegroup() function


Comments

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -