From 23355abb4292346a3964a6f6667456495cac46ab Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Thu, 7 Feb 2013 09:35:53 +0100 Subject: [PATCH 1/4] Make 'geodesic' & 'displaySystem' API properties. The geodesic-property is used inside of our examples, yet isn't officially part of the public API. The displaySystem-property provides a very useful way of configuring the output of the measurements and should be promoted as well. --- lib/OpenLayers/Control/Measure.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Control/Measure.js b/lib/OpenLayers/Control/Measure.js index f37683c0be..39cae06bc8 100644 --- a/lib/OpenLayers/Control/Measure.js +++ b/lib/OpenLayers/Control/Measure.js @@ -49,14 +49,14 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { callbacks: null, /** - * Property: displaySystem + * APIProperty: displaySystem * {String} Display system for output measurements. Supported values * are 'english', 'metric', and 'geographic'. Default is 'metric'. */ displaySystem: 'metric', /** - * Property: geodesic + * APIProperty: geodesic * {Boolean} Calculate geodesic metrics instead of planar metrics. This * requires that geometries can be transformed into Geographic/WGS84 * (if that is not already the map projection). Default is false. From cbc705bdf7abad0de6c7b800b3c0ffd84a4b59ab Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Thu, 7 Feb 2013 09:42:52 +0100 Subject: [PATCH 2/4] Adjust method documentation. --- lib/OpenLayers/Control/Measure.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Control/Measure.js b/lib/OpenLayers/Control/Measure.js index 39cae06bc8..f0fb89d855 100644 --- a/lib/OpenLayers/Control/Measure.js +++ b/lib/OpenLayers/Control/Measure.js @@ -226,8 +226,10 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { * Method: measureImmediate * Called each time the measurement sketch is modified. * - * Parameters: point - {} The point at the - * mouseposition. feature - {} The sketch feature. + * Parameters: + * point - {} The point at the mouse position. + * feature - {} The sketch feature. + * drawing - {Boolean} Indicates whether we're currently drawing. */ measureImmediate : function(point, feature, drawing) { if (drawing && !this.handler.freehandMode(this.handler.evt)) { From 9f7a0ed4483a3c6b47e21136237ad812a860e5b1 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Thu, 7 Feb 2013 09:44:04 +0100 Subject: [PATCH 3/4] Remove end-of-line whitespace. --- lib/OpenLayers/Control/Measure.js | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/OpenLayers/Control/Measure.js b/lib/OpenLayers/Control/Measure.js index f0fb89d855..03c22b8c1c 100644 --- a/lib/OpenLayers/Control/Measure.js +++ b/lib/OpenLayers/Control/Measure.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -17,7 +17,7 @@ */ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { - /** + /** * APIProperty: events * {} Events instance for listeners and triggering * control specific events. @@ -41,20 +41,20 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { * APIProperty: handlerOptions * {Object} Used to set non-default properties on the control's handler */ - + /** * Property: callbacks * {Object} The functions that are sent to the handler for callback */ callbacks: null, - + /** * APIProperty: displaySystem * {String} Display system for output measurements. Supported values * are 'english', 'metric', and 'geographic'. Default is 'metric'. */ displaySystem: 'metric', - + /** * APIProperty: geodesic * {Boolean} Calculate geodesic metrics instead of planar metrics. This @@ -62,7 +62,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { * (if that is not already the map projection). Default is false. */ geodesic: false, - + /** * Property: displaySystemUnits * {Object} Units for various measurement systems. Values are arrays @@ -111,10 +111,10 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { /** * Constructor: OpenLayers.Control.Measure - * + * * Parameters: - * handler - {} - * options - {Object} + * handler - {} + * options - {Object} */ initialize: function(handler, options) { OpenLayers.Control.prototype.initialize.apply(this, [options]); @@ -125,14 +125,14 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { } this.callbacks = OpenLayers.Util.extend(callbacks, this.callbacks); - // let the handler options override, so old code that passes 'persist' + // let the handler options override, so old code that passes 'persist' // directly to the handler does not need an update this.handlerOptions = OpenLayers.Util.extend( {persist: this.persist}, this.handlerOptions ); this.handler = new handler(this, this.callbacks, this.handlerOptions); }, - + /** * APIMethod: deactivate */ @@ -164,7 +164,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { delete this.callbacks.modify; } }, - + /** * Method: updateHandler * @@ -194,7 +194,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { this.cancelDelay(); this.measure(geometry, "measure"); }, - + /** * Method: measurePartial * Called each time a new point is added to the measurement sketch. @@ -225,7 +225,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { /** * Method: measureImmediate * Called each time the measurement sketch is modified. - * + * * Parameters: * point - {} The point at the mouse position. * feature - {} The sketch feature. @@ -272,7 +272,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { geometry: geometry }); }, - + /** * Method: getBestArea * Based on the returns the area of a geometry. @@ -296,7 +296,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { } return [area, unit]; }, - + /** * Method: getArea * @@ -323,7 +323,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { } return area; }, - + /** * Method: getBestLength * Based on the returns the length of a geometry. From 70ea8f6588d9d55cabb42e0c12059cb132dbc85f Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Thu, 7 Feb 2013 10:17:06 +0100 Subject: [PATCH 4/4] Readd dangling space in header. This allows for easier search and replace operations. The space will eventually be removed in all files in a seperate commit. --- lib/OpenLayers/Control/Measure.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpenLayers/Control/Measure.js b/lib/OpenLayers/Control/Measure.js index 03c22b8c1c..d1fce4a306 100644 --- a/lib/OpenLayers/Control/Measure.js +++ b/lib/OpenLayers/Control/Measure.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */