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.
This commit is contained in:
erick 2016-10-12 03:22:05 -04:00 committed by Iván Sánchez Ortega
parent eff82bfbbe
commit d2add3dd5c
2 changed files with 4 additions and 4 deletions

View File

@ -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 The bounds where the projection is valid
@method project(latlng: LatLng): Point @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 @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.

View File

@ -29,7 +29,7 @@ L.Transformation = function (a, b, c, d) {
L.Transformation.prototype = { L.Transformation.prototype = {
// @method transform(point: Point, scale?: Number): Point // @method transform(point: Point, scale?: Number): Point
// Returns a transformed point, optionally multiplied by the given scale. // 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 transform: function (point, scale) { // (Point, Number) -> Point
return this._transform(point.clone(), scale); return this._transform(point.clone(), scale);
}, },
@ -44,7 +44,7 @@ L.Transformation.prototype = {
// @method untransform(point: Point, scale?: Number): Point // @method untransform(point: Point, scale?: Number): Point
// Returns the reverse transformation of the given point, optionally divided // 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) { untransform: function (point, scale) {
scale = scale || 1; scale = scale || 1;
return new L.Point( return new L.Point(