[mapguide-users] Selection in Fusion

Berdel, Brian brian.berdel at mcmtrans.com
Tue Dec 30 14:06:32 EST 2008


Here is the server side code I use to generate the selection and
selectionXML to pass to the client, hope this helps. 

 

 

{ 

    InitializeWebTier(); 

    MgUserInformation userInfo = new MgUserInformation(mgSessionId); 

    MgSiteConnection siteConnection = new MgSiteConnection(); 

    siteConnection.Open(userInfo); 

    MgResourceService resService =
(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceSe
rvice); 

    MgFeatureService featureService =
(MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureServ
ice); 

    MgMap map = new MgMap(); 

    map.Open(resService, mapname); 

    MgLayer layer = (MgLayer)map.GetLayers().GetItem(queryLayer); 

    MgResourceIdentifier resId = new
MgResourceIdentifier(layer.GetFeatureSourceId()); 

    MgFeatureQueryOptions queryOption = new MgFeatureQueryOptions(); 

    queryOption.SetFilter(queryString); 

    MgFeatureReader featureReader = featureService.SelectFeatures(resId,
queryLayer, queryOption); 

    MgSelection selection = new MgSelection(map); 

    selection.AddFeatures(layer, featureReader, 0); 

    string selectionXML = null; 

    selectionXML = selection.ToXml(); 

    selection.Save(resService, mapname); 

    map.Save(); 

    featureReader.Close(); 

    return selectionXML; 

}

Brian 

 

 

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Mark
Pendergraft
Sent: Tuesday, December 30, 2008 1:03 PM
To: MapGuide Users Mail List
Subject: RE: [mapguide-users] Selection in Fusion

 

Thanks for the reply, I did have a null value in one of my fields which
kind of fixed the problem.  I'm still having an issue with selection and
Fusion.  After fixing the problem with the null values in the feature
source, my feature shows up as being selected on the map (aka
highlighted) but it does not show up in the status bar as being selected
or in the selection pane.  I am also unable to clear the selection.

Is their additional server side code that I need to run in order to tell
the map there is a selection, or is there something client-side maybe?

 

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Berdel,
Brian
Sent: Wednesday, December 24, 2008 12:42 PM
To: MapGuide Users Mail List
Subject: RE: [mapguide-users] Selection in Fusion

 

I had that problem before...It had to do with either null values in data
fields or a column name...

 

Brian 

 

________________________________

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Mark
Pendergraft
Sent: Tuesday, December 23, 2008 7:21 PM
To: MapGuide Users Mail List
Subject: [mapguide-users] Selection in Fusion

 

I'm using MGOS 2.02 and IIS 7 on Vista x64.  I'm having problems setting
the selection in fusion.

 

I step through the code and get this error in  fusion.js at
ajaxException:

 

SetSelection Exception: An unclassified exception occurred.

Exception occurred in method MgSelectionBase_FromXml at line 12308 in
file .\MgApi_wrap.cpp

 

Everything seems to be in order, i just can't seem to figure out what is
causing it to break.

My selection xml is as follows:

 

<?xml version="1.0" encoding="UTF-8"?><FeatureSet
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="FeatureSet-1.0.0.xsd"> <Layer
id="75d6a8aa-0000-1000-8002-0021706d98cf">  <Class id="Default:Jobs">
<ID>AQAAAA==</ID>  </Class> </Layer></FeatureSet>

 

Is anyone else having this problem with setting the selection?

 

PLEASE HELP!!!!

Thanks.

-Mark Pendergraft

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20081230/81d33b6b/attachment.html


More information about the mapguide-users mailing list