[Pkg-javascript-commits] [leaflet] 04/301: Renames L.LatLng property .altitude to .alt
Jonas Smedegaard
js at moszumanska.debian.org
Mon Jan 27 22:22:37 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository leaflet.
commit 8e98e52b88499fff1cb93265f708487b64354a67
Author: Hans Kristian Flaatten <hans at starefossen.com>
Date: Wed Jul 3 15:44:57 2013 +0200
Renames L.LatLng property .altitude to .alt
---
spec/suites/geo/LatLngSpec.js | 6 +++---
src/geo/LatLng.js | 6 +++---
src/layer/GeoJSON.js | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/spec/suites/geo/LatLngSpec.js b/spec/suites/geo/LatLngSpec.js
index 933fe32..f3b8d74 100644
--- a/spec/suites/geo/LatLngSpec.js
+++ b/spec/suites/geo/LatLngSpec.js
@@ -18,15 +18,15 @@ describe('LatLng', function() {
it ('does not set altitude if undefined', function () {
var a = new L.LatLng(25, 74);
- expect(typeof a.altitude).to.eql('undefined');
+ expect(typeof a.alt).to.eql('undefined');
});
it ('sets altitude', function () {
var a = new L.LatLng(25, 74, 50);
- expect(a.altitude).to.eql(50);
+ expect(a.alt).to.eql(50);
var b = new L.LatLng(-25, -74, -50);
- expect(b.altitude).to.eql(-50);
+ expect(b.alt).to.eql(-50);
});
});
diff --git a/src/geo/LatLng.js b/src/geo/LatLng.js
index 26eb709..fbc1f56 100644
--- a/src/geo/LatLng.js
+++ b/src/geo/LatLng.js
@@ -2,7 +2,7 @@
* L.LatLng represents a geographical point with latitude and longitude coordinates.
*/
-L.LatLng = function (rawLat, rawLng, rawAltitude) { // (Number, Number, Number)
+L.LatLng = function (rawLat, rawLng, rawAlt) { // (Number, Number, Number)
var lat = parseFloat(rawLat),
lng = parseFloat(rawLng);
@@ -13,8 +13,8 @@ L.LatLng = function (rawLat, rawLng, rawAltitude) { // (Number, Number, Number)
this.lat = lat;
this.lng = lng;
- if (typeof rawAltitude !== 'undefined') {
- this.altitude = parseFloat(rawAltitude);
+ if (typeof rawAlt !== 'undefined') {
+ this.alt = parseFloat(rawAlt);
}
};
diff --git a/src/layer/GeoJSON.js b/src/layer/GeoJSON.js
index 04d2ba1..32798f1 100644
--- a/src/layer/GeoJSON.js
+++ b/src/layer/GeoJSON.js
@@ -147,10 +147,10 @@ L.extend(L.GeoJSON, {
},
latLngToCoords: function (latLng) {
- if (typeof latLng.altitude === 'undefined') {
+ if (typeof latLng.alt === 'undefined') {
return [latLng.lng, latLng.lat];
} else {
- return [latLng.lng, latLng.lat, latLng.altitude];
+ return [latLng.lng, latLng.lat, latLng.alt];
}
},
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet.git
More information about the Pkg-javascript-commits
mailing list