uidaholib / collectionbuilder-cdm-template

template used to build digital collection sites at University of Idaho Library
https://www.lib.uidaho.edu/digital/
MIT License
3 stars 8 forks source link

map clustering #59

Closed evanwill closed 5 years ago

evanwill commented 5 years ago

add from Queered branch

evanwill commented 5 years ago

@owikle @dcnb added map clustering draft in branch map-cluster.

You can tweak the size of clusters using theme.cluster-radius (from about 80 to 10ish). Also I have it with option singleMarkerMode: true, so single markers are the same green as clusters, otherwise singles go back to the default pins--not sure which I like better.

Problem is using it half-breaks the search, since search still works but only non-clustered items are clickable to popup (because the cluster takes the markers out of the layer so there is nothing there to pop up). Might be okay to remove search, but add filtering by category using https://github.com/maydemirx/leaflet-tag-filter-button instead?

evanwill commented 5 years ago

discussion: make cluster or search a config option. Default is cluster. Search can be turned on, which turns off cluster.

evanwill commented 5 years ago

@dcnb @owikle big update to map-js merged into master 4becd19ad3a62bcaad39720cc9976588c6bdecca

makes clustering and search optional features configured in theme.yml. for regular collections you can have both on. For big collections (cccidaho, etc), turn cluster on and search off for best performance.