<br><br>On Sat, Nov 19, 2011 at 10:15 PM, Dave Potts &lt;<a href="mailto:dave.potts@pinan.co.uk">dave.potts@pinan.co.uk</a>&gt; wrote:<br>&gt; Hi List,<br>&gt; In the Openlayers 2.11 release the function addLayer returns false on line<br>
&gt; 963 ,<br><br>Right. It returns false when the layer is already in the map. I don&#39;t think you should rely on that. Just assume that addLayer always succeeds, making sure at application level that layers aren&#39;t added multiple times. Another reason not to rely on that is that this behavior has changed in the development branch—an exception is now thrown if the layer is already in the map.<br>
<br>&gt; but at the end of function, line 999 it returns a void.<br>&gt;<br>&gt; How can I tell if the call to addLayer has been successful ?<br>&gt;<br>&gt; The same problem occurs with the function destroy values of false and void<br>
&gt; are returned.<br><br>Right Map.destroy returns false if the map&#39;s already destroyed. Again I&#39;d recommend not relying on the return value here.<br><br>--<br>Eric Lemoine<br><br>Camptocamp France SAS<br>Savoie Technolac, BP 352<br>
73377 Le Bourget du Lac, Cedex<br><br>Tel : 00 33 4 79 44 44 96<br>Mail : <a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a><br><a href="http://www.camptocamp.com">http://www.camptocamp.com</a><br>
<br><br><br><br>-- <br>Eric Lemoine<br><br>Camptocamp France SAS<br>Savoie Technolac, BP 352<br>73377 Le Bourget du Lac, Cedex<br><br>Tel : 00 33 4 79 44 44 96<br>Mail : <a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a><br>
<a href="http://www.camptocamp.com">http://www.camptocamp.com</a><br><br>