[mapguide-users] How to get selected area information in mapguide
nekad
nekadiana at gmail.com
Thu Nov 12 23:03:17 EST 2009
hm, i don't know if there is selection xml in $_POST['SELECTION']
how can i check it?
i just follow the tutorial by getting MgSelection with $_POST['SELECTION']
parameter
to enable selection in map area, i just checklist the options 'Features on
Layer are selectable' in mapguide maestro...
Jackie Ng wrote:
>
> Are you sure there is selection xml in $_POST['SELECTION'] ?
>
> - Jackie
>
>
> nekad wrote:
>>
>> i have included constants.php
>>
>> and there is no problem with MgServiceType anymore...
>>
>> but, now i got the problem in finding the information of selected area...
>>
>> when i run this code
>> $selection = new MgSelection($map, $_POST['SELECTION']);
>> $layers = $selection->GetLayers();
>>
>> it returns nothing, seems like i don't select any area on the map?
>> can you help me?
>>
>> Jackie Ng wrote:
>>>
>>> PHP does not support enums, so all the mapguide constants like
>>> MgServiceType, MgResourceType, etc are stored and defined in the
>>> constants.php file in your mapviewerphp directory.
>>>
>>> Have you included this file?
>>>
>>> - Jackie
>>>
>>>
>>> nekad wrote:
>>>>
>>>> Hey guys..
>>>> I'm newbie in GIS world
>>>> I'm using Mapguide and mapguide maestro 1.0.9
>>>>
>>>> What i want is,
>>>> when user click a selected area, then they can right click and choose
>>>> the link i provided, let say "ViewData"
>>>>
>>>> when user click ViewData, then it will show a popup window which
>>>> display relevant information of selected area...
>>>>
>>>> But, my problem is, I don't know how to get the information..
>>>>
>>>> I have coded by following the sample,
>>>> $args = ($_SERVER['REQUEST_METHOD'] == 'POST') ? $_POST : $_GET;
>>>> $sessionId = $args['SESSION'];
>>>> echo $sessionId."<br>";
>>>> $mapName = $args['MAPNAME'];
>>>> echo $mapName."<br>";
>>>> try
>>>> {
>>>> // Initialize the Web Extensions and connect to the Server using
>>>> // the Web Extensions session identifier stored in PHP session
>>>> state.
>>>>
>>>> MgInitializeWebTier ($webconfigFilePath);
>>>>
>>>> $userInfo = new MgUserInformation($sessionId);
>>>> //$userInfo = new MgUserInformation("Administrator", "admin");
>>>> echo "USER";
>>>> $siteConnection = new MgSiteConnection();echo "CON";
>>>> $siteConnection->Open($userInfo);echo "open";
>>>> $resourceService =
>>>> $siteConnection->CreateService(MgServiceType::ResourceService); echo
>>>> "resource";
>>>>
>>>> when i run it, popwindow will display echo till "CON", but "resource"
>>>> will not shown...
>>>> what is the problem?
>>>> somebody can help me the simple way to do my needs?
>>>>
>>>> thx
>>>>
>>>
>>>
>>
>>
>
>
--
View this message in context: http://n2.nabble.com/How-to-get-selected-area-information-in-mapguide-tp3990797p3997288.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list