<br><br>On Sat, Nov 19, 2011 at 10:15 PM, Dave Potts <<a href="mailto:dave.potts@pinan.co.uk">dave.potts@pinan.co.uk</a>> wrote:<br>> Hi List,<br>> In the Openlayers 2.11 release the function addLayer returns false on line<br>
> 963 ,<br><br>Right. It returns false when the layer is already in the map. I don't think you should rely on that. Just assume that addLayer always succeeds, making sure at application level that layers aren'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>> but at the end of function, line 999 it returns a void.<br>><br>> How can I tell if the call to addLayer has been successful ?<br>><br>> The same problem occurs with the function destroy values of false and void<br>
> are returned.<br><br>Right Map.destroy returns false if the map's already destroyed. Again I'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>