<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV>Hi ,</DIV>
<DIV> Do the Following to get going with the Sample GT Application on MGOS2.1.0 (API Change).</DIV>
<DIV> </DIV>
<DIV> 1.Query Task--Change the <STRONG><U>query.php</U></STRONG> File</DIV>
<DIV> 2.Theme Task-No Change works perfectly ok</DIV>
<DIV> 3.Markup Task-Change the <STRONG>markupeditor.php</STRONG> File</DIV>
<DIV> </DIV>
<DIV>-------------------------------------------------------------------------------------------------------</DIV>
<DIV>1.<STRONG> Change the<U> function Execute()</U> in the query.php file at</STRONG> C:\ProgramFiles\MapGuideOpenSource2.\WebServerExtensions\www\phpviewersample\query\classes <BR></DIV>
<DIV> </DIV>
<DIV>function Execute()<BR>{<BR> $result = array();<BR> $resourceService =<BR> $this->site->CreateService(MgServiceType::ResourceService);<BR> $map = new MgMap();<BR> $map->Open($resourceService, $this->args['MAPNAME']);<BR> $layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);<BR> $featureService =<BR> $this->site->CreateService(MgServiceType::FeatureService);<BR> $resId = new MgResourceIdentifier($layer->GetFeatureSourceId());<BR> $featureClass = $layer->GetFeatureClassName();<BR> $featureGeometry = $layer->GetFeatureGeometryName();</DIV>
<DIV><BR> // Initialize the coordinate system transform<BR> $schemaAndClass = explode(":", $featureClass);<BR> $classDef = $featureService->GetClassDefinition($resId,<BR> $schemaAndClass[0], $schemaAndClass[1]);<BR> $geomProp = $classDef->GetProperties()->GetItem($featureGeometry);<BR> $spatialContext = $geomProp->GetSpatialContextAssociation();<BR> $csTransform = null;<BR> $csInverseTransform = null;<BR> $coordSysFactory = new MgCoordinateSystemFactory();<BR> $scReader = $featureService->GetSpatialContexts($resId, false);<BR> while ($scReader->ReadNext() && $csTransform == null)<BR> {<BR> if ($scReader->GetName() == $spatialContext)<BR> {<BR> $source =<BR> $coordSysFactory->Create($scReader->GetCoordinateSystemWkt());<BR> $target =
$coordSysFactory->Create($map->GetMapSRS());<BR> <BR> <FONT color=#ff0000>$csTransform=$coordSysFactory->GetTransform($source, $target);<BR> $csInverseTransform=$coordSysFactory->GetTransform($target, $source);</FONT></DIV>
<DIV><FONT color=#ff0000><BR></FONT> //$csTransform = new MgCoordinateSystemTransform($source, $target);<BR> //$csInverseTransform = new MgCoordinateSystemTransform($target, $source);<BR> <BR> }<BR> }<BR></DIV>
<DIV>------------------------------------------------------------------------------------------------</DIV>
<DIV><STRONG>3. Change function <U>GetTransform()</U> in the markupeditor.php file at</STRONG></DIV>
<DIV>C:\ProgramFiles\MapGuideOpenSource2.\WebServerExtensions\www\phpviewersample\markup\classes </DIV>
<DIV> </DIV>
<DIV>function GetTransform()<BR> {<BR> $coordSysFactory = new MgCoordinateSystemFactory();<BR> $resourceService =<BR> $this->site->CreateService(MgServiceType::ResourceService);<BR> <BR> $map = new MgMap();<BR> $map->Open($resourceService, $this->args['MAPNAME']);<BR> <BR> $source = $coordSysFactory->Create($map->GetMapSRS()); <BR> $target = $coordSysFactory->Create(MarkupManager::LL84WKT);</DIV>
<DIV> </DIV>
<DIV> <FONT color=#ff0000>return $coordSysFactory->GetTransform($source, $target); </FONT></DIV>
<DIV><BR> // return new MgCoordinateSystemTransform($source, $target);<BR> }<BR><BR>-----------------------------------------------------------------------------------------------</DIV>
<DIV> </DIV>
<DIV>Cheers </DIV>
<DIV>Max !!</DIV><BR><BR>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Original Message ----<BR>From: Jason Birch <Jason.Birch@nanaimo.ca><BR>To: MapGuide Users Mail List <mapguide-users@lists.osgeo.org><BR>Sent: Tuesday, June 3, 2008 11:52:21 AM<BR>Subject: RE: [mapguide-users] Shareable query<BR><BR>querycontroller.php is erroring out on you on the site you posted earier -- 127.0.0.1 didn't work for me :)<BR><BR>Anything in the apache error log, or in the php error log (assuming you have it enabled)?<BR><BR>Once you get this all working, it would be great to see a trac ticket describing what was wrong with the GT sample, and what you did to fix it:<BR><BR><A href="http://trac.osgeo.org/mapguide/wiki/SubmitTicket" target=_blank>http://trac.osgeo.org/mapguide/wiki/SubmitTicket</A> <<A href="http://trac.osgeo.org/mapguide/wiki/SubmitTicket" target=_blank>http://trac.osgeo.org/mapguide/wiki/SubmitTicket</A>>
<BR><BR>Jason<BR><BR>________________________________<BR><BR>From: erictsn <mailto:<A href="mailto:erictsn@cadbeyond.com" ymailto="mailto:erictsn@cadbeyond.com">erictsn@cadbeyond.com</A>> <BR>Subject: [mapguide-users] Shareable query<BR><BR>Now I working on query functionality. It can't to query the result. DO you<BR>have idea? I have captured a sort of access.log file:<BR><BR><BR></DIV></DIV></div><br>
</body></html>