[mapguide-users] Listing Active selected feature C#
Andy Morsell
amorsell at spatialgis.com
Fri Jan 26 18:31:34 EST 2007
That's a URL encoded equivalent of the XML string. I'm not sure what you
are doing with the XML after getting it, but take a look at the
HttpUtility.UrlDecode method in the .NET framework (it's in the System.Web
assembly) for details on how to decode the string.
Andy
_____
From: Nimrod Cnaan [mailto:nimcnaan at hotmail.com]
Sent: Friday, January 26, 2007 3:03 PM
To: amorsell at spatialgis.com
Subject: RE: [mapguide-users] Listing Active selected feature C#
Hi Andy & thank you both - Please let me know if you know anything about
this:
It seems that my problem with 'listing selected feature' is not a
programming issue rather then something to do with my environment, or I'm
getting it all wrong.
When Invoking URL, I'm getting the selected features under the following
string, witch is not a known XML format (getting strange xml characters):
[%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A%3CFeature
Set%3E%0A%3CLayer%20id..] Act'.
Then getting an unclassified error 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"
Strangely, When Invoking Script commands on selected featur I get things OK.
<?xml version="1.0" encoding="UTF-8"?>
<FeatureSet>
<Layer id="0fa0e9e4-0000-1000-8002-0018de8d1ec0">
<Class id="Default:Helkot">
<ID>KwAAAA==</ID>
</Class>
</Layer>
</FeatureSet>
_____
From: "Andy Morsell" <amorsell at spatialgis.com>
To: <mapguide-users at lists.osgeo.org>
Subject: RE: [mapguide-users] Listing Active selected feature C#
Date: Sun, 21 Jan 2007 11:14:39 -0800
Greg,
Would it be possible for you to post the example to the
group? The list should accept plain text file attachments or you could
paste it into the message body.
Andy
_____
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Knight,
Gregory
Sent: Sunday, January 21, 2007 10:43 AM
To: Nimrod
Cnaan; mapguide-users at lists.osgeo.org
Subject: RE: [mapguide-users]
Listing Active selected feature C#
I have a C# example where I
am doing exactly this. I can send you the page via separate means if you are
interested.
Greg
_____
From: mapguide-users-bounces at lists.osgeo.org on
behalf of Nimrod Cnaan
Sent: Sat 1/20/2007 9:13 AM
To:
mapguide-users at lists.osgeo.org
Subject: [mapguide-users] Listing
Active selected feature C#
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%3CFeatureS
et%3E%0A%3CLayer%20id%3D%22d6a8101a-ffff-ffff-8003-000000000038%22%3E%0A%3CC
lass%20id%3D%22Default%3AHelkot%22%3E%0A%3CID%3ETAAAAA%3D%3D%3C%2FID%3E%0A%3
CID%3EVwAAAA%3D%3D%3C%2FID%3E%0A%3CID%3EVgAAAA%3D%3D%3C%2FID%3E%0A%3C%2FClas
s%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.htm
l#a8465318
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
_____
The substance of this message, including any attachments, may
be
confidential, legally
privileged and/or exempt from disclosure pursuant
to Massachusetts
law. It is intended
solely for the addressee. If you
received this in error, please
contact the sender and
delete the material
from any computer.
>_______________________________________________
>mapguide-users mailing list
>mapguide-users at lists.osgeo.org
>http://lists.osgeo.org/mailman/listinfo/mapguide-users
_____
Express yourself instantly with MSN Messenger! MSN Messenger
<http://g.msn.com/8HMBEN/2743??PS=47575> Download today it's FREE!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20070126/2d2f8a6c/attachment-0001.html
More information about the mapguide-users
mailing list