[Cartoweb-users] find the layer name using its layerId of the layers.ini file

Jacolin Yves yjacolin at free.fr
Wed Jul 26 10:13:48 EDT 2006


Hi,
Ok I found it. I wrote here for "posterity"/history :-D :

This code return all informations about a layer of the mapfile usilng the 
layerId (the one in layers.ini)
function getInformation($layerId) {
$msMapObj = $this->serverContext->getMapObj();
$layersInit = $this->serverContext->getMapInfo()->layersInit;
return 
$msMapObj->getLayerByName($layersInit->getLayerById($layerId)->msLayer);
}

Y.
PS : if it is wrong thanks to correct me ;-)

Le Mercredi 26 Juillet 2006 15:33, Jacolin Yves a écrit :
> Bonjour,
> I need to get the msLayer using the layerIdof the layers.ini file.
>
> For exemple :
> layers.Lcom_centre.className = Layer
> layers.Lcom_centre.label = Com centre
> layers.Lcom_centre.msLayer = com_centre
>
> I want to get com_centre after calling a method with Lcom_centre in
> parameter.
>
> In other word,  I need to know in which array/variable the layers.ini
> containt is.
>
> Thank you for any idea.
>
> Y.

-- 
Yves Jacolin
http://yjacolin.gloobe.org
----
Stagiaire Conservatoire Régional des Espaces Naturels de la région Centre
http://cahiersnaturalistes.free.fr/cpnrc/
----
- Qu'est-ce que cela peut faire que je lutte pour la mauvaise cause 
puisque je suis de bonne foi?
- Et qu'est-ce que ça peut faire que je sois de mauvaise foi
puisque c'est pour la bonne cause. (Jacques Prévert)



More information about the Cartoweb-users mailing list