javascript - Showing and hiding groups of markers with Mapbox/LeafletJS -


i'm using mapboxjs build map.

i give geojson object of markers, show no problem.

as each point has category, i'd add control layer checkboxes each category, users can show/hide each category.

i've tried loading each marker individually layer i'm getting mapbox errors.

how should approach this?

thanks in advance.

mei

in end managed write myself.

i created global variable hold categories wanted use, , added category property geojson object. had global markers.

i used l.control add div, wnd looped through categories create checkboxes.

i added event listener inputs, looped through each marker , either added or removed them map (each marker layer), depending on checkbox's value.

details on blogpost http://meigwilym.com/custom-marker-controls-with-mapbox-and-leafletjs/

i don't know if best method, it's thing can working.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -