Modifying your application – Pitney Bowes MapXtreme User Manual
Page 451

Appendix A: How to Create and Deploy a MapXtreme Application
Building a Desktop Application
MapXtreme v7.1
458
Developer Guide
The application displays a standard map of the United States with a theme based on the land
area of each state. The larger states are shaded in blue and the smaller states are shaded in
white. The legend shows the color assigned to each range of land area values.
The tools provided with the application enable you to perform some basic functions. You can
open tables, zoom in or out on a particular region, select regions on the map, move the map, and
access Layer Control to apply specific settings to each layer. You might want to practice using
the tools to get a feel for how the application works and what your users will experience.
3. When you are finished, close the active Form1 window to stop the application and return to
Design mode.
Modifying Your Application
Next, we’ll make some modifications to the ThemeLegend code to show how you can customize a
sample application. We will change the following elements of the application:
•
data source
•
number of ranges (bins)
•
range type
•
range colors
•
legend location
•
toolbar
1. In Visual Studio, move your cursor to the Solution Explorer and right click on MapForm1.vb.
Choose View Code to display the code page.
If you have MapForm1.vb displayed in Design mode, you can right-click anywhere on the form,
and choose View Code.
L
All sample applications discussed in this tutorial were taken from the MapXtreme
distribution CD. The line numbers referenced may not correspond exactly with the code
in your installation.
2. A new tab displays to show the application code. Scroll down the code page to familiarize
yourself with the code. Notice that the majority of the action in the application takes place in the
Form1() class. This is where we will make our changes.
3. Let’s change the data source on which the theme is based. To do this, we’ll need to change the
name of mexicothe table that the application uses and specify a different FeatureLayer. Make the
following changes:
•
On line 210 change the table from usa.tab to mexico.tab.
This loads the Mexico map instead of the USA map.
•
On line 218, change the FeatureLayer from usa to mexico.
4. The image below highlights the code changes with red boxes.