Optional
adapterOptional
attributionOptional
baselayerIndicate on a cartographic base layer.
Optional
clusterOptional
clusterMax zoom to cluster points on
Optional
clusterRadius of each cluster when clustering points
50
Optional
crossParameter added when forming a request for layer data. This is needed if you want to access tile pixel data. Refer to CORS Settings for valid String values.
Optional
dataGeojson data
Optional
featureOptional
fieldsOptional
filterOptional
fitFit map to layer extent
false
Optional
headersOptional
heightOptional
idUnique Layer ID. If not specified, will be added automatically.
If the layer adapter is asynchronous, its id will be assigned only after the promise is resolved. While adapter is loading, methods for obtaining layers will ignore the added layer.
Optional
interactiveOptional
intersectsWKT polygon geometry
Optional
labelOptional
labelOptional
labelOptional
labelShow set label immediately
false
Optional
layersOptional
layoutOptional
limitLimit (paginated) - max number of entities should be taken.
Optional
maxTODO: replace by maxZoom
use maxZoom instead
Optional
maxMaximum zoom level of the map.
Optional
minTODO: replace by minZoom
use minZoom instead
Optional
minMinimum zoom level of the map.
Optional
multiselectIndicates whether several objects can be selected in one layer.
// multiselect: false
layer.select(({ feature }) => feature.properties.color === 'green'); // one feature will be selected
// multiselect: true
layer.select(({ feature }) => feature.properties.color === 'green'); // all 'green' features will be selected
Optional
nameNon-unique name of the layer. Can be used for user interfaces.
Optional
nativeOptional
nativeMap and layer adapter base options Use with care. There may be a conflict in the addLayer method by the adapter of the NextGIS Frontend library
Optional
nativeOptional
offsetOffset (paginated) where from entities should be taken.
Optional
onOptional
opacityLayer transparency. From 0-transparent to 1-visible
1
Optional
orderIndicates the map layers display sequence. A layer with a larger order value overlaps smaller ones. Zero value used to indicate baselayer. If the value is not specified explicitly, it will be assigned automatically with an increase of one for each new layer.
Optional
orderset fields for order
TODO: use typescript 4.1 template string type for map -${field}
{ "orderBy": ["field1", "-field2"] }
Optional
paintDetermine the appearance of the vector data geometries.
const circlePaint = { paint: { color: 'green', radius: 6 } };
const paintCb = (feature) => {
return { color: 'red', opacity: feature.properties.opacity }
}
// Use global paint function
// set paint function inside WebMap static property
WebMap.getPaintFunctions.customPaintFunction = customIconPaintFunction
webMap.addLayer('GEOJSON', {
paint: {
type: 'get-paint',
from: 'customPaintFunction',
options: {}
}
}
Optional
popupOptional
popupOptional
popupOptional
propertiesOptional
propsAny properties to save in layer. May be useful to get additional info from layer event.
Optional
ratioOptional
selectMake the feature selected while mouseover.
Optional
selectableDetermines whether objects are selected by mouse click.
const layer = webMap.addLayer('GEOJSON', {
paint: { color: 'red' },
selectedPaint: { color: 'green' },
selectable: false
});
// programmatically selection - ok, but not on mouse click
layer.select(({ feature }) => feature.properties.id === ID_FOR_SELECT);
Optional
selectedOptional
selectedThe paint that applies to the features after it becomes selected.
webMap.addLayer('GEOJSON', {
paint: { color: 'red' },
selectedPaint: { color: 'green' }
});
Optional
setExperimental option to set the map loading delay when changing position
Optional
sourceOptional
srsExperimental only for Ol yet
Optional
strategyOptional
typeType for geometries painting, for each layer may be only one of: point
, polygon
or line
.
Optional
unselectIf false, the selection will be reset when the user clicks the map.
true
Optional
unselectDeselects layer feature by second click.
Optional
visibilityShow layer on the map immediately after adding. Such layers are always under others. Only one base layer can be displayed on the map at a time.
TODO: replace by show
true
Optional
waitWait until the layer data is fully loaded before allowing added to the map.
If true, addLayer promise resolve only after data loading. This is useful for GeoJson vector layer adapters when you need to process downloaded data before displaying.
Optional
onOptional
onuse onClick instead
Optional
onuse onSelect instead
Optional
onFired when the mouse leaves the layer.
Optional
onFired when the mouse enters the layer.
Optional
onGenerated using TypeDoc
String to be shown in the attribution control. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.