[mapguide-users] Problems with xmlSelection

Jorge Rubio j.e.rubio at gmail.com
Fri Jul 13 13:40:55 EDT 2007


My problems begin before to show selection. $mgSelection is not initialized!


2007/7/13, Scott Hameister <scotth at mpower-tech.com>:
>
>  The map needs to be saved and refreshed before a selection can show
>
>
>
> *From:* mapguide-users-bounces at lists.osgeo.org [mailto:
> mapguide-users-bounces at lists.osgeo.org] *On Behalf Of *Jorge Rubio
> *Sent:* Friday, July 13, 2007 9:35 AM
> *To:* MapGuide Users Mail List
> *Subject:* [mapguide-users] Problems with xmlSelection
>
>
>
> Hi list
>
>
>
> I need to pass an xmlSlection to a php class in order to be used by a
> member function
>
>
>
> Using javascript I get xmlSelection
>
>
>
> var xmlSel = parent.parent.mapFrame.GetSelectionXML();
>
>
> I post the selection like this
>
>
>
> someParams + "&SELECTION=" + encodeURIComponent(xmlSel);
>
> I get the params at php class file like this
>
>
>
> $mgSessionId = ($_SERVER['REQUEST_METHOD'] == "POST")? $_POST['SESSION']:
> $_GET['SESSION'];
> $mapName = ($_SERVER['REQUEST_METHOD'] == "POST")? $_POST['MAPNAME']:
> $_GET['MAPNAME'];
> $mapSelection = rawurldecode(($_SERVER['REQUEST_METHOD'] == "POST")?
> $_POST['SELECTION']: $_GET['SELECTION']);
>
>
> so $mapSelection is an XML string.
>
>
>
> Then, I need to get that selection
>
>
>
> $featureService =
> $this->site->CreateService(MgServiceType::FeatureService);
> $resourceService =
> $this->site->CreateService(MgServiceType::ResourceService);
>
> $map = new MgMap();
> $map->Open($resourceService, $mapName);
> $mgSelection = new MgSelection($map,$mapSelection);
>
> None selection is created!!
>
> What I'm doing wrong?
>
> Thanks in advance.
>
>
> --
> Lic. Jorge Rubio
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>


-- 
Lic. Jorge Rubio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20070713/096ee08c/attachment.html


More information about the mapguide-users mailing list