[OpenLayers-Trac] [OpenLayers] #2959: instance of Array + GWT +
Buttons + IFRAME = BUG in Panel.js
OpenLayers
trac-20090302 at openlayers.org
Sun Dec 5 20:13:54 EST 2010
#2959: instance of Array + GWT + Buttons + IFRAME = BUG in Panel.js
-----------------------------------------------+----------------------------
Reporter: grigoryevigor | Owner:
Type: feature | Status: new
Priority: major | Milestone: 2.11 Release
Component: Control.Panel | Version: 2.10
Keywords: instanceof Array IFRAME GWT Panel | State:
-----------------------------------------------+----------------------------
I'm using wrapper with OL API in GWT application. I found problem with
Array type detection in OL. It just not works for array passed from other
frame (see: http://javascript.crockford.com/remedial.html).
As for me the problem resides in Panel.js addControls function
/*-------------------------------------------------------------*/
addControls: function(controls) {
if (!(controls instanceof Array)) {
controls = [controls];
}
this.controls = this.controls.concat(controls);
/*-------------------------------------------------------------*/
failing to detect type correctly, it wraps array once more to the effect
of nonsense. I also found 40 places using similar sintax around a project
code. I'm suggesting to replace instanceof with a typeOf function usage
from example (see URL above).
--
Ticket URL: <http://trac.openlayers.org/ticket/2959>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list