<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>DWF Viewer API for managing selections</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2876" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=832031215-03052006>The selection set will be a collection of 
IAdEMapInstance objects.&nbsp; Each object has three 
properties:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=832031215-03052006>&nbsp;&nbsp;&nbsp; - LayerObjectId&nbsp;&nbsp;&nbsp; 
the unique ID of the layer containing the instance</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=832031215-03052006>&nbsp;&nbsp;&nbsp; 
-&nbsp;ObjectClass&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the feature 
class</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=832031215-03052006>&nbsp;&nbsp;&nbsp; - 
Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the 
feature ID</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=832031215-03052006></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=832031215-03052006>You cannot directly access the attributes of features 
through the DWF Viewer API.&nbsp; That's because the viewer only stores data 
(graphical + attributes) for the features currently visible on the screen.&nbsp; 
This is one of the major differences between MapGuide 6.5 and MapGuide OS.&nbsp; 
</SPAN></FONT><FONT face=Arial color=#0000ff size=2><SPAN 
class=832031215-03052006>Note also that the selection set is persistent.&nbsp; 
If you select a feature,&nbsp;pan the view so it's offscreen, and then pan the 
view so its onscreeen again then you'll still see it selected.&nbsp; The 
IAdEMapInstance objects provide the minimum information needed to uniquely 
identify a feature, and are what allow this persistent selection 
behavior.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=832031215-03052006></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=832031215-03052006>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.</SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Joel Carranza [mailto:jec@gatekeeper.com] 
<BR><B>Sent:</B> Tuesday, May 02, 2006 4:02 PM<BR><B>To:</B> 
users@mapguide.osgeo.org<BR><B>Subject:</B> [mapguide-users] DWF Viewer API for 
managing selections<BR></FONT><BR></DIV>
<DIV></DIV><!-- Converted from text/rtf format -->
<P><FONT face=Arial size=2>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&#8217;t know what the type that comes out of the 
collection is. I consulted the "</FONT><FONT face="Times New Roman">Viewer APIs 
for Emap" document but didn&#8217;t see any relevant information.</FONT> </P>
<P><FONT face=Arial size=2>The code I am using is something like the following: 
</FONT></P>
<P><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; var selectionSet = 
emapViewer.SelectionSet;</FONT> <BR><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; 
</FONT><BR><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; for(selEnumerator = new 
Enumerator(selectionSet); !selEnumerator.atEnd(); 
selEnumerator.moveNext())</FONT> <BR><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; 
{</FONT> <BR><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
var feature = selEnumerator.item();</FONT> <BR><FONT face=Arial 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var id = feature.id;</FONT> 
<BR><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var 
layerId = feature.LayerObjectId;</FONT> <BR><FONT face=Arial 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // what is feature? 
</FONT><BR><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 
what are its properties and methods?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</FONT><BR><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; }</FONT> </P>
<P><FONT face=Arial size=2>Specifcally, I want programmatic access to the object 
properties that are shown in the properties pane. Anybody know how to do 
this?</FONT></P>
<P><FONT face="Courier New" size=2>--Joel</FONT> </P><BR></BODY></HTML>