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

FeatureMap

Example of a FeatureMap layer

VTFeatureMap layers are another way to visualize feature-based data apart from FeatureMap layers. Just as in FeatureMap layers, each feature is represented as a GeoJson feature (usually a line or polygon). That can be selected or deselected and shows further details when hovered over.

In addition to Common layer settings, the FeatureMap 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 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.
  • Field ID:
    The ID of the field that this layer will be filtering when clicked.
  • Feature type:
    One of the compatible Mapbox layer types. The selected layer type will affect which paint and layout properties will be usable in this layer. For example, if fill type is selected, only properties from the Mapbox fill layer will be usable in paint and layout.
  • Values:
    List of values that should be available for each feature. Values then can be referenced in the popup by using the $valueN$ syntax, e.g., to get the first defined value, you would use $value0$. Values are also added to each feature as a feature property and can be accessed in the pain/layout object using the Mapbox get function. Values setting contains two properties:
    • Values:
      The ID of the field to get values for. Data returned will be selected from the database column according to this field’s sourceName setting.
    • Function:
      Aggregation function to use when calculating data for this dataset.
  • 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>.
  • Use for compare:
    When set to true, this layer will only be visible when the Comparison module is active.
Was this article helpful to you? Yes No

How can we help?