Map

The Map widget displays an object set or object data as a configurable, interactive, geospatial visualization. This widget shares many core capabilities with the Map application. For more details on layer configuration and interacting with complex geospatial data, see the Map documentation.

Map visualizations are comprised of three types of layers:

  • Base map: Also called a base layer, this layer provides the background map imagery.
  • Object layers: Represent object data as points or shapes on top of the base layer.
  • Overlay layers: Preconfigured views of geospatial datasets that can be reused across maps.

The Map widget supports map rendering with MapboxGL ↗. If WebGL is not supported in a user’s browser, consider using the Map [Legacy] widget.

Below are some examples of maps with various layer configurations:

Four examples of maps with different layer configurations.

Layers

Users can configure the map object layers using two different options:

  • Local configuration (recommended): build and modify the contents and style of the map within the Workshop widget editor

  • Import map template: select an existing map template resource to use in your module, and map variables to the corresponding input parameters.

Local configuration

In the widget editor, select Add object layer to add a new layer to the map. Then, open the newly created layer, and create a new object set variable or reuse an existing one under Input object set. Once added, the new object layer will populate on the map.

With local configuration, layer settings can be completely controlled from the widget editor:

  • Input
    • Label: Rename the layer display title by editing this text field.
    • Selected objects: Specify an object set variable that represents the collection of selected objects in a layer in the Map widget. This variable is bidirectional and can either be used to update the layer's selected objects, or it can respond to and adopt object sets that a user selects from the map.
    • Layer visibility: Control whether the contents of the layer are visible or hidden in the map. This setting can be configured as a static value or a boolean variable.
    • Lock layer: Toggle whether or not the layer is locked. Objects in locked layers cannot be selected by users.
  • Style
    • From the Style section, users can configure the default color, opacity, and label/tooltip settings for a layer. For more information about these options, see the layer style section from the Map application documentation.
  • Geometry
    • Under the Geometry section, a user can edit the styling for a specific geometry displayed on the map. Like in the Map application, geometries are different ways of representing the layer's objects.
    • Geometries can be added by selecting Add geometry. Reorder geometries by dragging them from the left side of their labels, and delete them by selecting the trash icon when hovering over a geometry.
    • Loading methods [beta] can also be configured under the Geometry section for supported geometry types.
  • Legend visibility
    • An object layer and its geometries are visible by default in the legend panel of the map. Under the Legend visibility section, you can toggle the visibility of the entire layer or individual geometries.

In addition to object layers, the local configuration editor also allows users to add overlay layers. These overlays are created in the map layer editor.

The base layer picker controls the default background map imagery. When the Show base layer picker toggle is enabled, users can edit the base map from the Map widget interface.

The 'Show base layer picker' toggle below the base map configuration.

Import map template

For information about using an existing resource to configure a Map widget, see how to embed a map template in a Workshop module.

Interactions

  • Draw options: Configure which shape drawing tools will be available in the toolbar.
  • Shape output type: Control whether the GeoJSON string output of the drawn shapes variable and selected shape variable are represented as a GeoJSON feature or geometry collection.
  • Drawn shapes: A bidirectional string variable that reflects the shapes drawn within the map interface as a GeoJSON string.
  • On drawn shape: Configure Workshop events to trigger when a shape is drawn in the map.
  • Enable single draw mode: Limit users to only draw one shape at a time on the map interface, automatically removing the previous shape when a new one is drawn.
  • Enable geo-spatial object search: Allow users to search the Ontology using a drawn shape.
  • Enable splitting on antimeridian: Control whether shapes that are drawn across the antimeridian will be split into separate polygons.
  • Selected shapes: A bidirectional string variable that reflects the shapes selected on the map interface as a GeoJSON string.

Time configuration

  • Enable timeline: Display the timeline panel at the bottom of the map interface.
  • Allow user to change selected time: Enable user control of the selected time cursor in the timeline panel.
    • Enable user facing live mode toggle: Enable the View latest option in the timeline panel.
  • Selected time: Control the selected time using a Workshop variable of type Timestamp or Date.
  • Time window: Control the time window using two Workshop variables of type Timestamp or Date.
  • Playback state: Use a boolean variable to control whether the timeline is playing or paused.
  • Playback position: Output the current playback time (in milliseconds) as a numeric variable.
  • Auto pause at: Use a timestamp array variable to automatically pause playback at specific times.

Interface

  • Legend: Display the legend panel in the map interface.
  • Collapse legend panel: Collapse the legend panel by default when the map is first opened.
  • Panel size: Choose whether the legend panel should be displayed in full size or in a compact manner.
  • Enable search around: Enable search arounds using the toolbar and context menu.
  • Enable advanced selection tools: Enable selection tools in the toolbar and context menu.
  • Show selection panel: Display the list of currently selected objects or a selected object's details in a panel in the Map widget interface.
  • Viewport auto zoom: Control the zooming behavior of the Map widget.
    • Object set: Centers the map on the content of the given object set.
    • All objects: Centers the map on all objects added to the Map widget
    • Only update if outside viewport: Restrict auto zooming behavior to instances where the target objects are completely outside of the current viewport
  • Viewport bounds: This setting is a bidirectional string variable where the GeoJSON value represents the current viewing window of the map.
  • Viewport follow object set: Provide an object set that the map window will keep centered as the objects' locations change with the selected time.
  • Enable transition to full Map application: Allow users to open the Map application from the widget, using their current state.