<!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.2873" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=735501822-04052006><FONT face=Arial
color=#0000ff size=2>Whoops, sorry, my brain just went on temporary
holiday. Ignore that last message. </FONT></SPAN><SPAN
class=735501822-04052006><FONT face=Arial color=#0000ff size=2>The feature IDs
ARE based on the PK of the ODBC datasource (presumably this works the same way
in the Oracle FDO as well). Perfect. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=735501822-04052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=735501822-04052006><FONT face=Arial
color=#0000ff size=2>So given a layer and a featureID, how do I get a
reference to the appropriate IAdEMapInstance object to add to the selection set?
</FONT></SPAN></DIV>
<DIV class=Section1>
<DIV>
<DIV>
<DIV>
<DIV>
<P class=MsoAutoSig><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">--Joel<?xml:namespace prefix
= o ns = "urn:schemas-microsoft-com:office:office"
/><o:p></o:p></SPAN></P></DIV>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><o:p> </o:p></P></DIV></DIV></DIV></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></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> Thursday, May 04, 2006 3:12 PM<BR><B>To:</B>
users@mapguide.osgeo.org<BR><B>Subject:</B> RE: [mapguide-users] DWF Viewer API
for managing selections<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=552535021-04052006><FONT face=Arial
color=#0000ff size=2>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. </FONT></SPAN><SPAN
class=552535021-04052006><FONT face=Arial color=#0000ff size=2>Making an
additional server side call seems kindof ridiculous. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=552535021-04052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=552535021-04052006><FONT face=Arial
color=#0000ff size=2>So my question is this:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=552535021-04052006><FONT face=Arial
color=#0000ff size=2>- Can I somehow configure what the feature ID of a feature
source is based on? How do you currently generate feature IDs ?
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=552535021-04052006><FONT face=Arial
color=#0000ff size=2>- 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?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=552535021-04052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=552535021-04052006><FONT face=Arial
color=#0000ff size=2>Thanks,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=552535021-04052006><FONT face=Arial
color=#0000ff size=2>--Joel</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Walt Welton-Lair
[mailto:walt.welton-lair@autodesk.com] <BR><B>Sent:</B> Thursday, May 04, 2006
2:44 PM<BR><B>To:</B> users@mapguide.osgeo.org<BR><B>Subject:</B> RE:
[mapguide-users] DWF Viewer API for managing selections<BR></FONT><BR></DIV>
<DIV></DIV>
<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. Each object has three
properties:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=832031215-03052006> - LayerObjectId
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>
- ObjectClass the feature
class</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=832031215-03052006> -
Id the
feature ID</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=832031215-03052006></SPAN></FONT> </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. 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.
</SPAN></FONT><FONT face=Arial color=#0000ff size=2><SPAN
class=832031215-03052006>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.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=832031215-03052006></SPAN></FONT> </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’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’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> var selectionSet =
emapViewer.SelectionSet;</FONT> <BR><FONT face=Arial size=2>
</FONT><BR><FONT face=Arial size=2> for(selEnumerator = new
Enumerator(selectionSet); !selEnumerator.atEnd();
selEnumerator.moveNext())</FONT> <BR><FONT face=Arial size=2>
{</FONT> <BR><FONT face=Arial size=2>
var feature = selEnumerator.item();</FONT> <BR><FONT face=Arial
size=2> var id = feature.id;</FONT>
<BR><FONT face=Arial size=2> var
layerId = feature.LayerObjectId;</FONT> <BR><FONT face=Arial
size=2> // what is feature?
</FONT><BR><FONT face=Arial size=2> //
what are its properties and methods?
</FONT><BR><FONT face=Arial size=2> }</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>