Background map, Mapcontrol, Background map mapcontrol – Pitney Bowes MapXtreme User Manual

Page 77

Advertising
background image

Chapter 5: Web Applications, Controls, and Tools

Components of a MapXtreme Web Application

MapXtreme v7.1

77

Developer Guide

Background Map

The background map, in the form of an image, is the most visual component of a MapXtreme web
application. It provides the user of the application with information about map features and shows
their relationship to other map features. Typically, a background map is made up of reference layers,
such as administrative boundaries, street networks, and points of interest. Custom data related to
the application, such as points representing office locations, cell towers, or ATM machines, are
additional layers. The reference layers and the custom layers do not change based on the user’s
interaction with the application. What typically changes is the display of the map. A user may zoom
into a particular location or create a thematic shading that overlays the map based on criteria the
user submitted in a web request.

The background map is presented to the user in its initial, or "clean" state. This state is an important
consideration when you design a pooled application since your application must handle changes in
user state.

The background map is pre-loaded into the application from an XML-based workspace (.mws). The
workspace is identified in the Web.config file of the application. See

What Should the Initial Map

Look Like?

. The MapXtreme web template and sample applications provide Web.config files that

include hard-coded paths to sample data. If you base your web application on one of these, be sure
to adjust the path to your own data.

The Workspace Manager utility provided with MapXtreme is an example of a desktop application
that assists you with building a background map. See

Chapter 23: Workspace Manager

.

MapControl

MapControl is a MapXtreme web server control containing an instance of a Map object. The
MapControl is the main web control in a MapXtreme application; it displays the background map and
responds to tool interactions on the map. Behind the scenes, the Map object is obtained from the
MapFactory using the MapAlias property of the MapControl. The map is rendered and exported as
an image and returned to the browser in the control’s <img> tag.

The sample applications that ship with MapXtreme have a MapControl built in, as does the
MapXtreme Web application template. You will see, however, that in design mode, the map is not
rendered. That is because to get a map from a web MapControl, there must be a running web
application on the server to serve up the map image along with some dynamically generated
javascript. That is only available at run/debug time.

L

If you start from a Visual Studio Visual Basic or C# ASP..NET template, you must manually
add the MapControl and tools to your web form in order for the MapXtreme resources to be
included in your project.

For more information, see

MapXtreme Web Controls and Tools

.

Advertising