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

David Hequet david.hequet at free.fr
Tue Jun 26 07:54:53 EDT 2007


that's sound's easy. Use Mapguide Studio to create a layout without toolbar,
frame,status and without property window. You don't need to code to do that
(if i didn't misunderstood what you need)


akj006 wrote:
> 
> Hello David,
> 
> Firstly I would like to say a thanks to you thinking that you can solve my
> problem. My requirement is to display a reference map. Means I need a map
> in the place of the task frame. I need a map with out the tool bar
> property window task frame alone(map alone with smaller size). I am able
> to display the map without the task frame anf tool bar. But I need it with
> out the property window.
> 
> Thanks David,
> Anil....
> 
> David Hequet wrote:
>> 
>> Look at the Tutorial provided with Mapguide Studio to create an entire
>> map from Data to Weblayout.
>> The look at the "Hello Map" sample in devguide (you can download it here)
>> that is a working php sample wich show a Map
>> Ps: You can't show a map in a browser, you can only show a weblayout. The
>> Tutorial's is a good point to undestand how work mapguide (before going
>> trough the code)
>> 
>> 
>> mates wrote:
>>> 
>>> Hi
>>> Sorry, but I don't understood well what you mean. Can u pls explain
>>> better, Im a beginner :) I have already created a Weblayout, but I don't
>>> know how to get this map to this Weblayout. Show me a exapmle pls.. 
>>> Thank you..
>>> 
>>> 
>>> 
>>> Mansoureh Sadrykia wrote:
>>>> 
>>>> Hi!
>>>>    
>>>>   Why don't you use mapguide studio to create a webLayout and then
>>>> define its address in your library by PHP?(As the code you've written
>>>> for the mapDefinition)
>>>> 
>>>> mates <reklamama at centrum.sk> wrote:
>>>>   
>>>> 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?
>>>> 
>>>> 
>>>> 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.
>>>> 
>>>> _______________________________________________
>>>> mapguide-users mailing list
>>>> mapguide-users at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>> 
>>>> 
>>>>        
>>>> ---------------------------------
>>>> Need a vacation? Get great deals to amazing places on Yahoo! Travel. 
>>>> _______________________________________________
>>>> mapguide-users mailing list
>>>> mapguide-users at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

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



More information about the mapguide-users mailing list