<!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>MgSelection does not work</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Can anybody tell me why the following PHP code des not work - using MapGuide 2010? Everything works like a charm, except the MgSelection in the end is not created.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Thanks for any help,</FONT>
<BR><FONT SIZE=2 FACE="Arial">Gido </FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Arial">$sessionId = $args['SESSION'];</FONT>
<BR><FONT SIZE=2 FACE="Arial">$mapName = $args['MAPNAME'];</FONT>
<BR><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">$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('parcels');</FONT>
<BR><FONT SIZE=2 FACE="Arial">$parcelQuery = new MgFeatureQueryOptions();</FONT>
<BR><FONT SIZE=2 FACE="Arial">$parcelQuery->SetFilter("PLANNO = '" . $planNo . "'");</FONT>
<BR><FONT SIZE=2 FACE="Arial">$featureReader = $layer->SelectFeatures($parcelQuery);</FONT>
<BR><FONT SIZE=2 FACE="Arial">$selection = new MgSelection($map); </FONT>
<BR><FONT SIZE=2 FACE="Arial">$selection->AddFeatures($layer, $featureReader, 0);</FONT>
</P>
<BR>
<BR>
</BODY>
</HTML>