MapGuide API Reference
 All Classes Functions Variables Enumerations Enumerator Friends
virtual void MgMap::Create ( MgResourceIdentifier resource,
CREFSTRING  mapName,
INT32  displayWidth,
INT32  displayheight,
double  x,
double  y,
double  scale,
INT32  dpi 
) [virtual]

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

Remarks:
This method is called CreateStateless in PHP
.NET Syntax
void Create(MgResourceIdentifier mapDefinition, string mapName, int displayWidth, int displayHeight, double x, double y, double scale, int dpi);
Java Syntax
void Create(MgResourceIdentifier mapDefinition, String mapName, int displayWidth, int displayHeight, double x, double y, double scale, int dpi);
PHP Syntax
void CreateStateless(MgResourceIdentifier mapDefinition, string mapName, int displayWidth, int displayHeight, double x, double y, double scale, int dpi);
Parameters:
resourceAn MgResourceIdentifier that specifies the location of the map definition in a resource repository.
mapNameA string that specifies the name of the map.
displayWidthThe display width to initially set for the map
displayHeightThe display height to initially set for the map
xThe view center X coordinate to initially set for the map
yThe view center Y coordinate to initially set for the map
scaleThe view scale to initially set for the map
dpiThe display DPI to initially set for the map
Since:
4.0
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);
 // Initializes the map to be centered on the Calgary CBD at 1:5000 scale with a DPI of 96
 $map->CreateStateless($resourceID, 'Calgary', 640, 480, -114.054565, 51.068369, 5000.0, 96);