[mapguide-users] How to show a map (PHP)

mates reklamama at centrum.sk
Sun Jun 24 18:22:09 EDT 2007


I create a map and then i add a layer. Now i need it to show the map in the
browser, but i don't know how to do it using PHP :( 
Can you help me pls?

<?php

include "constants.php";
MgInitializeWebTier('webconfig.ini');

$site = new MgSite();
$userInfo = new MgUserInformation("Administrator", "admin");

$site->Open($userInfo);

$id = $site->CreateSession();

$siteConnection = new MgSiteConnection();
$siteConnection->Open($userInfo);
$resourceService =
$siteConnection->CreateService(MgServiceType::ResourceService);

$mapDefId = new MgResourceIdentifier("Library://22/mapa.MapDefinition");
$map = new MgMap();
$mapName = $mapDefId->GetName();
$map->Create($resourceService, $mapDefId, $mapName);

$LayID = new MgResourceIdentifier("Library://22/kraje.LayerDefinition");

$newLayer = new MgLayer($LayID, $resourceService);

$newLayer->SetVisible(true);
$newLayer->SetLegendLabel($newLayer->GetName());
$newLayer->SetDisplayInLegend(true);

$layerCollection->Insert(0, $newLayer);

$mapId = new MgResourceIdentifier("Session:$id//$name." .
MgResourceType::Map);
$map->Save($resourceService, $mapId);

And what now? :)
-- 
View this message in context: http://www.nabble.com/How-to-show-a-map-%28PHP%29-tf3973550s16610.html#a11279107
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list