[mapguide-users] Bug in SetSelection?
Chris Claydon
chris.claydon at autodesk.com
Tue Feb 13 12:09:26 EST 2007
Hi Jim,
The trouble is that the properties are retrieved by calling
QueryFeatures using a spatial filter based on the geometry of the
selected feature. The properties correspond to the first object that
satisfies the criteria, which can sometimes be an adjacent feature.
I'm looking into a way to solve this, though it may require a new API
method. In the meantime, it is possible to fix the problem in most cases
by modifying the template code to use the centroid of the geometry
instead of the full geometry.
I posted information on the newsgroup about how to do this a while ago,
but if you can't find it I'll dig it up and re-post it.
Chris.
-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Jim O'Leary
Sent: February 13, 2007 8:54 AM
To: mapguide-users at lists.osgeo.org
Subject: [mapguide-users] Bug in SetSelection?
Is there a bug in the SetSelectionXML function? When you call it
programmatically, the Properties table returns the XML for an adjacent
feature, not the feature you have selected.
I have made a demo of this bug at
http://204.244.79.27/mapguide/devguide/working_with_feature_data/ajax.ph
p. I
have changed the filter behind the Set active selection link so it only
retrieves one parcel, ID 603510. Clicking this link selects a parcel on
the
map, which triggers an Ajax lookup that displays the properties for this
parcel in the Properties table.
However, the properties that display are actually for the parcel to the
left
of the selected parcel, ID 603520. You can verify this by clicking on
that
parcel to the left. That parcel's ID in the Properties table displays as
603520. Clicking back on the parcel to the right now displays ID 60310,
the
correct ID for this parcel.
The problem appears to occur in the SetSelection() function in
ajaxmappane.templ, around line 2349. The function makes an Ajax call to
setselection.php, sending it XML containing the ID of the selection.
However, the XML that returns from this call contains the ID and
properties
of the adjacent parcel.
When the user clicks directly on the map, the selection is correct. This
selection is created by another process.
You can work around this problem by clearing the property table after
the
selectionXML, like this:
mapFrame.SetSelectionXML(selectionXML);
// From the taskpane frame.
parent.parent.mapFrame.GetPropertyCtrl().SetProperties(0);
--
View this message in context:
http://www.nabble.com/Bug-in-SetSelection--tf3221393s16610.html#a8946749
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
More information about the mapguide-users
mailing list