Modifying your application – Pitney Bowes MapXtreme User Manual

Page 462

Advertising
background image

Appendix A: How to Create and Deploy a MapXtreme Application

Building a Web Application

MapXtreme v7.1

469

Developer Guide

Modifying Your Application

To modify this sample application, let’s look at the code behind page, WebForm1.aspx.vb. The code
behind page is the code that represents the HTML for the Web form.

L

This Thematics sample Web application is designed very differently than its desktop sample
application counterpart. The most important difference is that the Web sample is tightly
coupled to the data table and data column names. These items cannot simply be changed as
was the case in the desktop sample.

In the code behind page, we will make some simple theme property value and range color changes.
These modifications will change the themes display when the user runs The method where we will
make our changes is in the CreateThemeOrModifier method, on line 244. The first change is to the
Dot Density theme and how it will be displayed.

1. In Visual Studio, move your cursor to the Solution Explorer and right click on WebForm1.aspx.

Choose View Code to display the code behind page, WebForm1.aspx.vb.
If you have WebForm1.aspx 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.

Scroll down the code page to familiarize yourself with the code.

2. Make the following changes:

·Under the ThemeAndModifierTypes.DotDensityTheme case statement, go to line 288 and
change Color.Purple to Color.DarkGreen
When the application is run, this will change the display color of the dots when selecting the
Dot Density Theme.

·On line 289, change the ValuePerDot property from 2000000 to 5000000.
This will change the number of dots displayed based on population. The result will be a fewer
number of dots.

In the image below, the code changes are highlighted with red boxes.

Advertising