[Cartoweb-users] Plugin Layer / AddUserLayer
François Prunayre
fx.prunayre at oieau.fr
Tue Oct 10 01:53:14 EDT 2006
Hi list, I'm having problem when adding wms layers and setting layer name
when a layer with the same name is already in the mapfile.
Currently, the layer plugin is doing that when it try to set the layer name
:
if (!empty($msLayer)) $layer->label = $msLayer->getMetadata('wms_title');
if (empty($layer->label)) $layer->label = $layer->id;
But sometimes, user could load a layer using a WmsBrowserX interface ... and
wms_name could be equal to a layer which is already in the mapfile. In that
case, we could get the wms_title of the previous layer in the mapfile.
Because the $msMapObj->getLayerByName return only one layer. (Maybe we
should not be able to add a layer with the same name)
I would have prefer to be able to force the layer label when using the
AddUserLayers function. If no label set for the user layer, use the
wms_title if the layer is already here if not use id. If the layer is not a
wms layer, this will always return the id for the name. So It could be
better to force layer label using UserLayer.
if (empty($layer->label)) {
if (!empty($msLayer))
$layer->label = $msLayer->getMetadata('wms_title');
else
$layer->label = $layer->id;
}
Is that a good way to set the layer label ?
Thanks for your comments.
Francois
--
Ce message a ete verifie par MailScanner pour des virus ou des polluriels et rien de suspect n'a ete trouve.
Les donnees et renseignements contenus dans ce message sont personnels, confidentiels et prives. Toute publication, utilisation ou diffusion, meme partielle, doit etre autorisee.
Any data and information contained in this electronic mail is personal, confidential and secret. Any total or partial publication, use or distribution must be authorized.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20061010/0c188091/attachment.html
More information about the Cartoweb-users
mailing list