AutoCAD Map 3D Geospatial Platform API


In the Geospatial Platform API, resources are the files and configuration information necessary to draw layers and maps. There are various types of resources required. For example, a FeatureSource describes the location, type, and other details needed for access to GIS feature data. A LayerDefinition defines the data and style for a layer.

Resources are stored in a resource repository. AutoCAD Map 3D has a single repository named Library. This repository is contained within the DWG file.

MapGuide uses multiple repositories. The Library repository contains persistent, site-wide data. There is a single Library repository for each MapGuide site. There are multiple Session repositories, each one containing data from a single MapGuide session. Session repositories are unique to an individual session and cannot be shared. All MapGuide repositories are managed on the site server.

Allowable resource types are defined as static members of the class MgResourceType. Some resource types apply only to MapGuide.

The following resource types are valid for both Map 3D and MapGuide:

Resource Type Description
FeatureSource Contains the required parameters for connecting to a geospatial feature source.
LayerDefinition Contains the required parameters for displaying and styling a layer. Layers can be drawing layers, vector layers, or grid (raster) layers.
SymbolDefinition Defines a symbol to be displayed on a map.

The following resource types are only valid for MapGuide:

Resource Type Description
ApplicationDefinition Defines a flexible Web layout for the Fusion framework.
DrawingSource Contains the required parameters for connecting to a DWG file.
Folder A folder in the resource repository.
LoadProcedure Contains the required parameters for loading new data into the MapGuide repository.
Map Contains the run-time definition of a map.
MapDefinition Defines an initial map state, used as the basis for creating a run-time map.
PrintLayout Defines the components of a printed map created from MapGuide.
Selection Contains selection information.
SymbolLibrary Defines a library of symbols.
WebLayout Defines the components of a Web layout for a MapGuide Viewer.

Resource repositories are structured like directories, with folders, subfolders, and documents. Each resource is an XML document in the repository, named with a unique resource identifier. A resource identifier is made up of the following parts:

  • Repository type—either “Library” or “Session”. Map 3D only uses “Library”.
  • Repository name—for library repositories, an empty string. For session repositories, a unique session identifier assigned by the site server.
  • Path—the path to the folder containing the resource.
  • Name—the resource name, without the extension.
  • Resource type—the resource type (the extension). This must match one of the allowable types defined in MgResourceType.

For example, the following could be a name for a feature source in either Map 3D or MapGuide:


The following could be a name for a map definition in MapGuide:


Resource Service

Resources are managed by the resource service, an MgResourceService object.

In AutoCAD Map 3D, use AcMapServiceFactory to get the resource service:

MgResourceService resourceService = 
  as MgResourceService;

In MapGuide, use MgSiteConnection to get the resource service:

MgSiteConnection siteConnection = new MgSiteConnection();
MgResourceService resourceService = 
  as MgResourceService;

Resource Dependencies

Resources may depend on other items:

  • Some resources are self sufficient and do not refer to any other resources or files.
  • Some resources reference other resources. For example, layer definitions and feature sources are stored as separate resources. A layer definition resource contains a reference to the resources for the feature sources that are used in that layer.
  • Some resources use associated resource data. For example, this is used to store configuration information for ODBC/WMS/Raster feature sources.

Resource Schemas

Resources are stored in the repository as XML documents. Applications that add or modify resources must ensure that the XML validates against the appropriate schema.

For AutoCAD Map 3D, the schemas are available as part of the SDK, in the Schema folder.

For MapGuide, the schemas are installed with the server files, in InstallDir\Server\Schema.

The schemas are documented in the XML Schemas module of the Geospatial Platform Reference.