From 8d09be7134982e57af901d5c87a9923378dc1647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 19 Aug 2013 13:54:26 +0200 Subject: [PATCH 01/12] No reference to internal types in externs file Currently we have things like like in the generated externs file (types.js): /** * @type {ol.control.AttributionOptions|undefined} */ olx.control.DefaultsOptionsExtern.prototype.attributionOptions; It doesn't make sense to have external object properties whose types are internal (ol.control.AttributionOptions in the above example). With this commit, the generate-exports.py script generates this: /** * @type {olx.control.AttributionOptionsExtern|undefined} */ olx.control.DefaultsOptionsExtern.prototype.attributionOptions; --- bin/generate-exports.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/generate-exports.py b/bin/generate-exports.py index d098e0c7c4..fd2ebf4ed9 100755 --- a/bin/generate-exports.py +++ b/bin/generate-exports.py @@ -122,9 +122,10 @@ class Class(Exportable): class ObjectLiteral(Exportable): - def __init__(self, name): + def __init__(self, name, objects): Exportable.__init__(self, name) self.prop_types = {} + self.objects = objects __repr__ = simplerepr @@ -138,7 +139,12 @@ class ObjectLiteral(Exportable): for prop in sorted(self.prop_types.keys()): lines.append('\n\n') lines.append('/**\n') - lines.append(' * @type {%s}\n' % (self.prop_types[prop],)) + prop_types = self.prop_types[prop].split('|') + for i, t in enumerate(prop_types): + if t in self.objects and isinstance(self.objects[t], ObjectLiteral): + prop_types[i] = self.objects[t].extern_name() + prop_types = '|'.join(prop_types) + lines.append(' * @type {%s}\n' % (prop_types,)) lines.append(' */\n') lines.append('%s.prototype.%s;\n' % (self.extern_name(), prop)) return ''.join(lines) @@ -221,7 +227,7 @@ def main(argv): name = m.group('name') if name in objects: raise RuntimeError(line) # Name already defined - object_literal = ObjectLiteral(name) + object_literal = ObjectLiteral(name, objects) objects[name] = object_literal continue m = re.match(r'\*\s*@property\s*{(?P.*)}\s*(?P\S+)', line) From a37f114e4bc12b0cf44901ec38dbd1c3a34ff17f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 19 Aug 2013 14:01:57 +0200 Subject: [PATCH 02/12] Add export annotation @exportFunction This commit adds a new export annotation: @exportFunction. @exportFunction is to be used to declare functions that take an options object literal as their first arguments. @exportFunction is to regular functions as @exportClass is to constructors. The usage of @exportFunction is as follows: @exportFunction ol.control.defaults ol.control.DefaultsOptions ol.Collection Note: the Function#export method uses a recursive function. This is to handle nested options. --- bin/generate-exports.py | 88 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/bin/generate-exports.py b/bin/generate-exports.py index fd2ebf4ed9..8ba3d02052 100755 --- a/bin/generate-exports.py +++ b/bin/generate-exports.py @@ -120,6 +120,78 @@ class Class(Exportable): return '%sExport' % self.name +class Function(Exportable): + + def __init__(self, name, object_literal, return_type, objects): + Exportable.__init__(self, name) + self.object_literal = object_literal + self.return_type = return_type + self.objects = objects + + __repr__ = simplerepr + + def property_object_literal(self, object_literal, prop): + prop_object_literal = None + types = object_literal.prop_types[prop].split('|') + for t in types: + if t in self.objects: + o = self.objects[t] + if isinstance(o, ObjectLiteral): + if prop_object_literal: + raise RuntimeError('Multiple "literal" types found for ' + 'option %s.%s: %s, %s.' % + (object_literal.name, prop, + prop_object_literal.name, o.name)) + prop_object_literal = o + return prop_object_literal + + def recursive_export(self, lines, prop, object_literal, local_var=None, depth=1): + indent = ' ' * depth + if not local_var: + local_var = prop.split('.')[-1] + lines.append('%s/** @type {%s} */\n' % (indent, object_literal.name)) + lines.append('%svar %s =\n' % (indent, local_var)) + lines.append('%s /** @type {%s} */\n' % (indent, object_literal.name)) + lines.append('%s (%s);\n' % (indent, prop)) + lines.append('%sif (goog.isDefAndNotNull(%s)) {\n' % (indent, prop)) + for key in sorted(object_literal.prop_types.keys()): + prop_object_literal = self.property_object_literal(object_literal, key) + if prop_object_literal: + lv = self.recursive_export(lines, '%s.%s' % (prop, key), + prop_object_literal, depth=depth + 1) + lines.append('%s %s.%s =\n%s %s;\n' % + (indent, local_var, key, indent, lv)) + else: + lines.append('%s %s.%s =\n%s %s.%s;\n' % + (indent, local_var, key, indent, prop, key)) + lines.append('%s}\n' % (indent,)) + return local_var + + def export(self): + lines = [] + local_var = 'arg' + lines.append('\n\n') + lines.append('/**\n') + lines.append(' * @param {%s} options Options.\n' % (self.object_literal.extern_name(),)) + if self.return_type: + lines.append(' * @return {%s} Return value.\n' % (self.return_type,)) + lines.append(' */\n') + lines.append('%s = function(options) {\n' % (self.export_name(),)) + self.recursive_export(lines, 'options', self.object_literal, + local_var=local_var) + if self.return_type: + lines.append(' return %s(%s);\n' % (self.name, local_var)) + else: + lines.append(' %s(arg);\n' % (self.name,)) + lines.append('};\n') + lines.append('goog.exportSymbol(\n') + lines.append(' \'%s\',\n' % (self.name,)) + lines.append(' %s);\n' % (self.export_name(),)) + return ''.join(lines) + + def export_name(self): + return '%sExport' % self.name + class ObjectLiteral(Exportable): def __init__(self, name, objects): @@ -268,6 +340,22 @@ def main(argv): objects[name] = symbol symbol.props.add(prop) continue + m = re.match(r'@exportFunction\s+(?P\S+)(?:\s+(?P\S+))?(?:\s+(?P\S+))?\Z', line) + if m: + name = m.group('name') + if name in objects: + raise RuntimeError(line) # Name already defined + object_literal_name = m.group('object_literal_name') + if object_literal_name not in objects: + raise RuntimeError(line) + object_literal = objects[object_literal_name] + if not isinstance(object_literal, ObjectLiteral): + raise RuntimeError(line) + return_type = m.group('return_type') + function = Function(name, object_literal, return_type, objects) + objects[name] = function + requires.add(name) + continue m = re.match(r'@exportSymbol\s+(?P\S+)(?:\s+(?P\S+))?\Z', line) if m: name = m.group('name') From 77adbdfa7a92b33f5182dfa2bc34fe02e693c7ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 19 Aug 2013 14:08:57 +0200 Subject: [PATCH 03/12] Use per-animation function modules Currently the animation functions share the same module, namely ol.animation. We do differently for ol.control.defaults and ol.interaction.defaults, with ol.control.defaults and ol.interaction.defaults module. This commit replaces the ol.animation module by four modules, one for each animation function. This makes things more consistent, and will make it possible to use the @exportFunction annotation for the exporting of the animation functions. --- examples/animation.js | 4 +++- src/ol/animation.js | 5 ++++- src/ol/control/zoomcontrol.js | 2 +- src/ol/control/zoomslidercontrol.js | 2 +- src/ol/interaction/interaction.js | 4 +++- src/ol/kinetic.js | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/examples/animation.js b/examples/animation.js index 80c68d4a59..6182f8b243 100644 --- a/examples/animation.js +++ b/examples/animation.js @@ -1,7 +1,9 @@ goog.require('ol.Map'); goog.require('ol.RendererHints'); goog.require('ol.View2D'); -goog.require('ol.animation'); +goog.require('ol.animation.bounce'); +goog.require('ol.animation.pan'); +goog.require('ol.animation.rotate'); goog.require('ol.easing'); goog.require('ol.layer.TileLayer'); goog.require('ol.proj'); diff --git a/src/ol/animation.js b/src/ol/animation.js index 3d67b58af8..1a17b97426 100644 --- a/src/ol/animation.js +++ b/src/ol/animation.js @@ -1,6 +1,9 @@ // FIXME works for View2D only -goog.provide('ol.animation'); +goog.provide('ol.animation.bounce'); +goog.provide('ol.animation.pan'); +goog.provide('ol.animation.rotate'); +goog.provide('ol.animation.zoom'); goog.require('ol.PreRenderFunction'); goog.require('ol.ViewHint'); diff --git a/src/ol/control/zoomcontrol.js b/src/ol/control/zoomcontrol.js index 88e80d6b98..33604f2474 100644 --- a/src/ol/control/zoomcontrol.js +++ b/src/ol/control/zoomcontrol.js @@ -6,7 +6,7 @@ goog.require('goog.dom'); goog.require('goog.dom.TagName'); goog.require('goog.events'); goog.require('goog.events.EventType'); -goog.require('ol.animation'); +goog.require('ol.animation.zoom'); goog.require('ol.control.Control'); goog.require('ol.css'); goog.require('ol.easing'); diff --git a/src/ol/control/zoomslidercontrol.js b/src/ol/control/zoomslidercontrol.js index f8d5c55bbf..d392d8286b 100644 --- a/src/ol/control/zoomslidercontrol.js +++ b/src/ol/control/zoomslidercontrol.js @@ -15,7 +15,7 @@ goog.require('goog.fx.Dragger.EventType'); goog.require('goog.math'); goog.require('goog.math.Rect'); goog.require('goog.style'); -goog.require('ol.animation'); +goog.require('ol.animation.zoom'); goog.require('ol.control.Control'); goog.require('ol.css'); goog.require('ol.easing'); diff --git a/src/ol/interaction/interaction.js b/src/ol/interaction/interaction.js index 6fb94e17a7..4fe73093b4 100644 --- a/src/ol/interaction/interaction.js +++ b/src/ol/interaction/interaction.js @@ -3,7 +3,9 @@ goog.provide('ol.interaction.Interaction'); goog.require('ol.MapBrowserEvent'); -goog.require('ol.animation'); +goog.require('ol.animation.pan'); +goog.require('ol.animation.rotate'); +goog.require('ol.animation.zoom'); goog.require('ol.easing'); diff --git a/src/ol/kinetic.js b/src/ol/kinetic.js index 17e1e27d9c..1838b56db7 100644 --- a/src/ol/kinetic.js +++ b/src/ol/kinetic.js @@ -3,7 +3,7 @@ goog.provide('ol.Kinetic'); goog.require('ol.Coordinate'); goog.require('ol.PreRenderFunction'); -goog.require('ol.animation'); +goog.require('ol.animation.pan'); From 6576a491783626424ee94b3aca406597a3b1d9f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 19 Aug 2013 14:13:52 +0200 Subject: [PATCH 04/12] Make ol.Collection#extend return this This to be able to do this: new ol.Map({ controls: ol.control.defaults().extend([new MyControl()]), ... }) --- src/ol/collection.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ol/collection.js b/src/ol/collection.js index fb3fd57962..e73eb3376e 100644 --- a/src/ol/collection.js +++ b/src/ol/collection.js @@ -86,12 +86,14 @@ ol.Collection.prototype.clear = function() { /** * @param {Array} arr Array. + * @return {ol.Collection} This collection. */ ol.Collection.prototype.extend = function(arr) { var i, ii; for (i = 0, ii = arr.length; i < ii; ++i) { this.push(arr[i]); } + return this; }; From 41fe103fa438b5ec06e8eddda6095f3f9482a27c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 19 Aug 2013 14:15:22 +0200 Subject: [PATCH 05/12] Export ol.Collection#extend --- src/ol/collection.exports | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ol/collection.exports b/src/ol/collection.exports index 11b7e20c8f..5e3dae2d8d 100644 --- a/src/ol/collection.exports +++ b/src/ol/collection.exports @@ -1,5 +1,6 @@ @exportSymbol ol.Collection @exportProperty ol.Collection.prototype.clear +@exportProperty ol.Collection.prototype.extend @exportProperty ol.Collection.prototype.forEach @exportProperty ol.Collection.prototype.getAt @exportProperty ol.Collection.prototype.getLength From 3f6b9c943488d7dedc52182d88695365d84ce94b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 19 Aug 2013 14:16:22 +0200 Subject: [PATCH 06/12] Use ol.Collection#extend in examples This commit changes the examples to using ol.control.defaults().extend to extend the collection of controls. This is in preparation for a future commit that will remove the 2nd argument to ol.control.defaults. The same is done for ol.interaction.defaults. --- examples/custom-controls.js | 2 +- examples/drag-rotate-and-zoom.js | 2 +- examples/epsg-4326.js | 2 +- examples/full-screen-drag-rotate-and-zoom.js | 4 ++-- examples/full-screen.js | 2 +- examples/mouse-position.js | 2 +- examples/navigation-controls.js | 2 +- examples/scale-line.js | 2 +- examples/ten-thousand-points.js | 2 +- examples/wms-custom-proj.js | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/custom-controls.js b/examples/custom-controls.js index d5d774fbc7..3dec81a30b 100644 --- a/examples/custom-controls.js +++ b/examples/custom-controls.js @@ -64,7 +64,7 @@ ol.inherits(app.RotateNorthControl, ol.control.Control); var map = new ol.Map({ - controls: ol.control.defaults({}, [ + controls: ol.control.defaults().extend([ new app.RotateNorthControl() ]), layers: [ diff --git a/examples/drag-rotate-and-zoom.js b/examples/drag-rotate-and-zoom.js index 65a7b94768..6c594af871 100644 --- a/examples/drag-rotate-and-zoom.js +++ b/examples/drag-rotate-and-zoom.js @@ -8,7 +8,7 @@ goog.require('ol.source.MapQuestOpenAerial'); var map = new ol.Map({ - interactions: ol.interaction.defaults({}, [ + interactions: ol.interaction.defaults().extend([ new ol.interaction.DragRotateAndZoom() ]), layers: [ diff --git a/examples/epsg-4326.js b/examples/epsg-4326.js index e4e49eda8d..5de5b985f9 100644 --- a/examples/epsg-4326.js +++ b/examples/epsg-4326.js @@ -22,7 +22,7 @@ var layers = [ ]; var map = new ol.Map({ - controls: ol.control.defaults({}, [ + controls: ol.control.defaults().extend([ new ol.control.ScaleLine({ units: ol.control.ScaleLineUnits.DEGREES }) diff --git a/examples/full-screen-drag-rotate-and-zoom.js b/examples/full-screen-drag-rotate-and-zoom.js index 63c78ff58a..f40cd6a116 100644 --- a/examples/full-screen-drag-rotate-and-zoom.js +++ b/examples/full-screen-drag-rotate-and-zoom.js @@ -10,10 +10,10 @@ goog.require('ol.source.BingMaps'); var map = new ol.Map({ - controls: ol.control.defaults({}, [ + controls: ol.control.defaults().extend([ new ol.control.FullScreen() ]), - interactions: ol.interaction.defaults({}, [ + interactions: ol.interaction.defaults().extend([ new ol.interaction.DragRotateAndZoom() ]), layers: [ diff --git a/examples/full-screen.js b/examples/full-screen.js index 76eabda6d9..a500d21482 100644 --- a/examples/full-screen.js +++ b/examples/full-screen.js @@ -13,7 +13,7 @@ var view = new ol.View2D({ }); var map = new ol.Map({ - controls: ol.control.defaults({}, [ + controls: ol.control.defaults().extend([ new ol.control.FullScreen() ]), layers: [ diff --git a/examples/mouse-position.js b/examples/mouse-position.js index d6c262d1f2..3819b08807 100644 --- a/examples/mouse-position.js +++ b/examples/mouse-position.js @@ -20,7 +20,7 @@ var mousePositionControl = new ol.control.MousePosition({ }); var map = new ol.Map({ - controls: ol.control.defaults({}, [mousePositionControl]), + controls: ol.control.defaults().extend([mousePositionControl]), layers: [ new ol.layer.TileLayer({ source: new ol.source.OSM() diff --git a/examples/navigation-controls.js b/examples/navigation-controls.js index 86f6d06f1e..0c09d64507 100644 --- a/examples/navigation-controls.js +++ b/examples/navigation-controls.js @@ -8,7 +8,7 @@ goog.require('ol.source.OSM'); var map = new ol.Map({ - controls: ol.control.defaults({}, [ + controls: ol.control.defaults().extend([ new ol.control.ZoomToExtent({ extent: [ 813079.7791264898, diff --git a/examples/scale-line.js b/examples/scale-line.js index dffe53948d..4013f3e59a 100644 --- a/examples/scale-line.js +++ b/examples/scale-line.js @@ -11,7 +11,7 @@ goog.require('ol.source.OSM'); var scaleLineControl = new ol.control.ScaleLine(); var map = new ol.Map({ - controls: ol.control.defaults({}, [ + controls: ol.control.defaults().extend([ scaleLineControl ]), layers: [ diff --git a/examples/ten-thousand-points.js b/examples/ten-thousand-points.js index 87552e26e0..e2f1813fcd 100644 --- a/examples/ten-thousand-points.js +++ b/examples/ten-thousand-points.js @@ -42,7 +42,7 @@ var lineStringCollection = ol.geom2.LineStringCollection.pack([ ]); var map = new ol.Map({ - controls: ol.control.defaults({}, [ + controls: ol.control.defaults().extend([ new ol.control.MousePosition({ undefinedHTML: ' ' }) diff --git a/examples/wms-custom-proj.js b/examples/wms-custom-proj.js index 45c98dff45..2d71383205 100644 --- a/examples/wms-custom-proj.js +++ b/examples/wms-custom-proj.js @@ -47,7 +47,7 @@ var layers = [ ]; var map = new ol.Map({ - controls: ol.control.defaults({}, [ + controls: ol.control.defaults().extend([ new ol.control.ScaleLine({ units: ol.control.ScaleLineUnits.METRIC }) From 3d2d45e01ff93c7a448eb17ed5949fe2a59e7db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 19 Aug 2013 14:20:21 +0200 Subject: [PATCH 07/12] Remove 2nd arg to ol.control.defaults --- src/ol/control/controldefaults.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/ol/control/controldefaults.js b/src/ol/control/controldefaults.js index 0d8c818b62..1aa7f5078b 100644 --- a/src/ol/control/controldefaults.js +++ b/src/ol/control/controldefaults.js @@ -8,10 +8,9 @@ goog.require('ol.control.Zoom'); /** * @param {ol.control.DefaultsOptions=} opt_options Defaults options. - * @param {Array.=} opt_controls Additional controls. * @return {ol.Collection} Controls. */ -ol.control.defaults = function(opt_options, opt_controls) { +ol.control.defaults = function(opt_options) { var options = goog.isDef(opt_options) ? opt_options : {}; @@ -41,10 +40,6 @@ ol.control.defaults = function(opt_options, opt_controls) { controls.push(new ol.control.Zoom(zoomControlOptions)); } - if (goog.isDef(opt_controls)) { - controls.extend(opt_controls); - } - return controls; }; From 169e986b28ba539dc002b4a6cd460a2abe255608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 19 Aug 2013 14:20:55 +0200 Subject: [PATCH 08/12] Remove 2nd arg to ol.interaction.defaults --- src/ol/interaction/interactiondefaults.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/ol/interaction/interactiondefaults.js b/src/ol/interaction/interactiondefaults.js index b2ba3bd2e4..0fa4c3bc7f 100644 --- a/src/ol/interaction/interactiondefaults.js +++ b/src/ol/interaction/interactiondefaults.js @@ -6,7 +6,6 @@ goog.require('ol.interaction.DoubleClickZoom'); goog.require('ol.interaction.DragPan'); goog.require('ol.interaction.DragRotate'); goog.require('ol.interaction.DragZoom'); -goog.require('ol.interaction.Interaction'); goog.require('ol.interaction.KeyboardPan'); goog.require('ol.interaction.KeyboardZoom'); goog.require('ol.interaction.MouseWheelZoom'); @@ -17,11 +16,9 @@ goog.require('ol.interaction.TouchZoom'); /** * @param {ol.interaction.DefaultsOptions=} opt_options Defaults options. - * @param {Array.=} opt_interactions Additional - * interactions. * @return {ol.Collection} Interactions. */ -ol.interaction.defaults = function(opt_options, opt_interactions) { +ol.interaction.defaults = function(opt_options) { var options = goog.isDef(opt_options) ? opt_options : {}; @@ -92,10 +89,6 @@ ol.interaction.defaults = function(opt_options, opt_interactions) { interactions.push(new ol.interaction.DragZoom()); } - if (goog.isDef(opt_interactions)) { - interactions.extend(opt_interactions); - } - return interactions; }; From 29a2d2a9f74f771bdbcb4b5defdbcd13e68fff74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 19 Aug 2013 14:21:44 +0200 Subject: [PATCH 09/12] Use @exportFunction to export ol.control.defaults --- src/ol/control/controldefaults.exports | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/control/controldefaults.exports b/src/ol/control/controldefaults.exports index 0023131772..a3ee165dd7 100644 --- a/src/ol/control/controldefaults.exports +++ b/src/ol/control/controldefaults.exports @@ -1 +1 @@ -@exportSymbol ol.control.defaults ol.control.defaults +@exportFunction ol.control.defaults ol.control.DefaultsOptions ol.Collection From f67d3dc16598c6baf322ddca48574bf5e7f1ed68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 19 Aug 2013 14:22:11 +0200 Subject: [PATCH 10/12] Use @exportFunction to export ol.interaction.defaults --- src/ol/interaction/interactiondefaults.exports | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/interaction/interactiondefaults.exports b/src/ol/interaction/interactiondefaults.exports index 2ab5e46392..6e30aa7234 100644 --- a/src/ol/interaction/interactiondefaults.exports +++ b/src/ol/interaction/interactiondefaults.exports @@ -1 +1 @@ -@exportSymbol ol.interaction.defaults ol.interaction.defaults +@exportFunction ol.interaction.defaults ol.interaction.DefaultsOptions ol.Collection From d6d15db6e86529a7c0695c0cba566a8a45bad390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 19 Aug 2013 14:23:02 +0200 Subject: [PATCH 11/12] Use @exportFunction to export animation functions --- src/ol/animation.exports | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ol/animation.exports b/src/ol/animation.exports index 5cab49819d..887adf82d7 100644 --- a/src/ol/animation.exports +++ b/src/ol/animation.exports @@ -1,4 +1,4 @@ -@exportSymbol ol.animation.bounce -@exportSymbol ol.animation.pan -@exportSymbol ol.animation.rotate -@exportSymbol ol.animation.zoom +@exportFunction ol.animation.bounce ol.animation.BounceOptions ol.PreRenderFunction +@exportFunction ol.animation.pan ol.animation.PanOptions ol.PreRenderFunction +@exportFunction ol.animation.rotate ol.animation.RotateOptions ol.PreRenderFunction +@exportFunction ol.animation.zoom ol.animation.ZoomOptions ol.PreRenderFunction From d0f793b7a08f31605a3e5d0a74ad0aaa578dde45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 19 Aug 2013 14:53:57 +0200 Subject: [PATCH 12/12] Fix bad option name in ol.control.defaults --- src/ol/control/controldefaults.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ol/control/controldefaults.js b/src/ol/control/controldefaults.js index 1aa7f5078b..02276c7f2f 100644 --- a/src/ol/control/controldefaults.js +++ b/src/ol/control/controldefaults.js @@ -35,8 +35,8 @@ ol.control.defaults = function(opt_options) { var zoomControl = goog.isDef(options.zoom) ? options.zoom : true; if (zoomControl) { - var zoomControlOptions = goog.isDef(options.zoomControlOptions) ? - options.zoomControlOptions : undefined; + var zoomControlOptions = goog.isDef(options.zoomOptions) ? + options.zoomOptions : undefined; controls.push(new ol.control.Zoom(zoomControlOptions)); }