Replace all instances and usages of LatLon to LonLat
git-svn-id: http://svn.openlayers.org/trunk/openlayers@99 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
+22
-22
@@ -148,8 +148,8 @@ OpenLayers.Size.prototype = {
|
||||
/**
|
||||
* @class This class represents a latitude and longitude pair
|
||||
*/
|
||||
OpenLayers.LatLon = Class.create();
|
||||
OpenLayers.LatLon.prototype = {
|
||||
OpenLayers.LonLat = Class.create();
|
||||
OpenLayers.LonLat.prototype = {
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
@@ -157,50 +157,50 @@ OpenLayers.LatLon.prototype = {
|
||||
* @param {float} lat
|
||||
* @param {float} lon
|
||||
*/
|
||||
initialize: function(lat, lon) {
|
||||
initialize: function(lon, lat) {
|
||||
this.lat = lat;
|
||||
this.lon = lon;
|
||||
},
|
||||
|
||||
/**
|
||||
* @return String representation of OpenLayers.LatLon object.
|
||||
* @return String representation of OpenLayers.LonLat object.
|
||||
* (ex. "lat=42,lon=5")
|
||||
* @type String
|
||||
*/
|
||||
toString:function() {
|
||||
return ("lat=" + this.lat + ",lon=" + this.lon);
|
||||
return ("lon=" + this.lon + ",lat=" + this.lat);
|
||||
},
|
||||
|
||||
/**
|
||||
* @return Shortened String representation of OpenLayers.LatLon object.
|
||||
* @return Shortened String representation of OpenLayers.LonLat object.
|
||||
* (ex. "42,5")
|
||||
* @type String
|
||||
*/
|
||||
toShortString:function() {
|
||||
return (this.lat + ", " + this.lon);
|
||||
return (this.lon + ", " + this.lat);
|
||||
},
|
||||
|
||||
/**
|
||||
* @return New OpenLayers.LatLon object with the same lat and lon values
|
||||
* @type OpenLayers.LatLon
|
||||
* @return New OpenLayers.LonLat object with the same lat and lon values
|
||||
* @type OpenLayers.LonLat
|
||||
*/
|
||||
copyOf:function() {
|
||||
return new OpenLayers.LatLon(this.lat, this.lon);
|
||||
return new OpenLayers.LonLat(this.lon, this.lat);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.LatLon} ll
|
||||
* @param {OpenLayers.LonLat} ll
|
||||
*
|
||||
* @return a LatLon object with the difference between the two coords
|
||||
* @return an OpenLayers.LonLat object with the difference between the two coords
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
diff:function(ll) {
|
||||
return new OpenLayers.LatLon(this.lat - ll.lat, this.lon - ll.lon);
|
||||
return new OpenLayers.LonLat(this.lon - ll.lon, this.lat - ll.lat);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.LatLon} ll
|
||||
* @returns Boolean value indicating whether the passed-in OpenLayers.LatLon
|
||||
* @param {OpenLayers.LonLat} ll
|
||||
* @returns Boolean value indicating whether the passed-in OpenLayers.LonLat
|
||||
* object has the same lat and lon components as this
|
||||
*
|
||||
* @type bool
|
||||
@@ -210,22 +210,22 @@ OpenLayers.LatLon.prototype = {
|
||||
},
|
||||
|
||||
/** @type String */
|
||||
CLASS_NAME: "OpenLayers.LatLon"
|
||||
CLASS_NAME: "OpenLayers.LonLat"
|
||||
};
|
||||
|
||||
/** Alternative constructor that builds a new OpenLayers.LatLon from a
|
||||
/** Alternative constructor that builds a new OpenLayers.LonLat from a
|
||||
* parameter string
|
||||
*
|
||||
* @constructor
|
||||
*
|
||||
* @param {String} str Comma-separated coordinate string. (ex. "40,5")
|
||||
* @param {String} str Comma-separated Lon,Lat coordinate string. (ex. "5,40")
|
||||
*
|
||||
* @returns New OpenLayers.LatLon object built from the passed-in String.
|
||||
* @type OpenLayers.LatLon
|
||||
* @returns New OpenLayers.LonLat object built from the passed-in String.
|
||||
* @type OpenLayers.LonLat
|
||||
*/
|
||||
OpenLayers.LatLon.fromString = function(str) {
|
||||
OpenLayers.LonLat.fromString = function(str) {
|
||||
var pair = str.split(",");
|
||||
return new OpenLayers.LatLon(pair[1], pair[0]);
|
||||
return new OpenLayers.LonLat(pair[0], pair[1]);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user