<!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.5700.7" name=GENERATOR></HEAD>
<BODY><FONT size=1>
<P><SPAN class=603215014-09102006><FONT face=Arial size=2>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.</FONT></SPAN></P>
<P><SPAN class=603215014-09102006><FONT face=Arial size=2>Currently, the layer
plugin is doing that when it try to set the layer name :</FONT></SPAN></P>
<P>if (!empty($msLayer))<SPAN class=603215014-09102006> </SPAN>$layer->label
= $msLayer->getMetadata('wms_title');</P>
<P>if (</FONT><FONT face="Courier New" size=1>empty</FONT><FONT
size=1>($layer->label)) </FONT><FONT size=1>$layer->label =
$layer->id;</P></FONT>
<DIV><FONT face=Arial size=2><SPAN class=603215014-09102006>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 <FONT
size=1>$msMapObj-></FONT>getLayerByName return only one layer. (Maybe we
should not be able to add a layer with the same name)</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=603215014-09102006><FONT face=Arial size=2>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.</FONT></SPAN></DIV>
<DIV><FONT size=1>
<P>if (empty($layer->label)) </FONT><FONT face="Courier New" size=1>{</P>
<P></FONT><FONT size=1></FONT><FONT face="Courier New" size=1></FONT><FONT
size=1>if (!empty($msLayer))</P>
<P></FONT><FONT face="Courier New" size=1></FONT><FONT size=1>$layer->label =
$msLayer->getMetadata('wms_title');</P></FONT><FONT face="Courier New"
size=1>
<P>else</P>
<P></FONT><FONT size=1>$layer->label = $layer->id;</P>
<P>} </P></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=603215014-09102006>Is that a good way
to set the layer label ? </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=603215014-09102006><FONT face=Arial size=2>Thanks for your
comments. </FONT></SPAN></DIV>
<DIV><SPAN class=603215014-09102006><FONT face=Arial
size=2>Francois</FONT></SPAN></DIV></BODY><br />--
<br />Ce message a ete verifie par <a href="http://www.mailscanner.info/"><b>MailScanner</b></a>
pour des virus ou des polluriels et rien de suspect n'a ete trouve.
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
Les donnees et renseignements contenus dans ce message sont personnels, confidentiels et privés.Toute publication, utilisation ou diffusion, meme partielle, doit etre autorisee.
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
Any data and information contained in this electronic mail is personal, confidential and private. Any total or partial publication, use or distribution must be authorized.
</HTML>