Use Thematic-Graduated Markers in a Map
Standard Esri Map Control
Use Thematic-Graduated Markers in a Map
Technologies > User Interface Add-Ins > Geographic Information System (GIS) Views > Map with Thematic-Graduated Markers
This example displays thematic graduated markers for buildings according to building use and building occupancy. A colored legend defining the theme appears on the map with marker colors corresponding to the theme.
First, create thematic 'buckets' for building use. By specifying an empty bucket, the map control will automatically determine and include all the unique building use values. This approach uses a unique value renderer:
var thematicBuckets = [];
Next, create the graduated bucket array for the building occupancies. The first bucket will contain values less than 100 with a marker size of 10px, the second bucket values from 100 to 500 with a marker size of 20px, etc:
var graduatedBuckets = [ {limit: 100, size: 10}, {limit: 500, size: 20}, {limit: 1000, size: 30}, {limit: +Infinity, size: 40} ];
Assign the thematic and graduated buckets to the marker property by calling
setThematicGraduated()
and passing the building use field name,the thematic buckets, the building occupancy field name, and the graduated buckets:
markerProperty.setThematicGraduated(‘bl.use1’, thematicBuckets, 'bl.count_occup', graduatedBuckets);
Call
buildThematicLegend()
to build the marker legend:
this.map.buildThematicLegend(markerProperty);
Finally, assign the property restriction to the marker property and refresh the map:
markerProperty.setRestriction(restriction); this.mapControl.updateDataSourceMarkerPropertyPair('bl_ds', markerProperty); this.mapControl.refresh();