@vcmap/core
    Preparing search index...

    Class VectorLayer

    the vector layer is the standard layer to display vector features on the map. mostly, a specialization is used to load data from a certain source, e.g. GeoJSONLayer, FlatGeobufLayer, etc. But it can also be used as a generic layer to add features to, mostly at runtime.

    This layer ignores the mapLayerTypes configuration by default, as it is mostly used to display user data. Be sure to configure this otherwise if needed and reset the default when extending this class to implement a layer for a specific data source.

    Hierarchy (View Summary)

    Implements

    Index

    Accessors

    • get className(): string

      Returns string

    • get exclusive(): boolean

      Indicates, that this layer is part of an exclusiveGroup

      Returns boolean

    • get exclusiveGroups(): (string | symbol)[]

      An array of arbitrary exclusive groups

      Returns (string | symbol)[]

    • set exclusiveGroups(groups: (string | symbol)[]): void

      Parameters

      • groups: (string | symbol)[]

      Returns void

    • get headers(): Record<string, string> | undefined

      directly manipulating the headers Object will not trigger a reload. Reload the data via layer.reload() manually.

      Returns Record<string, string> | undefined

    • set headers(headers: Record<string, string> | undefined): void

      Parameters

      • headers: Record<string, string> | undefined

      Returns void

    • get hiddenObjectIds(): string[]

      Returns string[]

    • set hiddenObjectIds(hiddenObjectIds: string[]): void

      Parameters

      • hiddenObjectIds: string[]

      Returns void

    • get ignoreMapLayerTypes(): boolean

      Returns boolean

    • set ignoreMapLayerTypes(value: boolean): void

      if set to true, the layer types of the map will be ignored when checking if the layer is supported. Changes will call reload on the layer.

      Parameters

      • value: boolean

      Returns void

    • get initialized(): boolean

      True if this layer has been initialized, typically after its first activation.

      Returns boolean

    • get locale(): string

      returns the currently set locale. Can be used to provide locale specific URLs.

      Returns string

    • set locale(value: string): void

      sets the locale and reloads the layer the if the URL is a locale aware Object.

      Parameters

      • value: string

      Returns void

    • get mapNames(): string[]

      Returns string[]

    • set mapNames(mapNames: string[]): void

      if provided, the layer will only be shown in the given MapNames. An empty array will show the layer in all configured maps. Changes will call reload on the layer.

      Parameters

      • mapNames: string[]

      Returns void

    • get url(): string

      A layers url, should on be configured, else an empty string

      Returns string

    • set url(url: string | Record<string, string>): void

      Parameters

      • url: string | Record<string, string>

      Returns void

    • get zIndex(): number

      Returns number

    • set zIndex(index: number): void

      Parameters

      • index: number

      Returns void

    Constructors

    Methods

    • Protected

      Changes features which use the layers style or if the layers style is a declarative style so they are re-rendered

      Returns void

    • Activates this layer object, i.e. changes its internal view state and updates the map. The returned promise resolves, once the layer & any _implementations are initialized and all data is loaded. Once the promise resolves, the layer can still be inactive, if deactivate was called while initializing the layer.

      Returns Promise<void>

    • add features to the vector layer and return an array with their ids. The geometry will be mutated and transformed to EPSG 3857 mercator coordinate system features will be added an id, if they do not already have one.

      returns the ids of the added features. if a feature has an id and the same id is alread in the layer, it will not be added.

      Parameters

      • features: Feature<Geometry, { [x: string]: any }>[]

      Returns (string | number)[]

      mechanism to enforce XYZ coordinate layout for internal usage

    • destroys all current implementations and recreates the ones which have an active map. called for instance when the URL for a layer changes

      Returns Promise<void>

    • returns an feature if found, otherwise null feature geometries are always in EPSG 3857 mercator coordinate system

      Parameters

      • id: string | number

      Returns Feature<Geometry, { [x: string]: any }> | null

    • returns an array with features Feature geometries are always in EPSG 3857 mercator coordinate system

      Returns Feature<Geometry, { [x: string]: any }>[]

    • returns an array with features feature geometries are always in EPSG 3857 mercator coordinate system

      Parameters

      • ids: (string | number)[]

      Returns Feature<Geometry, { [x: string]: any }>[]

    • Returns the configured Extent of this layer or tries to calculate the extent based on the current features. Returns null of no extent was configured and the layer is void of any features with a valid geometry.

      Returns Extent | null

    • is called from the map when the map is activated, and this layer is in the layerCollection of the map. Will create an implementation if it does not exits and will forward the activation call to the implementation.

      Parameters

      Returns Promise<void>

    • is called from the map when the map is deactivated, and this layer is in the layerCollection of the map. will forward deactivation call to the map specific implementation

      Parameters

      Returns void

    • removes features from the vector layer

      Parameters

      • ids: (string | number)[]

      Returns void

    Properties

    _defaultStyle: StyleItem
    _headers?: Record<string, string>
    _supportedMaps: string[] = ...

    The class names of the supported maps.

    _url: string | Record<string, string> | undefined
    "[moduleIdSymbol]"?: string
    activeOnStartup: boolean
    copyright: CopyrightOptions | undefined
    datasourceId?: string

    Optional Id to synchronize with the vcPublisher Datasources. This can also be used to track a connection to other sources of data.

    dontUseTerrainForOblique: boolean
    exclusiveGroupsChanged: VcsEvent<(string | symbol)[]>

    event raised if the exclusives group of the layer changes. is passed the array of exclusive groups as its only argument

    extent: Extent | null
    featureProvider: AbstractFeatureProvider | AbstractAttributeProvider | undefined

    An optional feature or attribute provider to provide or augment features on click events.

    featureVisibility: FeatureVisibility

    FeatureVisibility tracks the highlighting and hiding of features on this layer

    hasFeatureUUID: boolean = false

    A flag to indicate, whether the features in the layer have a UUID, allowing certain interactions, e.g. hidding its features in plannings

    highlightStyle: VectorStyleItem | undefined
    isDestroyed: boolean
    isDynamic: boolean

    If true, the cesium synchronizers are destroyed on map change

    mapNamesChanged: VcsEvent<string[]> = ...
    maxResolution: number | undefined
    minResolution: number | undefined
    name: string

    unique Name

    projection: Projection
    properties: Record<string, unknown>
    source: VectorSource = ...
    splitDirectionChanged: VcsEvent<SplitDirection> = ...

    raised if the split direction changes, is passed the split direction as its only argument

    stateChanged: VcsEvent<LayerState>

    Event raised, if the layers state changes. Is passed the LayerState as its only parameter

    styleChanged: VcsEvent<StyleItem> = ...

    An event, called when the style of the layer changes. Is passed the new style item as its value.

    vectorClusterGroupChanged: VcsEvent<{ newGroup?: string; oldGroup?: string }> = ...
    vectorProperties: VectorProperties
    zIndexChanged: VcsEvent<number>

    Called when the zIndex of this layer is changed. Is passed the new zIndex as its only argument.