Closed skyl closed 14 years ago
What values are you setting to mapOptions.controls? The default is:
mapOptions: {
...
controls: ['LayerSwitcher', 'Navigation', 'PanZoom', 'Attribution']
}
In javascript, there's a parity between arrays and objects -- accessing an object property such as "OpenLayers.Control.PanZoomBar" is the same as accessing "OpenLayers.Control['PanZoomBar']".
So if OpenLayers.Control[control]()
is not a constructor, you must be passing in some value for 'control' that is not one of the types present in Openlayers.Control:
http://dev.openlayers.org/docs/files/OpenLayers/Control-js.html
Maybe github provides a way to not only close an issue but destroy it? Changes I made were causing this problem, but I "fixed" it before really understanding it.
haha. No such option, but no worries.
Not sure if this is a real bug. Feel free to close but it seems like something is amiss here:
new OpenLayers.Control[control]()
Might just be something that I'm doing.