allow user to specify initial controls via 'controls' array option, instead of simply passing an empty array and then later adding. that seems extraneous
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1005 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -152,7 +152,11 @@ OpenLayers.Map.prototype = {
|
|||||||
|
|
||||||
this.layers = [];
|
this.layers = [];
|
||||||
|
|
||||||
if (!this.controls) {
|
if (this.controls) {
|
||||||
|
for(var i=0; i < this.controls.length; i++) {
|
||||||
|
this.addControl(this.controls[i]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
this.controls = [];
|
this.controls = [];
|
||||||
this.addControl(new OpenLayers.Control.MouseDefaults());
|
this.addControl(new OpenLayers.Control.MouseDefaults());
|
||||||
this.addControl(new OpenLayers.Control.PanZoom());
|
this.addControl(new OpenLayers.Control.PanZoom());
|
||||||
|
|||||||
Reference in New Issue
Block a user