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

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -