Ticket #3416 (closed bug: fixed)

Opened 22 months ago

Last modified 20 months ago

Layer vector initializes EVENT_TYPES in wrong way

Reported by: jachym Owned by: crschmidt
Priority: minor Milestone: 2.12 Release
Component: Layer.Vector Version: SVN
Keywords: EVENT_TYPES, initialize Cc:
State:

Description

Hi,

in lib/OpenLayers/Layer/Vector, initialize method, there is

244	        // concatenate events specific to vector with those from the base
245	        this.EVENT_TYPES =
246	            OpenLayers.Layer.Vector.prototype.EVENT_TYPES.concat(
247	            OpenLayers.Layer.prototype.EVENT_TYPES
248	        );

 http://trac.osgeo.org/openlayers/browser/trunk/openlayers/lib/OpenLayers/Layer/Vector.js#L242

But creating new CLASS, derived from OpenLayers.Layer.Vector, with custom EVENT_TYPES is not possible in this case, bacause if you call initialize, custom EVENT_TYPES will *always* be overwritten by OpenLayers.Layer.Vector.prototype.EVENT_TYPES.

Solution:

245	        this.EVENT_TYPES =
246	            this.EVENT_TYPES.concat(
247	            OpenLayers.Layer.prototype.EVENT_TYPES
248	        );

Change History

Changed 20 months ago by fredj

  • status changed from new to closed
  • resolution set to fixed

EVENT_TYPES array is gone (see #2555)

Note: See TracTickets for help on using tickets.