From 93028bbcf88efbbc0ed6a15f55261990fa63fba5 Mon Sep 17 00:00:00 2001 From: Peter Robins Date: Tue, 6 Mar 2012 10:08:19 +0000 Subject: [PATCH] Map: defaults controls should include TouchNavigation if present --- lib/OpenLayers/Map.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 016c4110b8..da173fceef 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -193,8 +193,8 @@ OpenLayers.Map = OpenLayers.Class({ * {Array()} List of controls associated with the map. * * If not provided in the map options at construction, the map will - * be given the following controls by default: - * - + * by default be given the following controls if present in the build: + * - or * - * - * - @@ -588,20 +588,23 @@ OpenLayers.Map = OpenLayers.Class({ } } - if (this.controls == null) { + if (this.controls == null) { // default controls this.controls = []; if (OpenLayers.Control != null) { // running full or lite? + // Navigation or TouchNavigation depending on what is in build if (OpenLayers.Control.Navigation) { - this.controls.push(new OpenLayers.Control.Navigation()) + this.controls.push(new OpenLayers.Control.Navigation()); + } else if (OpenLayers.Control.TouchNavigation) { + this.controls.push(new OpenLayers.Control.TouchNavigation()); } if (OpenLayers.Control.PanZoom) { - this.controls.push(new OpenLayers.Control.PanZoom()) + this.controls.push(new OpenLayers.Control.PanZoom()); } if (OpenLayers.Control.ArgParser) { - this.controls.push(new OpenLayers.Control.ArgParser()) + this.controls.push(new OpenLayers.Control.ArgParser()); } if (OpenLayers.Control.Attribution) { - this.controls.push(new OpenLayers.Control.Attribution()) + this.controls.push(new OpenLayers.Control.Attribution()); } } }