Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #245 from probins/mapdefaults

Map: check default controls are in build
  • Loading branch information...
commit a2d658f75a5143c8e1fdaf5c59e43b3581741774 2 parents 284ec6a + 27e5aaf
@ahocevar ahocevar authored
Showing with 13 additions and 7 deletions.
  1. +13 −7 lib/OpenLayers/Map.js
View
20 lib/OpenLayers/Map.js
@@ -577,14 +577,20 @@ OpenLayers.Map = OpenLayers.Class({
}
if (this.controls == null) {
+ this.controls = [];
if (OpenLayers.Control != null) { // running full or lite?
- this.controls = [ new OpenLayers.Control.Navigation(),
- new OpenLayers.Control.PanZoom(),
- new OpenLayers.Control.ArgParser(),
- new OpenLayers.Control.Attribution()
- ];
- } else {
- this.controls = [];
+ if (OpenLayers.Control.Navigation) {
+ this.controls.push(new OpenLayers.Control.Navigation())
+ }
+ if (OpenLayers.Control.PanZoom) {
+ this.controls.push(new OpenLayers.Control.PanZoom())
+ }
+ if (OpenLayers.Control.ArgParser) {
+ this.controls.push(new OpenLayers.Control.ArgParser())
+ }
+ if (OpenLayers.Control.Attribution) {
+ this.controls.push(new OpenLayers.Control.Attribution())
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.