MapGuide API Reference
 All Classes Functions Variables Enumerations Enumerator Friends
virtual void MgMap::Create ( MgResourceIdentifier resource,
CREFSTRING  mapName 
) [virtual]

Initializes a new MgMap object given a map definition or tile set definition and a name for the map. This method is used for MapGuide Viewers or for offline map production.

Remarks:
If creating a MgMap object from a tile set definition, only "Default" is the acceptable tile provider. Any other provider will cause this method to throw a MgUnsupportedTileProviderException
.NET Syntax
void Create(MgResourceIdentifier mapDefinition, string mapName);
Java Syntax
void Create(MgResourceIdentifier mapDefinition, String mapName);
PHP Syntax
void Create(MgResourceIdentifier mapDefinition, string mapName);
Parameters:
resourceAn MgResourceIdentifier that specifies the location of the map definition in a resource repository.
mapNameA string that specifies the name of the map.
Returns:
Returns nothing.
Example (PHP)
 // Assuming the site connection has already been intialized
 $resourceID = new  MgResourceIdentifier('Library://Calgary/Maps/Calgary.MapDefinition');
 $map = new MgMap($site);
 $map->Create($resourceID, 'Calgary');