DataSource class

지도에 표시될 셰이프 데이터를 쉽게 관리할 수 있는 데이터 원본 클래스입니다. 데이터 원본이 맵에 표시되기 전에 계층에 추가해야 합니다. DataSource 클래스는 SymbolLayer, LineLayer, PolygonLayer, BubbleLayer 및 HeatMapLayer와 함께 사용할 수 있습니다.

Extends

생성자

DataSource(string, DataSourceOptions)

지도에 표시될 셰이프 데이터를 쉽게 관리할 수 있는 데이터 원본 클래스입니다. 데이터 원본이 맵에 표시되기 전에 계층에 추가해야 합니다. 클래스는 DataSource , , LineLayer, PolygonLayerBubbleLayer및 와 HeatMapLayer함께 SymbolLayer사용할 수 있습니다.

메서드

add(FeatureCollection | Feature<atlas.data.Geometry, any> | atlas.data.Geometry | GeometryCollection | Shape | Array<Feature<atlas.data.Geometry, any> | atlas.data.Geometry | Shape>, number)

데이터 원본에 셰이프를 추가합니다. GeoJSON 개체는 관리하기 쉽도록 Shape 클래스 내에 래핑됩니다. 필요에 따라 레이어의 다른 도형/기능 간에 기능을 삽입할 인덱스를 지정합니다.

clear()

데이터 원본의 모든 데이터를 제거합니다.

dispose()

이 개체가 사용하는 모든 리소스를 정리합니다.

getClusterChildren(number)

다음 확대/축소 수준에서 지정된 클러스터의 자식 요소를 검색합니다. 셰이프와 하위 클러스터의 조합일 수 있습니다. 하위 클러스터는 ClusteredProperties와 일치하는 속성이 있는 기능입니다.

getClusterExpansionZoom(number)

클러스터가 확장 또는 분리를 시작하는 확대/축소 수준을 계산합니다.

getClusterLeaves(number, number, number)

클러스터 내에 있는 셰이프를 검색합니다.

getOptions()

데이터 원본에서 사용하는 옵션을 가져옵니다.

getShapeById(string | number)

지정된 ID를 사용하여 셰이프를 검색합니다. 지정된 ID를 가진 셰이프가 데이터 원본에 포함되지 않으면 null이 반환됩니다.

getShapes()

DataSource에 있는 모든 셰이프를 반환합니다.

importDataFromUrl(string)

GeoJSON 문서를 다운로드하고 해당 데이터를 데이터 원본으로 가져옵니다. GeoJSON 문서는 동일한 도메인에 있거나 CORS를 사용하여 액세스할 수 있어야 합니다.

remove(number | string | Shape | Feature<atlas.data.Geometry, any> | Array<number | string | Shape | Feature<atlas.data.Geometry, any>>)

데이터 원본에서 하나 이상의 셰이프를 제거합니다. 문자열이 전달되면 ID로 간주됩니다. 숫자가 전달되면 는 해당 인덱스에서 셰이프를 제거합니다.

removeById(number | string | Array<number | string>)

ID에 따라 데이터 원본에서 하나 이상의 셰이프를 제거합니다.

setOptions(DataSourceOptions)

데이터 원본 옵션을 설정합니다. 데이터 원본은 제공된 옵션에 지정되지 않은 옵션에 대한 현재 값을 유지합니다.

setShapes(FeatureCollection | Array<Feature<atlas.data.Geometry, any> | atlas.data.Geometry | Shape>)

데이터 원본의 모든 셰이프를 새 셰이프 배열로 덮어씁니다.

toJson()

데이터 원본에 있는 모든 셰이프 데이터를 포함하는 GeoJSON FeatureCollection을 반환합니다.

상속된 메서드

getId()

데이터 원본의 ID를 가져옵니다.

생성자 세부 정보

DataSource(string, DataSourceOptions)

지도에 표시될 셰이프 데이터를 쉽게 관리할 수 있는 데이터 원본 클래스입니다. 데이터 원본이 맵에 표시되기 전에 계층에 추가해야 합니다. 클래스는 DataSource , , LineLayer, PolygonLayerBubbleLayer및 와 HeatMapLayer함께 SymbolLayer사용할 수 있습니다.

new DataSource(id?: string, options?: DataSourceOptions)

매개 변수

id

string

사용자가 데이터 원본에 할당하는 고유 ID입니다. 지정하지 않으면 데이터 원본에 ID가 자동으로 할당됩니다.

options
DataSourceOptions

데이터 원본에 대한 옵션입니다.

메서드 세부 정보

add(FeatureCollection | Feature<atlas.data.Geometry, any> | atlas.data.Geometry | GeometryCollection | Shape | Array<Feature<atlas.data.Geometry, any> | atlas.data.Geometry | Shape>, number)

데이터 원본에 셰이프를 추가합니다. GeoJSON 개체는 관리하기 쉽도록 Shape 클래스 내에 래핑됩니다. 필요에 따라 레이어의 다른 도형/기능 간에 기능을 삽입할 인덱스를 지정합니다.

