-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Ryan Hodges edited this page Oct 14, 2025
·
2 revisions
Welcome to the mp-layers wiki!
Here are the key pieces:
-
- This returns an object containing one key-value pair:
- "top_level_themes": an array of objects representing the themes in their prescribed order
- Each object has these fields:
- "id" - the Theme's primary key in the database
- "display_name" - how the Theme should be labelled in the UI
- "name" - a human-readable, sluggified version of the display name
- "theme_type" - dictates the logic and display of the theme's child LAYERS
- "checkbox" - select and load any number of layers at a time
- "radio" - selecting one layer unselects any other active layers (radio button)
- "" - defaults to 'checkbox' behavior
- "is_visible" - if true, show the theme, if false, hide it. Default to true.
- This returns an object containing one key-value pair:
-
- Returns an ordered list of objects belonging to a Theme, each representing a child, either a Theme or a Layer
- {
- 'id' - the layer or theme's primary key in the database
- 'name' - the display name to be used
- 'metadata' - a link to the layer's metadata if available (if this is a theme, we apply this metadata link to all layer children)
- 'source' - a link to the layer's source if available (not applicable for theme)
- 'data_download' - a link to download the data, if available (not applicable for theme)
- 'kml' - a link to the layer as KML, if available (not applicable for theme)
- 'description' - string with embedded HTML describing the layer or theme with a link to view it in the data catalog
- 'type' - "layer" or "theme"
- If layer:
- 'minzoom' - the furthest out zoom level (lowest: using webmap tile indexing) to display the layer at
- 'maxzoom' - the furthest in zoom level (highest: using webmap tile indexing) to display the layer at
- If theme:
- 'theme_type' - "radio", "checkbox", ""
- 'is_dynamic' - certain themes dynamically load layer records from querying service endpoints rather than relying on our curated database.
- 'url' - an ArcREST endpoint to query for Child Layers (example: "https://oceandata.rad.rutgers.edu/arcgis/rest/services/CAS_VTR_BTSmall")
- 'placeholder_text' : A prompt to print in a field we use for a typeahead search of the dynamically-queried ArcREST layers
- 'default_keyword' : If a user has NOT typed anything into the field to search the ArcREST dynamically loaded layers, we 'pre-query' those layers to show a default selection of layers that are high-level and likely of interest to a broad group of users.
- In the case of our "Fishing - Communities at Sea (by Port) -> Bottom Trawl < 65 ft" dynamic Theme (ID 626 here) the value is 'Total'. We first query for the services using the 'url' value:
- https://oceandata.rad.rutgers.edu/arcgis/rest/services/CAS_VTR_BTSmall/?f=pjson
- This gives us 4 services to display as if they were Themes: 1996-2000, 2001-2005, 2006-2010, and 2011-2015
- If we open '1996-2001' the endpoint becomes: https://oceandata.rad.rutgers.edu/arcgis/rest/services/CAS_VTR_BTSmall/1996_2000/MapServer/?f=pjson
- That gives us 50+ layers, but if we filter those by applying our 'default_keyword' "Total" to their "name" fields, we get a nice subset to show:
-
- That gives us 50+ layers, but if we filter those by applying our 'default_keyword' "Total" to their "name" fields, we get a nice subset to show:
- In the case of our "Fishing - Communities at Sea (by Port) -> Bottom Trawl < 65 ft" dynamic Theme (ID 626 here) the value is 'Total'. We first query for the services using the 'url' value:
- 'theme_type' - "radio", "checkbox", ""
- If layer:
-
To determine how to display the layer (get it's source technology type to infer API, format, etc...) we fall back on the v1 API:
-
Other useful endpoints:
-
/data_manager/get_layer_search_data (also from API v1)
- We use this to populate a typeahead search field
- Returns: An ordered object where each key is a layer's display name, and the value is an object:
- "layer": {
- id
- name
- has_sublayers (legacy, ignore for v2)
- sublayers (legacy)
- }
- "theme": {
- id
- name
- description
- }
- "layer": {
-
/data_manager/get_layer_search_data (also from API v1)