SourceManager interface

Menedżer źródeł kontrolki mapy. Uwidocznione za pośrednictwem właściwości sources atlasu. Map, klasa. Nie można utworzyć wystąpienia przez użytkownika.

Metody

add(Source | Source[])

Dodaje do mapy co najmniej jedno źródło danych. Mapa musi być gotowa przed dodaniu źródła. Użyj metody map.events.add z typem zdarzenia "ready".

clear()

Usuwa wszystkie źródła z mapy.

getById(string)

Pobiera źródło o określonym identyfikatorze.

getFeatureState(string | Shape | Feature<atlas.data.Geometry, any>, string | Source, string)

Pobiera stan funkcji

getRenderedShapes(string | Source, Expression, string)

Zwraca wszystkie renderowane funkcje kształtu w źródle, które pasują do określonego filtru. Jeśli źródło jest źródłem kafelka wektorowego, należy określić nazwę warstwy źródłowej.

getSources()

Pobiera wszystkie źródła dodane do mapy.

isSourceLoaded(string | Source)

Zwraca wartość logiczną wskazującą, czy źródło jest ładowane, czy nie.

remove(string | Source | Array<string | Source>)

Usuwa jedno lub więcej źródeł z mapy, określając identyfikator źródła lub podając sam źródło.

removeFeatureState(string | Shape | Feature<atlas.data.Geometry, any>, string | Source, string, string)

Usuwa stan lub pojedynczą wartość klucza stanu funkcji.

setFeatureState(string | Shape | Feature<atlas.data.Geometry, any>, string | Source, object, string)

Ustawia stan funkcji, przekazując obiekt pary klucz wartości.

Szczegóły metody

add(Source | Source[])

Dodaje do mapy co najmniej jedno źródło danych. Mapa musi być gotowa przed dodaniu źródła. Użyj metody map.events.add z typem zdarzenia "ready".

function add(source: Source | Source[])

Parametry

source

Source | Source[]

clear()

Usuwa wszystkie źródła z mapy.

function clear()

getById(string)

Pobiera źródło o określonym identyfikatorze.

function getById(id: string): Source

Parametry

id

string

Zwraca

getFeatureState(string | Shape | Feature<atlas.data.Geometry, any>, string | Source, string)

Pobiera stan funkcji

function getFeatureState(feature: string | Shape | Feature<atlas.data.Geometry, any>, source: string | Source, sourceLayer?: string): object

Parametry

feature

string | Shape | Feature<Geometry, any>

identyfikator funkcji

source

string | Source

identyfikator źródła

sourceLayer

string

identyfikator warstwy

Zwraca

object

getRenderedShapes(string | Source, Expression, string)

Zwraca wszystkie renderowane funkcje kształtu w źródle, które pasują do określonego filtru. Jeśli źródło jest źródłem kafelka wektorowego, należy określić nazwę warstwy źródłowej.

function getRenderedShapes(source: string | Source, filter?: Expression, sourceLayer?: string): Array<Feature<atlas.data.Geometry, any> | Shape>

Parametry

source

string | Source

źródło do odpytowania

filter
Expression

filtr, aby ograniczyć zapytanie

sourceLayer

string

warstwa, w której są dopasowywane kształty i funkcje

Zwraca

Array<Feature<Geometry, any> | Shape>

getSources()

Pobiera wszystkie źródła dodane do mapy.

function getSources(): Source[]

Zwraca

Source[]

isSourceLoaded(string | Source)

Zwraca wartość logiczną wskazującą, czy źródło jest ładowane, czy nie.

function isSourceLoaded(source: string | Source): boolean

Parametry

source

string | Source

Identyfikator źródła lub obiektu źródłowego.

Zwraca

boolean

remove(string | Source | Array<string | Source>)

Usuwa jedno lub więcej źródeł z mapy, określając identyfikator źródła lub podając sam źródło.

function remove(source: string | Source | Array<string | Source>)

Parametry

source

string | Source | Array<string | Source>

removeFeatureState(string | Shape | Feature<atlas.data.Geometry, any>, string | Source, string, string)

Usuwa stan lub pojedynczą wartość klucza stanu funkcji.

function removeFeatureState(feature: string | Shape | Feature<atlas.data.Geometry, any>, source: string | Source, sourceLayer?: string, key?: string)

Parametry

feature

string | Shape | Feature<Geometry, any>

identyfikator funkcji

source

string | Source

identyfikator źródła

sourceLayer

string

identyfikator warstwy

key

string

klucz w stanie funkcji do zaktualizowania

setFeatureState(string | Shape | Feature<atlas.data.Geometry, any>, string | Source, object, string)

Ustawia stan funkcji, przekazując obiekt pary klucz wartości.

function setFeatureState(feature: string | Shape | Feature<atlas.data.Geometry, any>, source: string | Source, state: object, sourceLayer?: string)

Parametry

feature

string | Shape | Feature<Geometry, any>

identyfikator funkcji

source

string | Source

identyfikator źródła

state

object

sourceLayer

string

identyfikator warstwy