Any easy way to filter results on map by Subject and/or Collection?

3 views
Skip to first unread message

David Levine

unread,
Jul 21, 2016, 10:34:36 PM7/21/16
to Curatescape Users
Hi.

I'm trying to implement a filter so we can just show filtered Stories on the map.  By default, I'd like to exclude certain Stories from appearing if they're in certain Collections.  But I'd really like to be able to toggle on and off display by Subject or Collection.

I'm starting to dig into how to modify the REST call to items/browse with adding search= arguments.  But I can't find decent documentation on how to construct these filters.

Maybe I just need a pointer at the right documentation.

Thanks

Erin Bell

unread,
Jul 22, 2016, 10:03:51 AM7/22/16
to Curatescape Users
Hi David,

Most of the maps are built from data generated by the CuratescapeJSON plugin – not the default Omeka REST API (I think most of the Curatescape code predates that feature). 

You can review the JSON output of any view by adding a query parameter output=mobile-json.

items/browse?output=mobile-json // all items

items
/browse?tags=parks&output=mobile-json // all items tagged "parks"

Note that the map for an individual item (i.e. on items/show.php) is actually generated in that page template and doesn't use CuratescapeJSON.

You'll probably want to dig into the scripts and functions that create the maps for the theme. I'd start with the mh_display_map() function. You'll also want to know how to use Leaflet.js, which is what we use for creating the front-end maps (there are some code comments that say otherwise that need to be updated). 

I'm happy to answer questions about how Curatescape works but I probably won't be able to help much with the map customizations.

Good luck and let me know if you have other questions. Cheers -- Erin


Reply all
Reply to author
Forward
0 new messages