MapBoxGL custom layer showing DataSet elements on the map.
Extends Base
(Object)
configuration object for this class
| Name | Description |
|---|---|
options.dataSet String
|
the DataSet instance associated with this layer |
options.layerId String
|
unique identifier of this layer; if this parameter is not defined then the identifier of the underlying DataSet is used instead. |
options.syncGeo Boolean
|
this flag defines if the currently applied bounding box (visible zone of the map) should be used to filter search results |
options.onSelect Function
|
optional method called when a new feature
is selected. This method can be used to center the map on the feature and return back
when the selection is canceled (when the
intent
is finished).
See
MapBoxGL#flyTo
method.
This method recieves a parameter object with the following fields:
|
options.feature Object
|
configuration for features |
options.feature.style Object
|
styles DataSet features |
options.feature.style.basic Object
|
styles for non-selected features |
options.feature.style.selected Object
|
styles for selected features |
options.feature.style.hover Object
|
styles for hovered features |
options.feature.popup Object
|
popups definitions |
options.feature.popup.selected Function
|
method rendering the popup for selected features |
options.feature.popup.hover Function
|
method rendering the hover popups |
options.cluster Object
|
configuration for clusters |
options.cluster.style Object
|
styles for clusters |
options.cluster.style.basic Object
|
non-selected cluster styles |
options.cluster.style.selected Object
|
styles for selected clusters |
options.cluster.style.hover Object
|
styles for hovered clusters |
options.cluster.popup Object
|
popups definitions |
options.cluster.popup.selected Function
|
method rendering the popup for selected clusters |
options.cluster.popup.hover Function
|
method rendering the hovered clusters |
The underlying map instance managing this layer.
Type: mapboxgl.Map
The DataSet associated with this layer
Map context synchronizing interactions with layers.
Type: MapContext
Returns an URL for map glyphs. This URL is used to replace the default map glyph URL.
Type: String
This flag defines if the map bounding box should be synchronized with search results.
Type: Boolean
Minimal timeout between two bounding box updates.
Type: Integer
Adds this layer to the given map.
(mapboxgl.Map)
the map where this layer should be added
(...any)
DataSetMapLayer:
this layer
This method is called by the MapBoxGL instances when this layer is added to the map.
(mapboxgl.Map)
This method is called by the MapBoxGL instances when this layer is removed from the map.
(mapboxgl.Map)
(any)
Render method called by MapBoxGL
(any)
(any)
Contains keys of events used by DataSetMapLayer and MapContext classes.
Intents associated with this key are used to notify about map changes like map movements or zoom level changes. See MapContext
Intents with this key are fired on all interactive layers to notify that there are hovered features belongings to this layer.
Intents with this key are fired on all interactive layers to notify that user clicked on features belongings to this layer.
Notifies that a MapContext instance is destoroyed.
Notifies that a MapContext changes the URL for glyphs.
Notifies that a DataSetMapLayer is added to the map. This intent is resolved when the layer is added and all associated information is loaded from the server.
Notifies that a DataSetMapStyles object was reloaded.
Utility class managing MapBoxGL styles for DataSet. It uses a vector tile URL to generate sources and the corresponding MapBoxGL layers with styles descriptions. Selected and hovered GeoJSON items are used to dynamically generate GeoJSON sources and provide the corresponding visualization layers.
Extends Base
(Object)
configuration object for this class
| Name | Description |
|---|---|
options.map String
|
mandatory MapBoxGL instance |
options.tilesUrl String
|
URL of vector tiles used for this layer |
options.before String
|
optional ID of an existing layer to insert DataSet-related layers before; if this parameter is not defined (or null) then DataSet-related layers are added on the top of the map |
options.feature Object
|
styles for features |
options.feature.default Object
|
default feature styles |
options.feature.selected Object
|
styles for selected features |
options.feature.hovered Object
|
styles for hovered features |
options.cluster Object
|
styles for clusters |
options.cluster.default Object
|
default cluster styles |
options.cluster.selected Object
|
styles for selected clusters |
options.cluster.hovered Object
|
styles for hovered clusters |
options.getIconsFont Function
|
this function takes the name of the IconSet and return the corresponding font name; This font name is used to access to MapBoxGL glyphs. See MarkerBuilder . |
options.getIconChar Function
|
this function takes two parameters: the name of the IconSet and the logical icon name. It returns the the character corresponding to the given icon. This character is used to reference the icon glyph. See MarkerBuilder . |
(String)
mandatory layer identifier; used to generate identifiers
for MapBoxGL sources and layers
```
const styles = new DataSetMapStyles({
// Unique layer identifier; used to generate MapBox GL layers and styles
layerId : 'foobar',
// Styles for features
feature : {
default : { type : 'Marker', ...},
selected : { type : 'Marker', ...},
hovered : { type : 'Marker', ...},
},
// Styles for clusters
cluster : {
default : { type : 'Marker', ...},
selected : { type : 'Marker', ...},
hovered : { type : 'Marker', ...},
},
});
// Highlight a hovered feature
styles.setHoveredFeature('e9b36004-1227-4743-813e-36a8d31e0b47');
// Highlight a hovered cluster
styles.setHoveredCluster(123);
```
The underlying MapBoxGL map.
Type: mapboxgl.Map
Returns the identifier of the layer before DataSet layers. This field can be empty.
Sets a new selected feature.
(GeoJSON)
the selected feature; it should have the same
fields as the fields returned by vector tiles; if this parameter is
null
or not defined then selection is removed
Removes all DataSet-related sources and styles from the underlying map.
Prepare data sources and styles and injects them in the underlying MapBoxGL instance using the map API.
A context associated with a MapBoxGL instance. It allows to synchronize / operations initialized by different layers. For example it allows to show just one popup corresponding for a specific key (ex: popups for hovered features and popups for selected features).
Extends Base
Returns a MapContext instance corresponding to the specified MapBoxGL object.
(any)
Debounce timeout for map hovering effect. By default it is 20 ms.
Type: Integer
MapBoxGL instance providing access to the map functionality
Map information like center coordinates, zoom, pitch, bearing and bounding box.
Type: Object
Shows popup and returns an intent allowing to close this popup. Each popup
is associated with a key. All popups having the same keys are shown
exclusively - just one at time. So the map can have multiple popups at time
only if all of them have different keys. This method returns an Intent
allowing to control the visibility of the popup. If the popup is closed
then the hanlded field in the intent is true. The end method of this
intent allows to explicity close the popup.
(Object)
popup options
| Name | Description |
|---|---|
options.key String
|
key (type) of the popup; by default it is 'popup' |
options.lngLat Object
|
the geographic location of the mouse; this object contains "lat" and "lng" fields with the latitude and longitude of the mouse position |
options.content (String | HTMLElement)
|
the content to show |
Intent:
allowing to close the popup using the intent.end() method.
Sets a new bounding box where the map should zoom.
(any)
Registers layer groups. The given object contains group names with the corresponding list of layer identifiers defining the group. This method uses MapContext#addLayerGroup method internally.
(Object)
map containing group names with the corresponding
layer identifiers
Registers multiple layers as a unique group. This class manages hovering and click actions on specified layers as a single group. So if mouse moves from one layer to another from the same group this class considers that in the same group and don't fires a new notification.
(any)
(any)
Sets a new layer group. If there is already a group with such an ID then this method removes it and after that registers multiple layers as a unique group. Internally this method uses the MapContext.removeLayerGroup and MapContext.addLayerGroup methods.
(String)
identifier of the group
(any)
Array<String>:
list of layer identifiers removed from the group
Creates and returns a new HTML element with the specified name.
(any)
HTMLElement:
Gets the layer and features corresponding to the specified mouse event and notifies this layer about activated features.
(String)
key of the intent used to notify layers
(String)
name of the field in this instance where the intent
should be stored.
(Object)
MapBoxGL event containing coordinates
Intent:
if there is a layer with features for this event
Common super class for other types of builders.
Cluster-specific marker builder. It uses the same attributes as the MarkerBuilder class and it adds additional filters to select only cluster points from vector tiles.
Extends Builder
Transform high-level marker styles to a set of "low-level" MapBoxGL styles.
Extends Builder
(Object)
builder parameters
| Name | Description |
|---|---|
options.getIconsFont Function
|
this function takes the name of the IconSet and return the corresponding font name; This font name is used to access to MapBoxGL glyphs. |
options.getIconChar Function
|
this function takes two parameters: the name of the IconSet and the logical icon name. It returns the the character corresponding to the given icon. This character is used to reference the icon glyph. |
This method parses the given string and returns the corresponding array with resulting values.
(String)
the string to parse
(Object
= newListener())
a listener object containing the following methods:
Array:
with resulting filter