Infragistics
Close
Angular React Web Components Blazor Angular
Premium

Angular Binding Multiple Data Sources

In the Ignite UI for Angular map, you can add multiple geographic series objects to overlay custom data sources with geo-spacial data. For example, IgxGeographicSymbolSeriesComponent for plotting geographic locations of airports, the IgxGeographicPolylineSeriesComponent for plotting flights between airports, and 2nd IgxGeographicPolylineSeriesComponent for plotting gridlines of major geographic coordinates.

Angular Binding Multiple Data Sources Example

This topic takes you step-by-step towards displaying multiple geographic series that will plot following geo-spatial data:

You can use geographic series in this or other combinations to plot desired data.

Creating Data Sources

Create data sources for all geographic series that you want to display in the Ignite UI for Angular map. For example, you can the use WorldConnections script.

<igx-geographic-map
    #geoMap
    height="100%"
    width="100%"
    zoomable="true">
</igx-geographic-map>

Overlaying Flights

Create first IgxGeographicPolylineSeriesComponent object with flight connections between major airports and add it to the Series collection of the Ignite UI for Angular map.

<igx-geographic-polyline-series
    #lineSeries
    [dataSource]="worldFlights"
    shapeMemberPath="points"
    shapeStroke="rgba(196, 14, 14, 0.05)"
    shapeStrokeThickness=4>
</igx-geographic-polyline-series>

Overlaying Gridlines

Create second IgxGeographicPolylineSeriesComponent object with geographic gridlines and add it to the Series collection of the Ignite UI for Angular map.

<igx-geographic-polyline-series
    #gridSeries
    [dataSource]="worldGridlines"
    shapeMemberPath="points"
    shapeStroke="Gray"
    shapeStrokeThickness=1>
</igx-geographic-polyline-series>

Overlaying Airports

Create IgxGeographicSymbolSeriesComponent object with airport points and add it to the Series collection of the geographic Ignite UI for Angular map.

<igx-geographic-symbol-series
    #symbolSeries
    [dataSource]="worldAirports"
    latitudeMemberPath="lat"
    longitudeMemberPath="lon"
    markerType="Circle"
    markerBrush="rgba(170, 211, 223, 1)"
    markerOutline="rgba(73, 73, 73, 1)"
    thickness=1>
</igx-geographic-symbol-series>

Summary

For your convenience, all above code snippets are combined into one code block below that you can easily copy to your project.

import { IgxGeographicMapComponent, IgxGeographicPolylineSeriesComponent, IgxGeographicSymbolSeriesComponent } from 'igniteui-angular-maps';
<igx-geographic-map
    #geoMap
    height="100%"
    width="100%"
    zoomable="true">
    <igx-geographic-polyline-series
        #lineSeries
        [dataSource]="worldFlights"
        shapeMemberPath="points"
        shapeStroke="rgba(196, 14, 14, 0.05)"
        shapeStrokeThickness=4>
    </igx-geographic-polyline-series>
    <igx-geographic-polyline-series
        #gridSeries
        [dataSource]="worldGridlines"
        shapeMemberPath="points"
        shapeStroke="Gray"
        shapeStrokeThickness=1>
    </igx-geographic-polyline-series>
    <igx-geographic-symbol-series
        #symbolSeries
        [dataSource]="worldAirports"
        latitudeMemberPath="lat"
        longitudeMemberPath="lon"
        markerType="Circle"
        markerBrush="rgba(170, 211, 223, 1)"
        markerOutline="rgba(73, 73, 73, 1)"
        thickness=1>
    </igx-geographic-symbol-series>
</igx-geographic-map>

API References