<div dir="ltr">I've tried what you told me Oliver, but with no success.<br><br>With the lines you gave:<br>$msLayer =
$this->serverContext->getMapObj()->getLayer($result->layers[0]->index);<br>$msLayer->set('status',
MS_ON);<br><br>I also included these other lines:<br>$msLayer->set('type', MS_LAYER_RASTER);<br>$msLayer->setProcessing("BANDS=1,2,3");<br><br>because the layer I try to create is a raster image.<br>
<br>The only solution I see is having a set of empty layers in the mapfile (and also in the layers.ini), hidden from the menu layer tree, that when a user specifies a raster to be shown, is "put" in the first empty layer available. But this is something here we don't like very much.<br>
<br>I'm using ajax, but I made a test without it, and no result either...<br><br>Has someone else had trouble tring to create a raster layer with MapOverlay?<br><br><br><div class="gmail_quote">On Fri, Jul 18, 2008 at 2:42 AM, Oliver Christen <<a href="mailto:oliver.christen@camptocamp.com">oliver.christen@camptocamp.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff">
<div><font size="2">By the way, inserting a layer via mapOverlay only create a new
layer on the map image, it will not create a new entry in the menu layer
tree.</font></div>
<div><font size="2">Layers in the layer tree can only be selected/unselected if
they already exist in your layers.ini, as far as I know.</font></div>
<div><font size="2"></font> </div>
<div><font size="2">You could eventualy use the same mecanism as the
ogcLayerLoader and trigger layer insertion via the use of the userLayers
variable. See ClientOgcLayerLoader, the parts around $userLayer = new
UserLayer();</font></div>
<div><font size="2"></font> </div>
<div><font size="2">I have never do that myself but I presume it should be
possible.</font></div>
<div><font size="2"></font> </div>
<div><font size="2">regards</font></div>
<div><font size="2">Oliver</font></div><font color="#888888">
</font><blockquote dir="ltr" style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;"><div class="Ih2E3d">
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">----- Original Message ----- </div>
<div style="background: rgb(228, 228, 228) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<b>From:</b>
<a title="nozimica@gmail.com" href="mailto:nozimica@gmail.com" target="_blank">Nicolás Eugenio
Ozimiça</a> </div>
</div><div><div></div><div class="Wj3C7c"><div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<b>To:</b> <a title="oliver.christen@camptocamp.com" href="mailto:oliver.christen@camptocamp.com" target="_blank">Oliver Christen</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Cc:</b> <a title="cartoweb-users@lists.maptools.org" href="mailto:cartoweb-users@lists.maptools.org" target="_blank">cartoweb-users@lists.maptools.org</a>
</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b> Thursday, July 17, 2008 4:42
PM</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Subject:</b> Re: [Cartoweb-users] Problem
creating new layers</div>
<div><br></div>
<div dir="ltr">You're right! <br><br>Here is the code that tries to make visible
a new layer (simulacionesGrupo):<br><br> public function
filterPostRequest(FilterRequestModifier $request)
{<br> $layerList =
$request->getValue('layers');<br>
$layerList[] =
'simulacionesGrupo';<br>
$request->setValue('layers', $layerList);
<br> $this->tempinfo =
implode('--', $layerList);<br> } <br><br>it is in the Client
part of a plugin that implements FilterProvider.<br><br>To create the
layer:<br><br> function initializeRequest($requ)
{<br> if ($requ)
{<br>
$pluginManager =
$this->serverContext->getPluginManager();<br><br>
if
(empty($pluginManager->mapOverlay))<br>
throw new CartoserverException("mapOverlay plugin not loaded,
");<br><br>
$mapOverlay =
$pluginManager->mapOverlay;<br>
$layer = new
LayerOverlay();<br>
$layer->name =
"simulacionesGrupo";<br>
$layer->action =
BasicOverlay::ACTION_INSERT;<br>
$layer->data =
"raster/ozono.99.tif";<br>
$result =
$mapOverlay->updateMap($layer);<br>
}<br> }<br><br>it is in the Server part of the same plugin
that extends ClientResponderAdapter.<br><br>Anyway, if the "simulacionesGrupo"
layer is defined in the mapfile, and the line with ACTION_INSERT is not used
in the last piece of code, and the next line is commented in
'layers.ini':<br>;
mapInfo.initialMapStates.default.layers.simulacionesGrupo.selected =
true<br><br>it doesn't show up in the main map.<br><br><br><br>
<div class="gmail_quote">On Thu, Jul 17, 2008 at 10:25 AM, Oliver Christen
<<a href="mailto:oliver.christen@camptocamp.com" target="_blank">oliver.christen@camptocamp.com</a>>
wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff">
<div><font size="2">Hi</font></div>
<div><font size="2"></font> </div>
<div><font size="2">without looking at your code, I cant really know what may
or may not happens.</font></div>
<div><font size="2"></font> </div>
<div><font size="2">regards</font></div>
<div><font size="2">Oliver</font></div>
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div>
<div></div>
<div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">-----
Original Message ----- </div>
<div style="background: rgb(228, 228, 228) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<b>From:</b>
<a title="nozimica@gmail.com" href="mailto:nozimica@gmail.com" target="_blank">Nicolás Eugenio Ozimiça</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>To:</b>
<a title="cartoweb-users@lists.maptools.org" href="mailto:cartoweb-users@lists.maptools.org" target="_blank">cartoweb-users@lists.maptools.org</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b>
Thursday, July 17, 2008 4:16 PM</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Subject:</b>
[Cartoweb-users] Problem creating new layers</div>
<div><br></div>
<div dir="ltr">Hi all!<br><br>I'm using the 'mapOverlay' plugin in order to
modify the layers of my project. It has worked well to modify existing
layers, but when I try to insert a new one, it simply does
nothing.<br><br>Perhaps it is related to another problem I'm facing: I can
only hide a layer with "FilterProvider". If I try to make visible a layer
that is not set as visible by default in the "layers.ini" file, nothing
happens...<br><br>I hope someone could help!<br>Thanks in advance!<br clear="all"><br>-- <br>Nicolás Eugenio Ozimiça<br>Universidad de Chile
</div></div></div>
<p></p>
<hr>
<p></p>_______________________________________________<br>Cartoweb-users
mailing list<br><a href="mailto:Cartoweb-users@lists.maptools.org" target="_blank">Cartoweb-users@lists.maptools.org</a><br><a href="http://lists.maptools.org/mailman/listinfo/cartoweb-users" target="_blank">http://lists.maptools.org/mailman/listinfo/cartoweb-users</a><br>
</blockquote></div></blockquote></div><br><br clear="all"><br>-- <br>Nicolás Eugenio Ozimiça<br>Universidad de Chile
</div></div></div></blockquote></div>
</blockquote></div><br><br clear="all"><br>-- <br>Nicolás Eugenio Ozimiça<br>Universidad de Chile
</div>