documentation /concept

Map

Concept

Render rows of a table as markers on an interactive geographic map. Use this whenever the user wants to see records placed on a world/regional map.

Outline Display: Show a map of points from {{tab}}, using column {{coordinateColumn}}

Details

Uses Leaflet rendered against a configurable tile server. tileUrlTemplate is the URL pattern of an OSM-compatible XYZ tile server; the default points at the public tile.openstreetmap.org for demo use only and must be replaced with an internal/licensed tile server before shipping. attribution is shown in the corner. initialZoom controls the starting view: set it greater than 0 to use initialLatitude/initialLongitude as the center, or leave it at 0 to auto-fit to the markers (in which case lat/lng are ignored). Markers refresh via the ChangeWatcher when the underlying table changes. Marker popups are rendered as a definition list (<dl>) of column-label/value pairs; all label and value text is HTML-escaped before insertion, so column values containing markup or quotes appear as literal text.

Requirements

The chosen table must declare one column with type: point for the marker location. The tabColumns setting picks which other columns of the table appear in a marker’s popup; supply it as a list of column names. The coordinate column itself must NOT be listed in tabColumns – doing so will fail to compile. To suppress popups entirely, set tabColumns: [].

Local scope

Names introduced within this component’s knobs:

  • tab – table chosen from the app’s schema (via tab knob)

Settings

Required

  • tab : table
    The table whose rows become map markers. Use tabColumns to pick which non-coordinate columns appear in marker popups.

  • coordinateColumn : column of tab (type filter: exactly point; required, non-nullable)
    The column of the chosen table that supplies marker coordinates; must be of type point and must not be included in tabColumns.

Optional

  • tileUrlTemplate : constant value (type: text; required, non-nullable)
    Tile server URL template, e.g. https://tiles.internal/{z}/{x}/{y}.png. Leave empty for no tiles.

  • attribution : constant value (type: text; required, non-nullable)
    Map attribution shown in the bottom-right corner.

  • initialZoom : constant value (type: integer; required, non-nullable)
    Initial zoom level (1=world, 18=street). Leave 0 to auto-fit to markers (initialLatitude/initialLongitude are then ignored).

  • initialLatitude : constant value (type: number; required, non-nullable)
    Initial center latitude. Only used when initialZoom > 0; ignored under auto-fit.

  • initialLongitude : constant value (type: number; required, non-nullable)
    Initial center longitude. Only used when initialZoom > 0; ignored under auto-fit.