Skip to content
Ryan Hodges edited this page Oct 14, 2025 · 2 revisions

Welcome to the mp-layers wiki!

Quick and Dirty API

Here are the key pieces:

  • /layers/top_level_themes/

    • 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.
  • /layers/children/<theme_id>

    • 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.
  • 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
        • }
Clone this wiki locally