Web Components Geographic Symbol Map
In Web Components map component, you can use the IgcGeographicSymbolSeriesComponent to display geo-spatial data using points or markers in a geographic context. This type of geographic series is often used to render a collection of geographic locations such as cities, airports, earthquakes, or points of interests.
Web Components Geographic Symbol Map Example
Data Requirements
Similarly to other types of geographic series in the map component, the IgcGeographicSymbolSeriesComponent has the dataSource property which can be bound to an array of objects. In addition, each data item in this object must have two numeric data columns that store a geographic location (longitude and latitude). These data columns are then mapped to the latitudeMemberPath and longitudeMemberPath properties. The IgcGeographicSymbolSeriesComponent uses values of these mapped data columns to plot symbol elements in the geographic map component.
Code Snippet
The following code shows how to bind the IgcGeographicSymbolSeriesComponent to locations of cities loaded from a shape file using the IgcShapefileRecord.
<igc-geographic-map
id="geoMap"
height="100%"
width="100%"
zoomable="true">
<igc-geographic-symbol-series
id="citiesSeries"
marker-type="Circle"
latitude-member-path="y"
longitude-member-path="x"
marker-brush="White"
marker-outline="Gray">
</igc-geographic-symbol-series>
<igc-geographic-symbol-series
id="capitalsSeries"
marker-type="Circle"
latitude-member-path="y"
longitude-member-path="x"
marker-brush="White"
marker-outline="rgba(32, 146, 252, 1)">
</igc-geographic-symbol-series>
</igc-geographic-map>
// fields:
private geoMap: IgcGeographicMapComponent
private citiesSeries: IgcGeographicSymbolSeriesComponent
private capitalsSeries: IgcGeographicSymbolSeriesComponent
// initialization:
var geoMap = this.geoMap = document.getElementById('geoMap') as IgcGeographicMapComponent;
var citiesSeries = this.citiesSeries = document.getElementById('citiesSeries') as IgcGeographicSymbolSeriesComponent;
var capitalsSeries = this.capitalsSeries = document.getElementById('capitalsSeries') as IgcGeographicSymbolSeriesComponent;
// bindings:
citiesSeries.dataSource = this.worldCities;
capitalsSeries.dataSource = this.worldCapitals;