Maploader, Mapviewlist, mapview, Mapcontrol – Pitney Bowes MapXtreme User Manual
Page 242: Maploader mapviewlist, mapview mapcontrol

Chapter 12: Adding Mapping Capability to Your Applications
Base Mapping Classes
MapXtreme v7.1
249
Developer Guide
Dim map As Map = Session.Current.MapFactory.CreateEmptyMap(New Size(300,
300))
MapLoader
The MapLoader class provides a mechanism to load the layers of a map from Geoset files, XML
Workspace files, or TAB files. For each type of map to load, there is a subclass of MapLoader that is
used to load the map. These subclasses include MapGeosetLoader, MapWorkspaceLoader, and
MapTableLoader.
VB example:
Public Shared Sub MapInfo_Mapping_MapLoad()
’ Create an empty map
Dim map As Map = _
MapInfo.Engine.Session.Current.MapFactory.CreateEmptyMap(New Size(400,_
300))
’ Create a maploader. Make sure that Session.Current.TableSearchPath
points to the folder with the tables in it
Dim tl As MapTableLoader = New MapTableLoader("ocean.tab", _
"usa.tab", "mexico.tab", "us_hiway.tab")
’ Load tables into a map
map.Load(tl)
End Sub
MapViewList, MapView
These classes contain the objects that help to maintain a list of the previous and next views for a
Map. Use the MapViewList class as a convenience to step through your stack of map views,
displaying them with the MapView class which provides the specifics (Name, Center, and Zoom) of
each map view.
MapXtreme provides a VB sample for MapViewList in <MapXtreme Install Directory>\MapInfo\
MapXtreme\7.x.x\Samples\Desktop\Features.
MapControl
The MapControl class contains the objects that allow the user to visualize a map on a screen. Add a
MapControl to a Windows Form to view a map. A MapControl also holds the MapTools collection. A
version of MapControl exists for web applications as well.
The MapControl class for use in desktop applications is in the MapInfo.Windows.Controls
namespace. For a working example of a desktop MapControl, run Workspace Manager from the
Start menu. See also
.
The MapControl class for use in web applications is in the MapInfo.WebControls namespace. See
. For a tutorial on how to create an overview map for a web application,
see the Tutorials section of Learning Resources, available from the Start menu.