[mapguide-users] Listing Active selected feature C#

Nimrod Cnaan nimcnaan at Hotmail.com
Sat Jan 20 09:13:50 EST 2007


I am attempting to get the list of selected parcels by using “Invoke URL”
command, passing “$Current Selection” to my “listdwfparcels.aspx” page,
through the key & value pair.

I don’t know what I’m doing wrong, getting unclassified exception
“MgSelection.FromXml” . . .

Checking the value of my mgkey content “$Current Selection” returns:

%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A%3CFeatureSet%3E%0A%3CLayer%20id%3D%22d6a8101a-ffff-ffff-8003-000000000038%22%3E%0A%3CClass%20id%3D%22Default%3AHelkot%22%3E%0A%3CID%3ETAAAAA%3D%3D%3C%2FID%3E%0A%3CID%3EVwAAAA%3D%3D%3C%2FID%3E%0A%3CID%3EVgAAAA%3D%3D%3C%2FID%3E%0A%3C%2FClass%3E%0A%3C%2FLayer%3E%0A%3C%2FFeatureSet%3E%0A

Here is portion of the code that I’m using – 

String mgSessionId = GetParameters()["SESSION"];
String mgSelection = GetParameters()["mgkey"];
MgResourceIdentifier layerFeatureResource;
MgReadOnlyLayerCollection layers;
MgSelection selection;
MgLayer layer;
string layerClassName;
string selectionString;
string layerFeatureId;
  
  
 try
        {
  InitializeWebTier();

  MgUserInformation userInfo = new MgUserInformation(mgSessionId);
  MgSiteConnection siteConnection = new MgSiteConnection();
  siteConnection.Open(userInfo);
 
  MgResourceService resourceService =
siteConnection.CreateService(MgServiceType.ResourceService) as
MgResourceService;
  MgFeatureService featureService =
siteConnection.CreateService(MgServiceType.FeatureService) as
MgFeatureService;
  MgFeatureQueryOptions queryOptions = new MgFeatureQueryOptions();
   
  MgMap map = new MgMap();
  map.Open(resourceService, "HaifaMap");
   
if (GetParameters()["SESSION"] != "")
{
    selection = new MgSelection(map, mgSelection);

<<<<< MY ERROR >>>>>
An unclassified exception occurred.An unclassified exception occurred.
Exception occurred in method MgSelection.FromXml at line 158 in file
c:\build_tux_area\mgdev_opensource\common\service\maplayer\Selection.cpp


Nimrod Cnaan – GIS Senior Programmer
Haifa Municipality, Israel
Phon:972525355483

-- 
View this message in context: http://www.nabble.com/Listing-Active-selected-feature-C--tf3045397s16610.html#a8465318
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list