File tree Expand file tree Collapse file tree 3 files changed +73
-0
lines changed Expand file tree Collapse file tree 3 files changed +73
-0
lines changed Original file line number Diff line number Diff line change
1
+ //begin imports
2
+ using IgniteUI . Blazor . Controls ;
3
+ using System ;
4
+ using System . Collections . Generic ;
5
+ using System . Collections ;
6
+ //end imports
7
+
8
+ import { CodeGenHelper } from 'igniteui - webcomponents - core';
9
+
10
+ public class ShapeFileOnViewInit
11
+ {
12
+ //begin eventHandler
13
+
14
+ private IgbShapeDataSource Data ;
15
+
16
+ public void ShapeFileOnViewInit ( )
17
+ {
18
+ var geoMap = CodeGenHelper . GetDescription < IgbGeoGraphicMap > ( "content" ) ;
19
+
20
+ this . Data = new IgbShapeDataSource ( )
21
+ {
22
+ ShapefileSource = "https://static.infragistics.com/xplatform/shapes/world_countries_all.shp" ,
23
+ DatabaseSource = "https://static.infragistics.com/xplatform/shapes/world_countries_all.dbf"
24
+ } ;
25
+ this . geographicShapeSeries1 . ShapefileDataSource = Data ;
26
+ this . geoMap . BackgroundContent = null ;
27
+ }
28
+ //end eventHandler
29
+ }
Original file line number Diff line number Diff line change
1
+ //begin eventHandler
2
+ igRegisterScript ( "ShapeFileStyling" , ( o , e ) => {
3
+ // applying conditional styling based on Contient field loaded from DBF file
4
+ var c = e . item . getFieldValue ( "Continent" )
5
+ if ( c == "Africa" ) {
6
+ e . shapeFill = "#ECB912" ;
7
+ } else if ( c == "Asia" ) {
8
+ e . shapeFill = "#E11D1D" ;
9
+ } else if ( c == "Europe" ) {
10
+ e . shapeFill = "#2894EC" ;
11
+ } else if ( c == "South America" || c == "North America" ) {
12
+ e . shapeFill = "#0CC308" ;
13
+ } else if ( c == "Australia" ) {
14
+ e . shapeFill = "#B42AE9" ;
15
+ } else {
16
+ e . shapeFill = "gray" ;
17
+ }
18
+ e . shapeOutline = "black" ;
19
+ } , false ) ;
20
+ //end eventHandler
Original file line number Diff line number Diff line change
1
+ {
2
+ "export" : false ,
3
+ "onViewInit" : [ " ShapeFileOnViewInit" ],
4
+ "descriptions" : {
5
+ "content" : {
6
+ "type" : " GeographicMap" ,
7
+ "name" : " geoMap" ,
8
+ "zoomable" : true ,
9
+ "series" : [
10
+ {
11
+ "type" : " GeographicShapeSeries" ,
12
+ "name" : " GeographicShapeSeries1" ,
13
+ "styleShapeRef" : " ShapeFileStyling"
14
+ }
15
+ ]
16
+ }
17
+ },
18
+ "modules" : [
19
+ " maps/GeographicMapModule" ,
20
+ " charts/LegendModule" ,
21
+ " charts/DataChartAnnotationModule" ,
22
+ " charts/DataChartInteractivityModule"
23
+ ]
24
+ }
You can’t perform that action at this time.
0 commit comments