I have the USA map displayed ( .shp ). How do I place label for individual States on the USA map ( VA, NY, PA, OH, etc) ?
Sample code using jQuery, html please.
Thank you in advance.
trifee
I too want to show labels on each shapeid with 2 values like stata name and population in separate rows and each shape should maintain click event also.
eg:
state:VA
Population: 222222
Thanks so much! I will follow your example code. Thanks again.
Hi, trifee
First, a very simple solution: Use the default background content (OpenStreetMap) and configure the shape brush with semi-transparent color (for example, rgba(173,216,230, 0.5)). The OpenStreetMap background contains the states abbreviations and they will be visible behind the semi-transparent shape fill.
Of course, that might not suit you and that is why there is a more flexible solution in Ignite UI. Use the SimpleTextMarkerTemplate class. You may see details about it in the Configuring the Visual Features: Configuring the Marker Template With the SimpleTextMarkerTemplate topic In the online help. Here follows an example of how to do it. Add the following code in your series definition in the map control:
This example assumes that the state abbreviation is contained in an attribute called STATE in your DBF file. This is set in the getText member of the SimpleTextMarkerTemplate.
Cheers, Lazar