[mapguide-users] DWF Viewer API for managing selections
Joel Carranza
jec at gatekeeper.com
Thu May 4 18:11:46 EDT 2006
My end goal is to emulate 6.5 behavior in that i need to able to select
objects via map key and get the selected objects's map key. The problem I
see is that the feature ID appears to be some kind of internal ID and not
related back to a user specified property of the feature source (say for
example the PK of the database row). As such, I have no way to tie my data
to a feature on the map. Making an additional server side call seems kindof
ridiculous.
So my question is this:
- Can I somehow configure what the feature ID of a feature source is based
on? How do you currently generate feature IDs ?
- We are willing to accept the limitation of only selecting/getting the
selection of onscreen objects. How can I access attribute data for the
features that are currently visible on the screen?
Thanks,
--Joel
_____
From: Walt Welton-Lair [mailto:walt.welton-lair at autodesk.com]
Sent: Thursday, May 04, 2006 2:44 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] DWF Viewer API for managing selections
The selection set will be a collection of IAdEMapInstance objects. Each
object has three properties:
- LayerObjectId the unique ID of the layer containing the instance
- ObjectClass the feature class
- Id the feature ID
You cannot directly access the attributes of features through the DWF Viewer
API. That's because the viewer only stores data (graphical + attributes)
for the features currently visible on the screen. This is one of the major
differences between MapGuide 6.5 and MapGuide OS. Note also that the
selection set is persistent. If you select a feature, pan the view so it's
offscreen, and then pan the view so its onscreeen again then you'll still
see it selected. The IAdEMapInstance objects provide the minimum
information needed to uniquely identify a feature, and are what allow this
persistent selection behavior.
If you want to obtain the attributes of a feature, then you'll need to go
beyond the DWF Viewer API and make a SelectFeatures feature service request.
_____
From: Joel Carranza [mailto:jec at gatekeeper.com]
Sent: Tuesday, May 02, 2006 4:02 PM
To: users at mapguide.osgeo.org
Subject: [mapguide-users] DWF Viewer API for managing selections
I am trying to write some code to inspect the current selection using the
DWF Viewer. However, I am unable to find any documentation on what comes out
of the "selectionSet" property of the viewer. I see that it is a collection
of some kind, but I don't know what the type that comes out of the
collection is. I consulted the "Viewer APIs for Emap" document but didn't
see any relevant information.
The code I am using is something like the following:
var selectionSet = emapViewer.SelectionSet;
for(selEnumerator = new Enumerator(selectionSet);
!selEnumerator.atEnd(); selEnumerator.moveNext())
{
var feature = selEnumerator.item();
var id = feature.id;
var layerId = feature.LayerObjectId;
// what is feature?
// what are its properties and methods?
}
Specifcally, I want programmatic access to the object properties that are
shown in the properties pane. Anybody know how to do this?
--Joel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide_users/attachments/20060504/7f043b53/attachment.html
More information about the Mapguide_users
mailing list