mapp.layer.formats.vector()

This module defines the vector format for map layers.

Methods

(inner) clusterConfig(layer)

Configures the clustering options for a layer.

Parameters:
NameTypeDescription
layerObject

The layer object.

Properties
NameTypeAttributesDescription
layer.keystring

The key of the layer.

layer.sridstring

The spatial reference system identifier (SRID) for the layer.

layer.paramsObject

Parameter for data request.

layer.clusterObject

The clustering configuration for the layer.

cluster.distancenumber<optional>

The distance threshold for clustering.

cluster.resolutionnumber<optional>

The resolution threshold for clustering.

cluster.hexgridboolean<optional>

Flag indicating whether to use hexgrid clustering.

(inner) reload(callbackopt)

The layer.reload() method determines the table and geometry for the current zoom level. And uses the layer.params{} to create a request for layer features to be added to the layer source.

The xhr request is debounced by 100ms to prevent requests in quick succession on panning, scroll, and touch zooming.

The reload method is bound to the layer object and doesn't require any arguments.

Finally the optional callback function param will be executed if provided.

Parameters:
NameTypeAttributesDescription
callbackfunction<optional>

Optional callback function.

Properties
NameTypeDescription
layer.paramsObject

Parameter for data request.

layer.timeoutObject

Timeout for the xhr request.

(inner) vector(layer)

Creates Openlayers layer and source for vector format mapp layer.

Parameters:
NameTypeDescription
layerlayer

The Mapp layer object.

Properties
NameTypeAttributesDefaultDescription
layer.sridstring<optional>

The spatial reference system identifier (SRID) for the layer.

layer.paramsObject<optional>
{}

Parameters for the layer data query.

layer.setSourcefunction

Method pass features to layer source.

layer.reloadfunction

Method to reload layer data.

layer.featuresArray<optional>

An array of features for the layer.

layer.fadeboolean<optional>

Flag indicating whether to apply a fade effect to the layer.

layer.clusterlayer-cluster<optional>

Point layer cluster configuration.

layer.sourceObject<optional>

OpenLayers vector source.

layer.stylelayer-style

The mapp-layer style configuration.

layer.zIndexnumber<optional>

The zIndex for the layer canvas element.