Open($user); // Create a session repository $site = $siteConnection->GetSite(); $sessionID = $site->CreateSession(); $user->SetMgSessionId($sessionID); // Get an instance of the required services. $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService); $mappingService = $siteConnection->CreateService(MgServiceType::MappingService); // Get a runtime map from a map definition $resourceID = new MgResourceIdentifier('Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition'); $map = new MgMap(); $map->Create($resourceService, $resourceID, 'Sheboygan'); $sel = new MgSelection($map); $sel->Save($resourceService, 'Sheboygan'); $mapStateId = new MgResourceIdentifier("Session:" . $sessionID . "//" . "Sheboygan" . "." . MgResourceType::Map); $map->Save($resourceService, $mapStateId); ?>

Openlayers Mapguide tiled and untiled map, with map as layer Demo.
Setting OpenLayers.INCHES_PER_UNIT is required for tiled maps co-ordindates to be correct, plus this patch
Zac Spitzer