<!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> </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> </DIV>
<DIV><FONT face=Arial size=2>This is the code I have:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> $queryResultlayer =
ms_newLayerObj( $oMap );<BR>
$queryResultlayer->set( "name", "Queryresult"
);<BR> $queryResultlayer->set( "type",
$shapetype );<BR> $queryResultlayer->set(
"status", MS_ON );<BR> $queryResultlayer->set(
"data",
$szSessionDir."/queryResultShapefile");<BR>
$queryResultlayer->set( "template", "ttt"
);<BR> $queryResultlayer->set( "tolerance", 5
);<BR> $queryResultlayer->set(
"toleranceunits", MS_PIXELS);<BR>
$queryResultlayer->setProjection($mapprojection);<BR>
$queryclass =
ms_newClassObj($queryResultlayer);<BR>
$queryclass->set("name", "Query result"); <BR>
$queryclass->set("status", MS_ON);<BR> $style =
ms_newStyleObj($queryclass);<BR>
$style->color->setRGB(255, 255, 0);<BR>
$style->outlinecolor->setRGB(255, 0, 0);</FONT></DIV>
<DIV> </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> </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> </DIV>
<DIV><FONT face=Arial size=2>$oMap =& $oMapSession->oMap;</FONT></DIV>
<DIV> </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> </DIV>
<DIV><FONT face=Arial size=2>Any help would be much appreciated.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Regards,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Jacob</FONT></DIV>
<DIV> </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> </DIV>
<DIV>Tel + 61 8 9281 6185<BR>Fax + 61
8 9281 6297<BR><A
href="mailto:jacob.delfos@maunsell.com">jacob.delfos@maunsell.com</A><BR></FONT></DIV></BODY></HTML>