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