Angular 地理ポリゴン マップ
Angular マップ コンポーネントでは、IgxGeographicShapeSeriesComponent を使用して、地理的コンテキストで形状ポリゴンを使用して地理空間データを表示できます。地理的シリーズのこのタイプは、地理的位置で定義される国々または領域の図形を描画するためにしばしば使用されます。
Angular 地理ポリゴン マップの例
IgxGeographicShapeSeriesComponent は、地理空間データがポリラインではなくポリゴンでレンダリングされる以外、IgxGeographicPolylineSeriesComponent とほとんど同じです。
データ要件
マップコントロールの他の種類の地理的シリーズと同様に、IgxGeographicShapeSeriesComponent には、オブジェクトの配列にバインドできる dataSource プロパティがあります。さらに、このオブジェクトの各データ項目には、地理的位置を表す x 値と y 値を持つオブジェクトの配列の配列を使用して単一または複数の形状を格納する 1 つのデータ列が必要です。このデータ列は、shapeMemberPath プロパティにマップされます。IgxGeographicShapeSeriesComponent は、マップされたデータ列の点を使用してマップコントロールにポリゴンをプロットします。
形状がシェイプ ファイルからそのまま得られ、事前に加工する必要がない場合は、代わりにシリーズ自身に shapefileDataSource を指定でき、シリーズがレコードから点を読み取ります。以下のコードはこの方法です。ハンドラーで各レコードを独自のオブジェクトに変換し、shapeMemberPath をそれにマップするもう一方の方法は、シェープ ファイルのバインディング で説明しています。
コード スニペット
以下のコードは、世界の国々のシェイプ ファイルを指す shapefileDataSource を IgxGeographicShapeSeriesComponent に指定し、その中のすべての国を描画します。
<igx-geographic-map
#map
height="100%"
width="100%"
zoomable="true">
<igx-geographic-shape-series
#geographicShapeSeries1
outline="Black"
thickness=0.5
markerCollisionAvoidance="Omit">
<igx-shape-data-source
shapefileSource="https://static.infragistics.com/xplatform/shapes/world_countries_all.shp"
databaseSource="https://static.infragistics.com/xplatform/shapes/world_countries_all.dbf">
</igx-shape-data-source>
</igx-geographic-shape-series>
</igx-geographic-map>
API リファレンス
IgxGeographicPolylineSeriesComponent
IgxGeographicShapeSeriesComponent
IgxShapefileRecord