[Cartoweb-users] Problem creating new layers

Nicolás Eugenio Ozimiça nozimica at gmail.com
Thu Jul 17 10:42:32 EDT 2008


You're right!

Here is the code that tries to make visible a new layer (simulacionesGrupo):

    public function filterPostRequest(FilterRequestModifier $request) {
        $layerList = $request->getValue('layers');
        $layerList[] = 'simulacionesGrupo';
        $request->setValue('layers', $layerList);
        $this->tempinfo = implode('--', $layerList);
    }

it is in the Client part of a plugin that implements FilterProvider.

To create the layer:

    function initializeRequest($requ) {
        if ($requ) {
            $pluginManager = $this->serverContext->getPluginManager();

            if (empty($pluginManager->mapOverlay))
                throw new CartoserverException("mapOverlay plugin not
loaded, ");

            $mapOverlay = $pluginManager->mapOverlay;
            $layer = new LayerOverlay();
            $layer->name = "simulacionesGrupo";
            $layer->action = BasicOverlay::ACTION_INSERT;
            $layer->data = "raster/ozono.99.tif";
            $result = $mapOverlay->updateMap($layer);
        }
    }

it is in the Server part of the same plugin that extends
ClientResponderAdapter.

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':
; mapInfo.initialMapStates.default.layers.simulacionesGrupo.selected = true

it doesn't show up in the main map.



On Thu, Jul 17, 2008 at 10:25 AM, Oliver Christen <
oliver.christen at camptocamp.com> wrote:

>  Hi
>
> without looking at your code, I cant really know what may or may not
> happens.
>
> regards
> Oliver
>
> ----- Original Message -----
> *From:* Nicolás Eugenio Ozimiça <nozimica at gmail.com>
> *To:* cartoweb-users at lists.maptools.org
> *Sent:* Thursday, July 17, 2008 4:16 PM
> *Subject:* [Cartoweb-users] Problem creating new layers
>
> Hi all!
>
> 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.
>
> 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...
>
> I hope someone could help!
> Thanks in advance!
>
> --
> Nicolás Eugenio Ozimiça
> Universidad de Chile
>
> ------------------------------
>
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users
>
>


-- 
Nicolás Eugenio Ozimiça
Universidad de Chile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20080717/f554e0f0/attachment-0001.html


More information about the Cartoweb-users mailing list