Infragistics
Close
Angular React Web Components Blazor Web Components
Premium

Web Components Geographic Polyline Map

In Web Components map component, you can use the IgcGeographicPolylineSeriesComponent to display geo-spatial data using polylines in a geographic context. This type of geographic series is often used to render roads or connections between geographic locations such as cities or airports.

Web Components Geographic Polyline Map Example

The IgcGeographicPolylineSeriesComponent works a lot like the IgcGeographicShapeSeriesComponent except that geo-spatial data is rendered with polylines instead of polygons.

Data Requirements

Similarly to other types of geographic series in the control, the IgcGeographicPolylineSeriesComponent has the dataSource property which can be bound to an array of objects. In addition, each data item in this object must have one data column that stores single/multiple shapes using an array of arrays of objects with x and y values representing geographic locations. This data column is then mapped to the shapeMemberPath property. The IgcGeographicPolylineSeriesComponent uses points of this mapped data column to plot polylines in the control.

When the shapes come straight from a shape file and need no reshaping first, the series can be given a shapefileDataSource of its own instead, and it reads the points out of the records itself. That is what the code below does; Binding Shape Files covers the other route, where a handler turns each record into an object of your own and maps shapeMemberPath to it.

Code Snippet

The following code gives the IgcGeographicPolylineSeriesComponent a shapefileDataSource pointing at a shape file of American roads, and draws every road in it.

<igc-geographic-map
    id="map"
    height="100%"
    width="100%"
    zoomable="true">
    <igc-geographic-polyline-series
        id="GeographicPolylineSeries1"
        outline="Red">
        <igc-shape-data-source
            shapefile-source="https://static.infragistics.com/xplatform/shapes/AmericanRoads.shp"
            database-source="https://static.infragistics.com/xplatform/shapes/AmericanRoads.dbf">
        </igc-shape-data-source>
    </igc-geographic-polyline-series>
</igc-geographic-map>

API References