<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1498" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi All,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I am trying to dynamically add a shapefile which I 
created at runtime. The shapefile is created successfully (it opens up ok). But 
I am not having any luck adding it as a layer.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>This is the code I have:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $queryResultlayer = 
ms_newLayerObj( $oMap );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$queryResultlayer-&gt;set( "name", "Queryresult" 
);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $queryResultlayer-&gt;set( "type", 
$shapetype );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $queryResultlayer-&gt;set( 
"status", MS_ON );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $queryResultlayer-&gt;set( 
"data", 
$szSessionDir."/queryResultShapefile");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$queryResultlayer-&gt;set( "template", "ttt" 
);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $queryResultlayer-&gt;set( "tolerance", 5 
);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $queryResultlayer-&gt;set( 
"toleranceunits", MS_PIXELS);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$queryResultlayer-&gt;setProjection($mapprojection);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$queryclass = 
ms_newClassObj($queryResultlayer);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$queryclass-&gt;set("name", "Query result"); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$queryclass-&gt;set("status", MS_ON);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $style = 
ms_newStyleObj($queryclass);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$style-&gt;color-&gt;setRGB(255, 255, 0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$style-&gt;outlinecolor-&gt;setRGB(255, 0, 0);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The layer is not showing (extents of map are 
correct). I am not getting any errors either. The temporary mapfile being 
created in the session directory does not contain my layer. Am I missing 
something?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The $oMap object is a reference to the $oMap from 
the session (using Chameleon). I am loading the session from an Iframe, and 
creating the $oMap object like:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>$oMap =&amp; $oMapSession-&gt;oMap;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>So if I add a layer to the map object, the layer 
should show if the map image is reloaded in the main frame, right?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Any help would be much appreciated.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Regards,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Jacob</FONT></DIV>
<DIV>&nbsp;</DIV><FONT face=Arial size=2>
<DIV><BR>JACOB DELFOS<BR>SPATIAL INFORMATION ANALYST<BR>Maunsell Australia Pty 
Ltd<BR>629 Newcastle Street, Leederville, WA 6007<BR>PO Box 81, Leederville, WA 
6902<BR>Western Australia<BR>ABN 20 093 846 925</DIV>
<DIV>&nbsp;</DIV>
<DIV>Tel &nbsp;&nbsp;&nbsp;&nbsp;+ 61 8 9281 6185<BR>Fax&nbsp;&nbsp;&nbsp; + 61 
8 9281 6297<BR><A 
href="mailto:jacob.delfos@maunsell.com">jacob.delfos@maunsell.com</A><BR></FONT></DIV></BODY></HTML>