web analytics
Products - Desktop MapsSample

Using WPF “TextStyling” with ThinkGeo UI — ThinkGeo, GIS Mapping Made Easy

Diving into the sample code

The sample starts by loading the point features from a local ShapeFile, which contains the locations of schools in Frisco, TX. It then displays them using a TextStyle. One detail you should be aware of is that a TextStyle normally requires a column name from which to grab an attribute value from each record in the ShapeFile, but in our case, we don’t want to display text from the ShapeFile — we want to display a symbol glyph from our Map Icon Font.

To accomplish that, we simply pass in a nonexistent column name (e.g. textColumn) which in turn raises a CustomColumnFetch event. If we handle that event, we can just return the character code for the font glyph we want to show on the map; for example, in our Map Icon Font, code “ue0aa” is a school zone symbol. This symbol will then be used to represent each point feature on our ShapeFile layer.

Here is the code that does it all:

Tags
Show More

Related Articles

Back to top button
Close