Layers
Layers provide a way to style and organize the markers associated with source records. Markers can be targeted using attributes and values defined in the records.
Creating a Layer
To create a layer, click theĀ New Layer button
Editing a Layer
Title
The layer title can be any arbitrary string of text and is only used in the UI
Target
The layer target is a JavaScript expression which should evaluate to eitherĀ true
or false
. Upon saving a layer, the target is evaluated against every source record in order to associate records with the layer.
The constant record
is exposed to the target expression and can be used to filter records based on source data. For example, lets say this is what our source records look like (represented as a table to save space):
School | Grade | Id |
THE | 1 | 1 |
THE | 1 | 2 |
DEE | 2 | 3 |
DEE | 3 | 4 |
THE | 3 | 5 |
DEE | 5 | 6 |
// Matches records where Grade is equal to 1. (2 records)
record['Grade'] == '1'
// Matches records where School is equal to THE. (3 records)
record['School'] == 'THE'
// Matches records where Grade is equal to 1, 2, or 3. (5 records)
['1','2','3'].includes(record['Grade'])
// Matches records where School is equal to LRE. (0 records)
record['School'] == 'LRE'
Children
Layers can nested by dragging and dropping them in to the parent layer's children container.
No Comments