Title: Creating%20Custom%20Styles
1Learning Video Series Extending Map Suite
Lesson 2 Creating Custom Styles Learn the
basics of how to create your own custom styles
. Duration 45 minutes
2Agenda
- Answer the following questions.
- Why create custom styles?
- What are the important classes?
- What is required for a custom style?
- What overloads are recommended?
- Review a Custom Style.
- Review a Decision Based Custom Style.
- Review a caching Custom Style
- Answer additional questions.
3Why Create a Custom Style?
- Encapsulate custom logic.
- Draw styles based on time, scale or other
values. - Tweak our current styles.
- Adjust the look of roads for example.
- Integrating external data at runtime and
caching. - Cache values from expensive to retrieve sources.
- Composite existing styles.
- Create complex point styles.
4What are the Important Classes?
- GeoPen GeoBrush
- Used to draw on the GeoCanvas.
- Very similar to GDI pens brushes.
- Style
- Abstracts the look of your features.
- Provides a drawing API.
- Can be decision or drawing based.
- GeoCanvas
- A geographic drawing system.
- Provides APIs similar to that of GDI.
5What is Required for a Style?
- DrawCore()?
- This is the main drawing method of the style.
- You are responsible for drawing the features
passed in on the GeoCanvas. - This method can be chained to draw other styles.
- Important Caveats
- While this is the only required override you
will find that there are a few other overloads
that you should consider depending on what your
style needs.
6What Overloads are Recommended?
- GetRequiredColumnNamesCore()?
- Provides a way to communicate to the rest of the
framework what data columns you need to render
your style. - Note that if you are doing a composite style
you will need to query your children as well. - DrawSampleCore()
- Provides a sample image that can be used to
create a legend. - Some complex styles may find it difficult to
provide this.
7Sample Code Overview
- The first sample shows how we can draw different
sized points based on data from the feature. - The second sample shows how we can choose
different styles depending on time information in
the feature. - The third example shows how we can cache
pre-known values to increase the speed of an
existing ValueStyle
8Let's Look at Some Code! You can find the code
we will review in a zip file accompanying this
video on ThinkGeo.com. To compile the code it
requires you have installed a full or evaluation
edition of any Map Suite 3.0 product. You will
need to add the MapSuiteCore.DLL as a reference
in the project.
9Thank You For Watching! For More Samples and
Videos, Visit the Developers Blog Discussion Forum