[mapguide-users] DWF Viewer API for managing selections

Walt Welton-Lair walt.welton-lair at autodesk.com
Thu May 4 17:43:54 EDT 2006


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/d9f7353b/attachment.html


More information about the Mapguide-users mailing list