<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>Highlighting selected features</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">I want to highlight selected features. I have pretty much copied the code from the documentation. But it doesn't work. Below is the code. Aside from not highlighting the selected feature, I do not understand why the line "<br>XML: <? echo $selectionXML; ?>" in the code does not print the XML block that I would expect. At appears to me that the "$selection->ToXML" request doesn't create output. </FONT></P>
<P><FONT SIZE=2 FACE="Arial">Can anybody help?</FONT>
<BR><FONT SIZE=2 FACE="Arial">Gido</FONT>
</P>
<BR>
<BR>
<BR>
<P><FONT SIZE=2 FACE="Arial"><?</FONT>
<BR><FONT SIZE=2 FACE="Arial">include '../mapviewerphp/common.php';</FONT>
<BR><FONT SIZE=2 FACE="Arial">include '../mapviewerphp/constants.php';</FONT>
<BR><FONT SIZE=2 FACE="Arial">$configFilePath = '../webconfig.ini';</FONT>
<BR><FONT SIZE=2 FACE="Arial"> </FONT>
<BR><FONT SIZE=2 FACE="Arial">MgInitializeWebTier($configFilePath);</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">$args = ($_SERVER['REQUEST_METHOD'] == "POST")? $_POST : $_GET;</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">$sessionId = $args['SESSION'];</FONT>
<BR><FONT SIZE=2 FACE="Arial">$mapName = $args['MAPNAME'];</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">$userInfo = new MgUserInformation($sessionId);</FONT>
<BR><FONT SIZE=2 FACE="Arial">$siteConnection = new MgSiteConnection();</FONT>
<BR><FONT SIZE=2 FACE="Arial">$siteConnection->Open($userInfo);</FONT>
<BR><FONT SIZE=2 FACE="Arial">?></FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"><html></FONT>
<BR><FONT SIZE=2 FACE="Arial"><head> <title> TEST </title> </head></FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"><body onLoad="OnPageLoad"></FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"><?</FONT>
<BR><FONT SIZE=2 FACE="Arial">$map = new MgMap($siteConnection);</FONT>
<BR><FONT SIZE=2 FACE="Arial">$map->Open($mapName);</FONT>
<BR><FONT SIZE=2 FACE="Arial">$layer = $map->GetLayers()->GetItem('peguis');</FONT>
<BR><FONT SIZE=2 FACE="Arial">$layerName = $layer->GetName();</FONT>
<BR><FONT SIZE=2 FACE="Arial">$parcelQuery = new MgFeatureQueryOptions();</FONT>
<BR><FONT SIZE=2 FACE="Arial">$parcelQuery->SetFilter("PIN = 1092213");</FONT>
<BR><FONT SIZE=2 FACE="Arial">$featureReader = $layer->SelectFeatures($parcelQuery);</FONT>
<BR><FONT SIZE=2 FACE="Arial">$featureReader->ReadNext();</FONT>
<BR><FONT SIZE=2 FACE="Arial">$attVal = $featureReader->GetString("PARCELDESI");</FONT>
<BR><FONT SIZE=2 FACE="Arial">$selection = new MgSelection($map);</FONT>
<BR><FONT SIZE=2 FACE="Arial">$selection->AddFeatures($layer, $featureReader, 0);</FONT>
<BR><FONT SIZE=2 FACE="Arial">$selectionXML = $selection->ToXml;</FONT>
<BR><FONT SIZE=2 FACE="Arial">?></FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"><br>Test: <? echo $attVal; ?> </FONT>
<BR><FONT SIZE=2 FACE="Arial"><br>XML: <? echo $selectionXML; ?></FONT>
<BR><FONT SIZE=2 FACE="Arial"></body></FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"><script language="javascript" type="text/javascript"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> function OnPageLoad() {</FONT>
<BR><FONT SIZE=2 FACE="Arial"> selXML = '<? echo $selectionXML; ?></FONT>
<BR><FONT SIZE=2 FACE="Arial"> parent.parent.mapFrame.SetSelectionXML(selXML);</FONT>
<BR><FONT SIZE=2 FACE="Arial"> }</FONT>
<BR><FONT SIZE=2 FACE="Arial"></script></FONT>
<BR><FONT SIZE=2 FACE="Arial"></html></FONT>
</P>
</BODY>
</HTML>