On Sat, Nov 19, 2011 at 10:15 PM, Dave Potts <[email protected]> wrote:
> Hi List,
> In the Openlayers 2.11 release the function addLayer returns false on line
> 963 ,

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.

> but at the end of function, line 999 it returns a void.
>
> How can I tell if the call to addLayer has been successful ?
>
> The same problem occurs with the function destroy values of false and void
> are returned.

Right Map.destroy returns false if the map's already destroyed. Again I'd
recommend not relying on the return value here.

--
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : [email protected]
http://www.camptocamp.com




-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : [email protected]
http://www.camptocamp.com
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to