function add(data: FeatureCollection | Feature<atlas.data.Geometry, any> | atlas.data.Geometry | GeometryCollection | Shape | Array<Feature<atlas.data.Geometry, any> | atlas.data.Geometry | Shape>, index?: number)

매개 변수

index

number

clear()

데이터 원본의 모든 데이터를 제거합니다.

function clear()

dispose()

이 개체가 사용하는 모든 리소스를 정리합니다.

function dispose()

getClusterChildren(number)

다음 확대/축소 수준에서 지정된 클러스터의 자식 요소를 검색합니다. 셰이프와 하위 클러스터의 조합일 수 있습니다. 하위 클러스터는 ClusteredProperties와 일치하는 속성이 있는 기능입니다.

function getClusterChildren(clusterId: number): Promise<Array<Feature<atlas.data.Geometry, ClusteredProperties | any> | Shape>>

매개 변수

clusterId

number

반환

Promise<Array<Feature<Geometry, ClusteredProperties | any> | Shape>>

getClusterExpansionZoom(number)

클러스터가 확장 또는 분리를 시작하는 확대/축소 수준을 계산합니다.

function getClusterExpansionZoom(clusterId: number): Promise<number>

매개 변수

clusterId

number

반환

Promise<number>

getClusterLeaves(number, number, number)

클러스터 내에 있는 셰이프를 검색합니다.

function getClusterLeaves(clusterId: number, limit: number, offset: number): Promise<Array<Feature<atlas.data.Geometry, any> | Shape>>

매개 변수

clusterId

number

limit

number

반환할 최대 기능 수입니다. 모든 셰이프를 반환하려면 무한대로 설정합니다.

offset

number

건너뛸 셰이프의 수입니다. 클러스터의 셰이프를 페이지스할 수 있습니다.

반환

Promise<Array<Feature<Geometry, any> | Shape>>

getOptions()

데이터 원본에서 사용하는 옵션을 가져옵니다.

function getOptions(): DataSourceOptions

반환

getShapeById(string | number)

지정된 ID를 사용하여 셰이프를 검색합니다. 지정된 ID를 가진 셰이프가 데이터 원본에 포함되지 않으면 null이 반환됩니다.

function getShapeById(id: string | number): Shape

매개 변수

id

string | number

반환할 셰이프의 ID입니다.

반환

getShapes()

DataSource에 있는 모든 셰이프를 반환합니다.

function getShapes(): Shape[]

반환

Shape[]

importDataFromUrl(string)

GeoJSON 문서를 다운로드하고 해당 데이터를 데이터 원본으로 가져옵니다. GeoJSON 문서는 동일한 도메인에 있거나 CORS를 사용하여 액세스할 수 있어야 합니다.

function importDataFromUrl(url: string): Promise<void>

매개 변수

url

string

반환

Promise<void>

remove(number | string | Shape | Feature<atlas.data.Geometry, any> | Array<number | string | Shape | Feature<atlas.data.Geometry, any>>)

데이터 원본에서 하나 이상의 셰이프를 제거합니다. 문자열이 전달되면 ID로 간주됩니다. 숫자가 전달되면 는 해당 인덱스에서 셰이프를 제거합니다.

function remove(shape: number | string | Shape | Feature<atlas.data.Geometry, any> | Array<number | string | Shape | Feature<atlas.data.Geometry, any>>)

매개 변수

shape

number | string | Shape | Feature<Geometry, any> | Array<number | string | Shape | Feature<Geometry, any>>

제거할 셰이프, 셰이프 ID 또는 기능

removeById(number | string | Array<number | string>)

ID에 따라 데이터 원본에서 하나 이상의 셰이프를 제거합니다.

function removeById(id: number | string | Array<number | string>)

매개 변수

id

number | string | Array<number | string>

setOptions(DataSourceOptions)

데이터 원본 옵션을 설정합니다. 데이터 원본은 제공된 옵션에 지정되지 않은 옵션에 대한 현재 값을 유지합니다.

function setOptions(options: DataSourceOptions)

매개 변수

options
DataSourceOptions

설정할 DataSourceOptions

setShapes(FeatureCollection | Array<Feature<atlas.data.Geometry, any> | atlas.data.Geometry | Shape>)

데이터 원본의 모든 셰이프를 새 셰이프 배열로 덮어씁니다.

function setShapes(shape: FeatureCollection | Array<Feature<atlas.data.Geometry, any> | atlas.data.Geometry | Shape>)

매개 변수

shape

FeatureCollection | Array<Feature<Geometry, any> | Geometry | Shape>

업데이트할 새 셰이프

toJson()

데이터 원본에 있는 모든 셰이프 데이터를 포함하는 GeoJSON FeatureCollection을 반환합니다.

function toJson(): FeatureCollection

반환

상속된 메서드 세부 정보

getId()

데이터 원본의 ID를 가져옵니다.

function getId(): string

반환

string

Source.getId에서 상속됨