[mapguide-users] Generate Simple Static Map

Jackie Ng jumpinjackie at gmail.com
Wed May 15 05:58:05 PDT 2013


The map name is the name of the runtime map state that's stored in the user's
session repository. That means, pretty much anywhere a map name is involved,
you'll need the session id as well.

So you should be replacing this:

$userInfo = new MgUserInformation();
$userInfo->SetMgUsernamePassword($username, $password);
$siteConnection = new MgSiteConnection();
$siteConnection->Open($userInfo);

with this:

$userInfo = new MgUserInformation($sessionId);
$siteConnection = new MgSiteConnection();
$siteConnection->Open($userInfo);

Where $sessionId is set based on a request parameter to your PHP script. If
your PHP script is set up as an InvokeURL command or widget, it will always
get passed the MAPNAME and SESSION parameters that you can access with
$_REQUEST

This assumes a runtime map already created by the AJAX/Fusion viewer. If you
are trying to create the runtime map *outside* of the viewer, the you should
be using $map->Create instead of $map->Open. In such case, then your
MgSiteConnection initialization fragment with username/password is the
correct one to use.

- Jackie



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Generate-Simple-Static-Map-tp5053393p5053399.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list