2.7. Where Are We?
In this chapter, we have discussed how to use MapPoint 2004 APIs to develop applications with basic functionalities, such as finding places, addresses, and latitude/longitude; displaying locations on a map; zooming into a location; and panning maps. When you develop your applications using MapPoint 2004 ActiveX Control, try to reuse the UI that comes with ittoolbars, panes, dialogs, etc. We have also discussed using the MapPoint 2004 routing API to optimize, calculate, and personalize routes. It is important to keep in mind that you are working with a set of COM objects with a managed wrapper around them, so be sure to call the
Quit
method on the
MapPoint.Application
object when you are done with your
While it seems to be a lot of information, these concepts are really the
|
Chapter 3. Working with Data in MapPoint 2004
MapPoint 2004 can process, analyze, and display business data based on location, and it can then create demographic maps, thematic maps,
This chapter has three major sections that
I will assume that you are familiar with the basic MapPoint 2004 programming model (if not, refer to Chapter 2 of this book). The sample data and code used in this chapter is available in the book's companion material in the Chapter03 directory. |
3.1. Understanding the MapPoint 2004 Data API
In MapPoint 2004, both business data and demographic data are represented using the
DataSet
class. An active
Map
object exposes the
DataSets
collection, which you use to access a valid
DataSet
object. How does a
DataSets
collection get its data wrapped as a
DataSet
object? The
DataSets
collection is different from traditional .NET collectionsit not only exposes a collection of
DataSet
objects, but it also offers
A
DataSet
object is similar to a data table with rows and
Figure 3-1. MapPoint 2004 data-
|
|
Tables 3-1 and 3-2 show some of the key methods exposed on the DataSet and RecordSet objects.
|
Method
|
Description |
|---|---|
|
DisplayDataMap |
Displays a set of data on a map |
|
QueryAllRecords |
Returns all records in a DataSet as a RecordSet object |
|
QueryShape |
Returns records that fall within a specified shape on the map as a RecordSet object |
|
ZoomTo |
Zooms to the best map view of the specified DataSet object |
|
Method Name |
Description |
|---|---|
|
MoveFirst |
Sets the current record of the RecordSet to the first record |
|
MoveNext |
Sets the current record of the
RecordSet
to the
|
With this introduction, let's look at specifics of dealing with visualization of data using MapPoint 2004.