[OpenLayers-Users] vector layer destroyed twice throws error

Chris Green chris.green at ibstv.co.uk
Mon Apr 12 06:33:48 EDT 2010


Hi Eric

Thanks for your suggestion but unfortunately it doesn't help - I tried to
destroy the SelectFeature Control (testing if null first) before destroying
the vector layer, but there was no change to the problem - I still get
'zIndex is null' errors each of the even number of times that I call it. 

Is there some other way, for example forcing the zIndex to be some arbitrary
value before destroying the layer? I have been trying to devise something on
those lines but have not found a workable method up to now.


Chris


-----Original Message-----
From: Eric Lemoine [mailto:eric.lemoine at camptocamp.com] 
Sent: 12 April 2010 10:35
To: chris.green at ibstv.co.uk
Cc: users at openlayers.org
Subject: Re: [OpenLayers-Users] vector layer destroyed twice throws error

On Mon, Apr 12, 2010 at 10:16 AM, Chris Green <chris.green at ibstv.co.uk>
wrote:
> Hi Eric
>
> The code I am using (slightly simplified) is below. I am not calling
> getZIndex, I have been assuming that it is called somehow as part of the
> layer.destroy() function

Layer.destroy() doesn't call getZIndex. What calls getZIndex is the
Feature handler (used in the SelectFeature control). Before destroying
the layer you can try to destroy the SelectFeature control attached to
that layer.

Cheers,

-- 
Eric Lemoine

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

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com





More information about the Users mailing list