[mapguide-users] DWF Viewer API for managing selections

Jason Birch Jason.Birch at nanaimo.ca
Thu May 4 17:59:48 EDT 2006


I haven't tried this yet, but I'd imagine that getting the attributes
could by done with some kind of custom web service.
 
You could either have the service render JavaScript and load it in one
of the hidden frames, or you could use AJAX and make an XMLHTTP request
directly to the service.
 
The facilities for doing this may already be there in the AJAX viewer?
 
Jason

________________________________

From: Walt Welton-Lair [mailto:walt.welton-lair at autodesk.com] 
Sent: Thursday, May 04, 2006 14:44
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/74362165/attachment.html


More information about the Mapguide-users mailing list