Ticket #3416 (closed bug: fixed)
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
Note: See
TracTickets for help on using
tickets.
