1. Home
  2. Docs
  3. GLayer
  4. Map
  5. RealtimeFeatureMap

RealtimeFeatureMap

Example of a RealtimeFeatureMap layer

RealtimeFeatureMap is very similar to the regular FeatureMap layer type. The only difference is that the RealtimeFeatureMap loads feature properties in real-time from an external URL (in specified polling interval) instead of the connected data store.

In addition to Common layer settings, the RealtimeFeatureMap layer type has the following settings:

  • Feature table:
    Name of the table containing feature geometry in the database.
  • Feature ID:
    The primary key of features in the feature table.
  • Data feature ID:
    The foreign key in the main data table linking it to geometry. It should be the same as sourceName settings of the associated field (in the field ID setting).
  • Properties:
    List of properties (db columns in the feature table) each feature should contain. These properties can then be accessed in the paint/layout objects using the Mapbox get function.
  • Feature type:
    One of the compatible Mapbox layer types. Selected layer type will affect which paint and layout properties will be usable in this layer, e.g. if fill type is selected, only properties from Mapbox fill layer will be usable in paint and layout.
  • URL:
    URL of a valid and CORS accessible file that should contain a single array of objects with the same length as the number of features in the project. All properties of the objects are then accessible as properties of the feature at the appropriate index, e.g., the array[{"data1": "text1", "data2": 42}, {"data1": "text2", "data2": 13}] will set feature properties data1 and data2 of two features to the given values.
  • Refresh Interval:
    Number of seconds after which the data should be reloaded from supplied URL.
    Color 1/2/3:
    Colors of the features to display on the layer’s gradient example, from the max color (1) to the min (3). Note that only setting the colors here will not affect the color of features unless also specified in the paint settings.
  • Legend Label:
    Text shown in the center of the layer’s gradient example. Especially useful when multiple gradients are present to differentiate them.
  • Min/Max Legend Label:
    Texts shown on the minimum/maximum of the layer’s gradient example. If not supplied, defaults to “Min” / “Max.”
  • Popup:
    The array of values and their labels shown in the popup. Values can be a combination of any JS functions and the feature’s properties, which can be accessed using the $property$ syntax, e.g., using Math.round($count$) will show the value of a property called count, rounded by JavaScript Math.round function.
  • Popup HTML:
    When used, it replaces the default popup. It allows the usage of the <iframe> tag to show content hosted on an external server. Properties can be accessed through the $property$ syntax, e.g., using $id$will show the value of a property called id. The $property$ syntax can be combined with the <iframe> tag, e.g., <iframe src="server.xyz/yourform?id=$segment_id$"> </iframe>.
  • Field ID:
    The ID of the field that this layer will be filtering when clicked.

Was this article helpful to you? Yes No

How can we help?