From d2add3dd5c468c54206515934ca06ba47dbb73e0 Mon Sep 17 00:00:00 2001 From: erick Date: Wed, 12 Oct 2016 03:22:05 -0400 Subject: [PATCH] docstrings: add clarification for projection; closes #4817 (#5010) * Fix doc: add clarification for projection; closes #4817 Adds clarification in the documentation that specifies that the `project` and `unproject` methods cannot take in arrays, but only actual instances of `L.LatLng` and `L.Point`, respectively. * Fix doc: add clarification for transform methods Changes the word "real" for the word "actual" so that people don't confuse actual instances of `L.Point` with coordinates using real numbers. --- src/geo/projection/Projection.leafdoc | 4 ++-- src/geometry/Transformation.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/geo/projection/Projection.leafdoc b/src/geo/projection/Projection.leafdoc index 1b5841d8..0cbe8025 100644 --- a/src/geo/projection/Projection.leafdoc +++ b/src/geo/projection/Projection.leafdoc @@ -8,9 +8,9 @@ a flat surface (and back). See [Map projection](http://en.wikipedia.org/wiki/Map The bounds where the projection is valid @method project(latlng: LatLng): Point -Projects geographical coordinates into a 2D point. +Projects geographical coordinates into a 2D point. Only accepts actual `L.LatLng` instances, not arrays. @method unproject(point: Point): LatLng -The inverse of `project`. Projects a 2D point into a geographical location. +The inverse of `project`. Projects a 2D point into a geographical location. Only accepts actual `L.Point` instances, not arrays. diff --git a/src/geometry/Transformation.js b/src/geometry/Transformation.js index cee41693..03ab86bc 100644 --- a/src/geometry/Transformation.js +++ b/src/geometry/Transformation.js @@ -29,7 +29,7 @@ L.Transformation = function (a, b, c, d) { L.Transformation.prototype = { // @method transform(point: Point, scale?: Number): Point // Returns a transformed point, optionally multiplied by the given scale. - // Only accepts real `L.Point` instances, not arrays. + // Only accepts actual `L.Point` instances, not arrays. transform: function (point, scale) { // (Point, Number) -> Point return this._transform(point.clone(), scale); }, @@ -44,7 +44,7 @@ L.Transformation.prototype = { // @method untransform(point: Point, scale?: Number): Point // Returns the reverse transformation of the given point, optionally divided - // by the given scale. Only accepts real `L.Point` instances, not arrays. + // by the given scale. Only accepts actual `L.Point` instances, not arrays. untransform: function (point, scale) { scale = scale || 1; return new L.Point(