[OpenLayers-Commits] r12011 - in sandbox/elemoine/slim: build
examples lib/OpenLayers lib/OpenLayers/BaseTypes
lib/OpenLayers/Format lib/OpenLayers/Handler
lib/OpenLayers/Layer lib/OpenLayers/Protocol
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Wed May 25 16:50:09 EDT 2011
Author: erilem
Date: 2011-05-25 13:50:07 -0700 (Wed, 25 May 2011)
New Revision: 12011
Modified:
sandbox/elemoine/slim/build/mobile.cfg
sandbox/elemoine/slim/examples/mobile.html
sandbox/elemoine/slim/examples/mobile.js
sandbox/elemoine/slim/lib/OpenLayers/BaseTypes.js
sandbox/elemoine/slim/lib/OpenLayers/BaseTypes/Bounds.js
sandbox/elemoine/slim/lib/OpenLayers/BaseTypes/LonLat.js
sandbox/elemoine/slim/lib/OpenLayers/BaseTypes/Pixel.js
sandbox/elemoine/slim/lib/OpenLayers/Format.js
sandbox/elemoine/slim/lib/OpenLayers/Format/GeoJSON.js
sandbox/elemoine/slim/lib/OpenLayers/Format/QueryStringFilter.js
sandbox/elemoine/slim/lib/OpenLayers/Geometry.js
sandbox/elemoine/slim/lib/OpenLayers/Handler/Point.js
sandbox/elemoine/slim/lib/OpenLayers/Layer/Vector.js
sandbox/elemoine/slim/lib/OpenLayers/Map.js
sandbox/elemoine/slim/lib/OpenLayers/Protocol/HTTP.js
sandbox/elemoine/slim/lib/OpenLayers/Tile.js
sandbox/elemoine/slim/lib/OpenLayers/Util.js
Log:
put OpenLayers on a diet
Modified: sandbox/elemoine/slim/build/mobile.cfg
===================================================================
--- sandbox/elemoine/slim/build/mobile.cfg 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/build/mobile.cfg 2011-05-25 20:50:07 UTC (rev 12011)
@@ -8,28 +8,9 @@
OpenLayers/Projection.js
OpenLayers/Layer/SphericalMercator.js
OpenLayers/Layer/XYZ.js
-OpenLayers/Layer/Bing.js
-OpenLayers/Layer/WMS.js
OpenLayers/Control/TouchNavigation.js
-OpenLayers/Control/Geolocate.js
OpenLayers/Control/ZoomPanel.js
OpenLayers/Control/Attribution.js
-OpenLayers/Control/SelectFeature.js
-OpenLayers/Control/DrawFeature.js
-OpenLayers/Control/ModifyFeature.js
-OpenLayers/Control/Panel.js
-OpenLayers/Handler/Point.js
-OpenLayers/Handler/Path.js
-OpenLayers/Handler/Polygon.js
-OpenLayers/Layer/Vector.js
-OpenLayers/Renderer/SVG.js
-OpenLayers/Renderer/Canvas.js
-OpenLayers/Format/GeoJSON.js
-OpenLayers/Format/KML.js
-OpenLayers/Protocol/HTTP.js
-OpenLayers/Protocol/WFS.js
-OpenLayers/Protocol/WFS/v1_0_0.js
-OpenLayers/Strategy/Fixed.js
[exclude]
Modified: sandbox/elemoine/slim/examples/mobile.html
===================================================================
--- sandbox/elemoine/slim/examples/mobile.html 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/examples/mobile.html 2011-05-25 20:50:07 UTC (rev 12011)
@@ -6,7 +6,8 @@
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0;">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="style.mobile.css" type="text/css">
- <script src="../lib/OpenLayers.js?mobile"></script>
+ <!--<script src="../lib/OpenLayers.js?mobile"></script>-->
+ <script src="../build/OpenLayers.mobile.js"></script>
<script src="mobile.js"></script>
<style>
html, body {
Modified: sandbox/elemoine/slim/examples/mobile.js
===================================================================
--- sandbox/elemoine/slim/examples/mobile.js 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/examples/mobile.js 2011-05-25 20:50:07 UTC (rev 12011)
@@ -23,7 +23,7 @@
new OpenLayers.Control.Attribution(),
new OpenLayers.Control.TouchNavigation({
dragPanOptions: {
- interval: 100,
+ interval: 1,
enableKinetic: true
}
}),
Modified: sandbox/elemoine/slim/lib/OpenLayers/BaseTypes/Bounds.js
===================================================================
--- sandbox/elemoine/slim/lib/OpenLayers/BaseTypes/Bounds.js 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/lib/OpenLayers/BaseTypes/Bounds.js 2011-05-25 20:50:07 UTC (rev 12011)
@@ -5,8 +5,6 @@
/**
* @requires OpenLayers/BaseTypes/Class.js
- * @requires OpenLayers/Console.js
- * @requires OpenLayers/Lang.js
*/
/**
Modified: sandbox/elemoine/slim/lib/OpenLayers/BaseTypes/LonLat.js
===================================================================
--- sandbox/elemoine/slim/lib/OpenLayers/BaseTypes/LonLat.js 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/lib/OpenLayers/BaseTypes/LonLat.js 2011-05-25 20:50:07 UTC (rev 12011)
@@ -5,8 +5,6 @@
/**
* @requires OpenLayers/BaseTypes/Class.js
- * @requires OpenLayers/Console.js
- * @requires OpenLayers/Lang.js
*/
/**
Modified: sandbox/elemoine/slim/lib/OpenLayers/BaseTypes/Pixel.js
===================================================================
--- sandbox/elemoine/slim/lib/OpenLayers/BaseTypes/Pixel.js 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/lib/OpenLayers/BaseTypes/Pixel.js 2011-05-25 20:50:07 UTC (rev 12011)
@@ -5,8 +5,6 @@
/**
* @requires OpenLayers/BaseTypes/Class.js
- * @requires OpenLayers/Console.js
- * @requires OpenLayers/Lang.js
*/
/**
Modified: sandbox/elemoine/slim/lib/OpenLayers/BaseTypes.js
===================================================================
--- sandbox/elemoine/slim/lib/OpenLayers/BaseTypes.js 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/lib/OpenLayers/BaseTypes.js 2011-05-25 20:50:07 UTC (rev 12011)
@@ -3,11 +3,7 @@
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
* full text of the license. */
-/**
- * @requires OpenLayers/Lang.js
- * @requires OpenLayers/Console.js
- */
-
+
/**
* Header: OpenLayers Base Types
* OpenLayers custom string, number and function functions are described here.
Modified: sandbox/elemoine/slim/lib/OpenLayers/Format/GeoJSON.js
===================================================================
--- sandbox/elemoine/slim/lib/OpenLayers/Format/GeoJSON.js 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/lib/OpenLayers/Format/GeoJSON.js 2011-05-25 20:50:07 UTC (rev 12011)
@@ -6,13 +6,6 @@
/**
* @requires OpenLayers/Format/JSON.js
* @requires OpenLayers/Feature/Vector.js
- * @requires OpenLayers/Geometry/Point.js
- * @requires OpenLayers/Geometry/MultiPoint.js
- * @requires OpenLayers/Geometry/LineString.js
- * @requires OpenLayers/Geometry/MultiLineString.js
- * @requires OpenLayers/Geometry/Polygon.js
- * @requires OpenLayers/Geometry/MultiPolygon.js
- * @requires OpenLayers/Console.js
*/
/**
Modified: sandbox/elemoine/slim/lib/OpenLayers/Format/QueryStringFilter.js
===================================================================
--- sandbox/elemoine/slim/lib/OpenLayers/Format/QueryStringFilter.js 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/lib/OpenLayers/Format/QueryStringFilter.js 2011-05-25 20:50:07 UTC (rev 12011)
@@ -6,6 +6,8 @@
/**
* @requires OpenLayers/Format.js
* @requires OpenLayers/Filter/Comparison.js
+ * @requires OpenLayers/Filter/Spatial.js
+ * @requires OpenLayers/Filter/Logical.js
*/
/**
@@ -177,4 +179,4 @@
});
-})();
\ No newline at end of file
+})();
Modified: sandbox/elemoine/slim/lib/OpenLayers/Format.js
===================================================================
--- sandbox/elemoine/slim/lib/OpenLayers/Format.js 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/lib/OpenLayers/Format.js 2011-05-25 20:50:07 UTC (rev 12011)
@@ -6,8 +6,6 @@
/**
* @requires OpenLayers/BaseTypes/Class.js
* @requires OpenLayers/Util.js
- * @requires OpenLayers/Console.js
- * @requires OpenLayers/Lang.js
*/
/**
Modified: sandbox/elemoine/slim/lib/OpenLayers/Geometry.js
===================================================================
--- sandbox/elemoine/slim/lib/OpenLayers/Geometry.js 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/lib/OpenLayers/Geometry.js 2011-05-25 20:50:07 UTC (rev 12011)
@@ -5,7 +5,6 @@
/**
* @requires OpenLayers/BaseTypes/Class.js
- * @requires OpenLayers/Format/WKT.js
* @requires OpenLayers/Feature/Vector.js
*/
@@ -246,9 +245,11 @@
* {String} Well-Known Text
*/
toString: function() {
- return OpenLayers.Format.WKT.prototype.write(
- new OpenLayers.Feature.Vector(this)
- );
+ var WKT = OpenLayers.Format.WKT;
+ if(!WKT) {
+ throw 'no WKT constructor';
+ }
+ return WKT(new OpenLayers.Feature.Vector(this));
},
CLASS_NAME: "OpenLayers.Geometry"
@@ -265,9 +266,13 @@
* {<OpenLayers.Geometry>} A geometry of the appropriate class.
*/
OpenLayers.Geometry.fromWKT = function(wkt) {
+ var WKT = OpenLayers.Format.WKT;
+ if(!WKT) {
+ throw 'no WKT constructor';
+ }
var format = arguments.callee.format;
if(!format) {
- format = new OpenLayers.Format.WKT();
+ format = new WKT();
arguments.callee.format = format;
}
var geom;
Modified: sandbox/elemoine/slim/lib/OpenLayers/Handler/Point.js
===================================================================
--- sandbox/elemoine/slim/lib/OpenLayers/Handler/Point.js 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/lib/OpenLayers/Handler/Point.js 2011-05-25 20:50:07 UTC (rev 12011)
@@ -250,7 +250,6 @@
*/
finalize: function(cancel, noNew) {
var key = cancel ? "cancel" : "done";
- this.drawing = false;
this.mouseDown = false;
this.lastDown = null;
this.lastUp = null;
Modified: sandbox/elemoine/slim/lib/OpenLayers/Layer/Vector.js
===================================================================
--- sandbox/elemoine/slim/lib/OpenLayers/Layer/Vector.js 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/lib/OpenLayers/Layer/Vector.js 2011-05-25 20:50:07 UTC (rev 12011)
@@ -8,8 +8,6 @@
* @requires OpenLayers/Renderer.js
* @requires OpenLayers/StyleMap.js
* @requires OpenLayers/Feature/Vector.js
- * @requires OpenLayers/Console.js
- * @requires OpenLayers/Lang.js
*/
/**
Modified: sandbox/elemoine/slim/lib/OpenLayers/Map.js
===================================================================
--- sandbox/elemoine/slim/lib/OpenLayers/Map.js 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/lib/OpenLayers/Map.js 2011-05-25 20:50:07 UTC (rev 12011)
@@ -7,9 +7,6 @@
* @requires OpenLayers/BaseTypes/Class.js
* @requires OpenLayers/Util.js
* @requires OpenLayers/Events.js
- * @requires OpenLayers/Tween.js
- * @requires OpenLayers/Console.js
- * @requires OpenLayers/Lang.js
*/
/**
@@ -397,7 +394,7 @@
* OpenLayers.Easing.Expo.easeOut. Setting this to 'null' turns off
* animated panning.
*/
- panMethod: OpenLayers.Easing.Expo.easeOut,
+ panMethod: null,
/**
* Property: panDuration
@@ -953,9 +950,9 @@
addLayer: function (layer) {
for(var i=0, len=this.layers.length; i <len; i++) {
if (this.layers[i] == layer) {
- var msg = OpenLayers.i18n('layerAlreadyAdded',
- {'layerName':layer.name});
- OpenLayers.Console.warn(msg);
+ //var msg = OpenLayers.i18n('layerAlreadyAdded',
+ //{'layerName':layer.name});
+ //OpenLayers.Console.warn(msg);
return false;
}
}
Modified: sandbox/elemoine/slim/lib/OpenLayers/Protocol/HTTP.js
===================================================================
--- sandbox/elemoine/slim/lib/OpenLayers/Protocol/HTTP.js 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/lib/OpenLayers/Protocol/HTTP.js 2011-05-25 20:50:07 UTC (rev 12011)
@@ -4,21 +4,12 @@
* full text of the license. */
/**
- * @requires OpenLayers/Console.js
* @requires OpenLayers/Protocol.js
* @requires OpenLayers/Feature/Vector.js
- * @requires OpenLayers/Filter/Spatial.js
- * @requires OpenLayers/Filter/Comparison.js
- * @requires OpenLayers/Filter/Logical.js
* @requires OpenLayers/Request/XMLHttpRequest.js
*/
/**
- * TODO: remove this dependency in 3.0
- * @requires OpenLayers/Format/QueryStringFilter.js
- */
-
-/**
* Class: OpenLayers.Protocol.HTTP
* A basic HTTP protocol for vector layers. Create a new instance with the
* <OpenLayers.Protocol.HTTP> constructor.
Modified: sandbox/elemoine/slim/lib/OpenLayers/Tile.js
===================================================================
--- sandbox/elemoine/slim/lib/OpenLayers/Tile.js 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/lib/OpenLayers/Tile.js 2011-05-25 20:50:07 UTC (rev 12011)
@@ -7,8 +7,6 @@
/*
* @requires OpenLayers/BaseTypes/Class.js
* @requires OpenLayers/Util.js
- * @requires OpenLayers/Console.js
- * @requires OpenLayers/Lang.js
*/
/*
Modified: sandbox/elemoine/slim/lib/OpenLayers/Util.js
===================================================================
--- sandbox/elemoine/slim/lib/OpenLayers/Util.js 2011-05-25 20:45:35 UTC (rev 12010)
+++ sandbox/elemoine/slim/lib/OpenLayers/Util.js 2011-05-25 20:50:07 UTC (rev 12011)
@@ -10,8 +10,6 @@
* @requires OpenLayers/BaseTypes/LonLat.js
* @requires OpenLayers/BaseTypes/Pixel.js
* @requires OpenLayers/BaseTypes/Size.js
- * @requires OpenLayers/Console.js
- * @requires OpenLayers/Lang.js
*/
/**
@@ -375,7 +373,7 @@
* Property: alphaHackNeeded
* {Boolean} true if the png alpha hack is necessary and possible, false otherwise.
*/
-OpenLayers.Util.alphaHackNeeded = null;
+//OpenLayers.Util.alphaHackNeeded = null;
/**
* Function: alphaHack
@@ -386,26 +384,26 @@
* Returns:
* {Boolean} true if the png alpha hack is necessary and possible, false otherwise.
*/
-OpenLayers.Util.alphaHack = function() {
- if (OpenLayers.Util.alphaHackNeeded == null) {
- var arVersion = navigator.appVersion.split("MSIE");
- var version = parseFloat(arVersion[1]);
- var filter = false;
+//OpenLayers.Util.alphaHack = function() {
+ //if (OpenLayers.Util.alphaHackNeeded == null) {
+ //var arVersion = navigator.appVersion.split("MSIE");
+ //var version = parseFloat(arVersion[1]);
+ //var filter = false;
- // IEs4Lin dies when trying to access document.body.filters, because
- // the property is there, but requires a DLL that can't be provided. This
- // means that we need to wrap this in a try/catch so that this can
- // continue.
+ //// IEs4Lin dies when trying to access document.body.filters, because
+ //// the property is there, but requires a DLL that can't be provided. This
+ //// means that we need to wrap this in a try/catch so that this can
+ //// continue.
- try {
- filter = !!(document.body.filters);
- } catch (e) {}
+ //try {
+ //filter = !!(document.body.filters);
+ //} catch (e) {}
- OpenLayers.Util.alphaHackNeeded = (filter &&
- (version >= 5.5) && (version < 7));
- }
- return OpenLayers.Util.alphaHackNeeded;
-};
+ //OpenLayers.Util.alphaHackNeeded = (filter &&
+ //(version >= 5.5) && (version < 7));
+ //}
+ //return OpenLayers.Util.alphaHackNeeded;
+//};
/**
* Function: modifyAlphaImageDiv
@@ -738,23 +736,23 @@
* Returns:
* {String}
*/
-OpenLayers.Util.getTagText = function (parent, item, index) {
- var result = OpenLayers.Util.getNodes(parent, item);
- if (result && (result.length > 0))
- {
- if (!index) {
- index=0;
- }
- if (result[index].childNodes.length > 1) {
- return result.childNodes[1].nodeValue;
- }
- else if (result[index].childNodes.length == 1) {
- return result[index].firstChild.nodeValue;
- }
- } else {
- return "";
- }
-};
+//OpenLayers.Util.getTagText = function (parent, item, index) {
+ //var result = OpenLayers.Util.getNodes(parent, item);
+ //if (result && (result.length > 0))
+ //{
+ //if (!index) {
+ //index=0;
+ //}
+ //if (result[index].childNodes.length > 1) {
+ //return result.childNodes[1].nodeValue;
+ //}
+ //else if (result[index].childNodes.length == 1) {
+ //return result[index].firstChild.nodeValue;
+ //}
+ //} else {
+ //return "";
+ //}
+//};
/**
* Function: getXmlNodeValue
@@ -765,23 +763,23 @@
* Returns:
* {String} The text value of the given node, without breaking in firefox or IE
*/
-OpenLayers.Util.getXmlNodeValue = function(node) {
- var val = null;
- OpenLayers.Util.Try(
- function() {
- val = node.text;
- if (!val) {
- val = node.textContent;
- }
- if (!val) {
- val = node.firstChild.nodeValue;
- }
- },
- function() {
- val = node.textContent;
- });
- return val;
-};
+//OpenLayers.Util.getXmlNodeValue = function(node) {
+ //var val = null;
+ //OpenLayers.Util.Try(
+ //function() {
+ //val = node.text;
+ //if (!val) {
+ //val = node.textContent;
+ //}
+ //if (!val) {
+ //val = node.firstChild.nodeValue;
+ //}
+ //},
+ //function() {
+ //val = node.textContent;
+ //});
+ //return val;
+//};
/**
* Function: mouseLeft
@@ -873,11 +871,11 @@
* Property: VincentyConstants
* {Object} Constants for Vincenty functions.
*/
-OpenLayers.Util.VincentyConstants = {
- a: 6378137,
- b: 6356752.3142,
- f: 1/298.257223563
-};
+//OpenLayers.Util.VincentyConstants = {
+ //a: 6378137,
+ //b: 6356752.3142,
+ //f: 1/298.257223563
+//};
/**
* APIFunction: distVincenty
@@ -894,46 +892,46 @@
* ellipsoid. Note that the input point objects must be in geographic
* coordinates (decimal degrees) and the return distance is in kilometers.
*/
-OpenLayers.Util.distVincenty = function(p1, p2) {
- var ct = OpenLayers.Util.VincentyConstants;
- var a = ct.a, b = ct.b, f = ct.f;
+//OpenLayers.Util.distVincenty = function(p1, p2) {
+ //var ct = OpenLayers.Util.VincentyConstants;
+ //var a = ct.a, b = ct.b, f = ct.f;
- var L = OpenLayers.Util.rad(p2.lon - p1.lon);
- var U1 = Math.atan((1-f) * Math.tan(OpenLayers.Util.rad(p1.lat)));
- var U2 = Math.atan((1-f) * Math.tan(OpenLayers.Util.rad(p2.lat)));
- var sinU1 = Math.sin(U1), cosU1 = Math.cos(U1);
- var sinU2 = Math.sin(U2), cosU2 = Math.cos(U2);
- var lambda = L, lambdaP = 2*Math.PI;
- var iterLimit = 20;
- while (Math.abs(lambda-lambdaP) > 1e-12 && --iterLimit>0) {
- var sinLambda = Math.sin(lambda), cosLambda = Math.cos(lambda);
- var sinSigma = Math.sqrt((cosU2*sinLambda) * (cosU2*sinLambda) +
- (cosU1*sinU2-sinU1*cosU2*cosLambda) * (cosU1*sinU2-sinU1*cosU2*cosLambda));
- if (sinSigma==0) {
- return 0; // co-incident points
- }
- var cosSigma = sinU1*sinU2 + cosU1*cosU2*cosLambda;
- var sigma = Math.atan2(sinSigma, cosSigma);
- var alpha = Math.asin(cosU1 * cosU2 * sinLambda / sinSigma);
- var cosSqAlpha = Math.cos(alpha) * Math.cos(alpha);
- var cos2SigmaM = cosSigma - 2*sinU1*sinU2/cosSqAlpha;
- var C = f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha));
- lambdaP = lambda;
- lambda = L + (1-C) * f * Math.sin(alpha) *
- (sigma + C*sinSigma*(cos2SigmaM+C*cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)));
- }
- if (iterLimit==0) {
- return NaN; // formula failed to converge
- }
- var uSq = cosSqAlpha * (a*a - b*b) / (b*b);
- var A = 1 + uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq)));
- var B = uSq/1024 * (256+uSq*(-128+uSq*(74-47*uSq)));
- var deltaSigma = B*sinSigma*(cos2SigmaM+B/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)-
- B/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM)));
- var s = b*A*(sigma-deltaSigma);
- var d = s.toFixed(3)/1000; // round to 1mm precision
- return d;
-};
+ //var L = OpenLayers.Util.rad(p2.lon - p1.lon);
+ //var U1 = Math.atan((1-f) * Math.tan(OpenLayers.Util.rad(p1.lat)));
+ //var U2 = Math.atan((1-f) * Math.tan(OpenLayers.Util.rad(p2.lat)));
+ //var sinU1 = Math.sin(U1), cosU1 = Math.cos(U1);
+ //var sinU2 = Math.sin(U2), cosU2 = Math.cos(U2);
+ //var lambda = L, lambdaP = 2*Math.PI;
+ //var iterLimit = 20;
+ //while (Math.abs(lambda-lambdaP) > 1e-12 && --iterLimit>0) {
+ //var sinLambda = Math.sin(lambda), cosLambda = Math.cos(lambda);
+ //var sinSigma = Math.sqrt((cosU2*sinLambda) * (cosU2*sinLambda) +
+ //(cosU1*sinU2-sinU1*cosU2*cosLambda) * (cosU1*sinU2-sinU1*cosU2*cosLambda));
+ //if (sinSigma==0) {
+ //return 0; // co-incident points
+ //}
+ //var cosSigma = sinU1*sinU2 + cosU1*cosU2*cosLambda;
+ //var sigma = Math.atan2(sinSigma, cosSigma);
+ //var alpha = Math.asin(cosU1 * cosU2 * sinLambda / sinSigma);
+ //var cosSqAlpha = Math.cos(alpha) * Math.cos(alpha);
+ //var cos2SigmaM = cosSigma - 2*sinU1*sinU2/cosSqAlpha;
+ //var C = f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha));
+ //lambdaP = lambda;
+ //lambda = L + (1-C) * f * Math.sin(alpha) *
+ //(sigma + C*sinSigma*(cos2SigmaM+C*cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)));
+ //}
+ //if (iterLimit==0) {
+ //return NaN; // formula failed to converge
+ //}
+ //var uSq = cosSqAlpha * (a*a - b*b) / (b*b);
+ //var A = 1 + uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq)));
+ //var B = uSq/1024 * (256+uSq*(-128+uSq*(74-47*uSq)));
+ //var deltaSigma = B*sinSigma*(cos2SigmaM+B/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)-
+ //B/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM)));
+ //var s = b*A*(sigma-deltaSigma);
+ //var d = s.toFixed(3)/1000; // round to 1mm precision
+ //return d;
+//};
/**
* APIFunction: destinationVincenty
@@ -951,51 +949,51 @@
* Returns:
* {<OpenLayers.LonLat>} The destination point.
*/
-OpenLayers.Util.destinationVincenty = function(lonlat, brng, dist) {
- var u = OpenLayers.Util;
- var ct = u.VincentyConstants;
- var a = ct.a, b = ct.b, f = ct.f;
+//OpenLayers.Util.destinationVincenty = function(lonlat, brng, dist) {
+ //var u = OpenLayers.Util;
+ //var ct = u.VincentyConstants;
+ //var a = ct.a, b = ct.b, f = ct.f;
- var lon1 = lonlat.lon;
- var lat1 = lonlat.lat;
+ //var lon1 = lonlat.lon;
+ //var lat1 = lonlat.lat;
- var s = dist;
- var alpha1 = u.rad(brng);
- var sinAlpha1 = Math.sin(alpha1);
- var cosAlpha1 = Math.cos(alpha1);
+ //var s = dist;
+ //var alpha1 = u.rad(brng);
+ //var sinAlpha1 = Math.sin(alpha1);
+ //var cosAlpha1 = Math.cos(alpha1);
- var tanU1 = (1-f) * Math.tan(u.rad(lat1));
- var cosU1 = 1 / Math.sqrt((1 + tanU1*tanU1)), sinU1 = tanU1*cosU1;
- var sigma1 = Math.atan2(tanU1, cosAlpha1);
- var sinAlpha = cosU1 * sinAlpha1;
- var cosSqAlpha = 1 - sinAlpha*sinAlpha;
- var uSq = cosSqAlpha * (a*a - b*b) / (b*b);
- var A = 1 + uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq)));
- var B = uSq/1024 * (256+uSq*(-128+uSq*(74-47*uSq)));
+ //var tanU1 = (1-f) * Math.tan(u.rad(lat1));
+ //var cosU1 = 1 / Math.sqrt((1 + tanU1*tanU1)), sinU1 = tanU1*cosU1;
+ //var sigma1 = Math.atan2(tanU1, cosAlpha1);
+ //var sinAlpha = cosU1 * sinAlpha1;
+ //var cosSqAlpha = 1 - sinAlpha*sinAlpha;
+ //var uSq = cosSqAlpha * (a*a - b*b) / (b*b);
+ //var A = 1 + uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq)));
+ //var B = uSq/1024 * (256+uSq*(-128+uSq*(74-47*uSq)));
- var sigma = s / (b*A), sigmaP = 2*Math.PI;
- while (Math.abs(sigma-sigmaP) > 1e-12) {
- var cos2SigmaM = Math.cos(2*sigma1 + sigma);
- var sinSigma = Math.sin(sigma);
- var cosSigma = Math.cos(sigma);
- var deltaSigma = B*sinSigma*(cos2SigmaM+B/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)-
- B/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM)));
- sigmaP = sigma;
- sigma = s / (b*A) + deltaSigma;
- }
+ //var sigma = s / (b*A), sigmaP = 2*Math.PI;
+ //while (Math.abs(sigma-sigmaP) > 1e-12) {
+ //var cos2SigmaM = Math.cos(2*sigma1 + sigma);
+ //var sinSigma = Math.sin(sigma);
+ //var cosSigma = Math.cos(sigma);
+ //var deltaSigma = B*sinSigma*(cos2SigmaM+B/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)-
+ //B/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM)));
+ //sigmaP = sigma;
+ //sigma = s / (b*A) + deltaSigma;
+ //}
- var tmp = sinU1*sinSigma - cosU1*cosSigma*cosAlpha1;
- var lat2 = Math.atan2(sinU1*cosSigma + cosU1*sinSigma*cosAlpha1,
- (1-f)*Math.sqrt(sinAlpha*sinAlpha + tmp*tmp));
- var lambda = Math.atan2(sinSigma*sinAlpha1, cosU1*cosSigma - sinU1*sinSigma*cosAlpha1);
- var C = f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha));
- var L = lambda - (1-C) * f * sinAlpha *
- (sigma + C*sinSigma*(cos2SigmaM+C*cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)));
+ //var tmp = sinU1*sinSigma - cosU1*cosSigma*cosAlpha1;
+ //var lat2 = Math.atan2(sinU1*cosSigma + cosU1*sinSigma*cosAlpha1,
+ //(1-f)*Math.sqrt(sinAlpha*sinAlpha + tmp*tmp));
+ //var lambda = Math.atan2(sinSigma*sinAlpha1, cosU1*cosSigma - sinU1*sinSigma*cosAlpha1);
+ //var C = f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha));
+ //var L = lambda - (1-C) * f * sinAlpha *
+ //(sigma + C*sinSigma*(cos2SigmaM+C*cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)));
- var revAz = Math.atan2(sinAlpha, -tmp); // final bearing
+ //var revAz = Math.atan2(sinAlpha, -tmp); // final bearing
- return new OpenLayers.LonLat(lon1+u.deg(L), u.deg(lat2));
-};
+ //return new OpenLayers.LonLat(lon1+u.deg(L), u.deg(lat2));
+//};
/**
* Function: getParameters
@@ -1071,14 +1069,14 @@
* Returns:
* {Object} An object of key/value pairs from the query string.
*/
-OpenLayers.Util.getArgs = function(url) {
- OpenLayers.Console.warn(
- OpenLayers.i18n(
- "methodDeprecated", {'newMethod': 'OpenLayers.Util.getParameters'}
- )
- );
- return OpenLayers.Util.getParameters(url);
-};
+//OpenLayers.Util.getArgs = function(url) {
+ //OpenLayers.Console.warn(
+ //OpenLayers.i18n(
+ //"methodDeprecated", {'newMethod': 'OpenLayers.Util.getParameters'}
+ //)
+ //);
+ //return OpenLayers.Util.getParameters(url);
+//};
/**
* Property: lastSeqID
@@ -1130,86 +1128,86 @@
OpenLayers.INCHES_PER_UNIT["nmi"] = 1852 * OpenLayers.INCHES_PER_UNIT.m;
// Units from CS-Map
-OpenLayers.METERS_PER_INCH = 0.02540005080010160020;
-OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT, {
- "Inch": OpenLayers.INCHES_PER_UNIT.inches,
- "Meter": 1.0 / OpenLayers.METERS_PER_INCH, //EPSG:9001
- "Foot": 0.30480060960121920243 / OpenLayers.METERS_PER_INCH, //EPSG:9003
- "IFoot": 0.30480000000000000000 / OpenLayers.METERS_PER_INCH, //EPSG:9002
- "ClarkeFoot": 0.3047972651151 / OpenLayers.METERS_PER_INCH, //EPSG:9005
- "SearsFoot": 0.30479947153867624624 / OpenLayers.METERS_PER_INCH, //EPSG:9041
- "GoldCoastFoot": 0.30479971018150881758 / OpenLayers.METERS_PER_INCH, //EPSG:9094
- "IInch": 0.02540000000000000000 / OpenLayers.METERS_PER_INCH,
- "MicroInch": 0.00002540000000000000 / OpenLayers.METERS_PER_INCH,
- "Mil": 0.00000002540000000000 / OpenLayers.METERS_PER_INCH,
- "Centimeter": 0.01000000000000000000 / OpenLayers.METERS_PER_INCH,
- "Kilometer": 1000.00000000000000000000 / OpenLayers.METERS_PER_INCH, //EPSG:9036
- "Yard": 0.91440182880365760731 / OpenLayers.METERS_PER_INCH,
- "SearsYard": 0.914398414616029 / OpenLayers.METERS_PER_INCH, //EPSG:9040
- "IndianYard": 0.91439853074444079983 / OpenLayers.METERS_PER_INCH, //EPSG:9084
- "IndianYd37": 0.91439523 / OpenLayers.METERS_PER_INCH, //EPSG:9085
- "IndianYd62": 0.9143988 / OpenLayers.METERS_PER_INCH, //EPSG:9086
- "IndianYd75": 0.9143985 / OpenLayers.METERS_PER_INCH, //EPSG:9087
- "IndianFoot": 0.30479951 / OpenLayers.METERS_PER_INCH, //EPSG:9080
- "IndianFt37": 0.30479841 / OpenLayers.METERS_PER_INCH, //EPSG:9081
- "IndianFt62": 0.3047996 / OpenLayers.METERS_PER_INCH, //EPSG:9082
- "IndianFt75": 0.3047995 / OpenLayers.METERS_PER_INCH, //EPSG:9083
- "Mile": 1609.34721869443738887477 / OpenLayers.METERS_PER_INCH,
- "IYard": 0.91440000000000000000 / OpenLayers.METERS_PER_INCH, //EPSG:9096
- "IMile": 1609.34400000000000000000 / OpenLayers.METERS_PER_INCH, //EPSG:9093
- "NautM": 1852.00000000000000000000 / OpenLayers.METERS_PER_INCH, //EPSG:9030
- "Lat-66": 110943.316488932731 / OpenLayers.METERS_PER_INCH,
- "Lat-83": 110946.25736872234125 / OpenLayers.METERS_PER_INCH,
- "Decimeter": 0.10000000000000000000 / OpenLayers.METERS_PER_INCH,
- "Millimeter": 0.00100000000000000000 / OpenLayers.METERS_PER_INCH,
- "Dekameter": 10.00000000000000000000 / OpenLayers.METERS_PER_INCH,
- "Decameter": 10.00000000000000000000 / OpenLayers.METERS_PER_INCH,
- "Hectometer": 100.00000000000000000000 / OpenLayers.METERS_PER_INCH,
- "GermanMeter": 1.0000135965 / OpenLayers.METERS_PER_INCH, //EPSG:9031
- "CaGrid": 0.999738 / OpenLayers.METERS_PER_INCH,
- "ClarkeChain": 20.1166194976 / OpenLayers.METERS_PER_INCH, //EPSG:9038
- "GunterChain": 20.11684023368047 / OpenLayers.METERS_PER_INCH, //EPSG:9033
- "BenoitChain": 20.116782494375872 / OpenLayers.METERS_PER_INCH, //EPSG:9062
- "SearsChain": 20.11676512155 / OpenLayers.METERS_PER_INCH, //EPSG:9042
- "ClarkeLink": 0.201166194976 / OpenLayers.METERS_PER_INCH, //EPSG:9039
- "GunterLink": 0.2011684023368047 / OpenLayers.METERS_PER_INCH, //EPSG:9034
- "BenoitLink": 0.20116782494375872 / OpenLayers.METERS_PER_INCH, //EPSG:9063
- "SearsLink": 0.2011676512155 / OpenLayers.METERS_PER_INCH, //EPSG:9043
- "Rod": 5.02921005842012 / OpenLayers.METERS_PER_INCH,
- "IntnlChain": 20.1168 / OpenLayers.METERS_PER_INCH, //EPSG:9097
- "IntnlLink": 0.201168 / OpenLayers.METERS_PER_INCH, //EPSG:9098
- "Perch": 5.02921005842012 / OpenLayers.METERS_PER_INCH,
- "Pole": 5.02921005842012 / OpenLayers.METERS_PER_INCH,
- "Furlong": 201.1684023368046 / OpenLayers.METERS_PER_INCH,
- "Rood": 3.778266898 / OpenLayers.METERS_PER_INCH,
- "CapeFoot": 0.3047972615 / OpenLayers.METERS_PER_INCH,
- "Brealey": 375.00000000000000000000 / OpenLayers.METERS_PER_INCH,
- "ModAmFt": 0.304812252984505969011938 / OpenLayers.METERS_PER_INCH,
- "Fathom": 1.8288 / OpenLayers.METERS_PER_INCH,
- "NautM-UK": 1853.184 / OpenLayers.METERS_PER_INCH,
- "50kilometers": 50000.0 / OpenLayers.METERS_PER_INCH,
- "150kilometers": 150000.0 / OpenLayers.METERS_PER_INCH
-});
+//OpenLayers.METERS_PER_INCH = 0.02540005080010160020;
+//OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT, {
+ //"Inch": OpenLayers.INCHES_PER_UNIT.inches,
+ //"Meter": 1.0 / OpenLayers.METERS_PER_INCH, //EPSG:9001
+ //"Foot": 0.30480060960121920243 / OpenLayers.METERS_PER_INCH, //EPSG:9003
+ //"IFoot": 0.30480000000000000000 / OpenLayers.METERS_PER_INCH, //EPSG:9002
+ //"ClarkeFoot": 0.3047972651151 / OpenLayers.METERS_PER_INCH, //EPSG:9005
+ //"SearsFoot": 0.30479947153867624624 / OpenLayers.METERS_PER_INCH, //EPSG:9041
+ //"GoldCoastFoot": 0.30479971018150881758 / OpenLayers.METERS_PER_INCH, //EPSG:9094
+ //"IInch": 0.02540000000000000000 / OpenLayers.METERS_PER_INCH,
+ //"MicroInch": 0.00002540000000000000 / OpenLayers.METERS_PER_INCH,
+ //"Mil": 0.00000002540000000000 / OpenLayers.METERS_PER_INCH,
+ //"Centimeter": 0.01000000000000000000 / OpenLayers.METERS_PER_INCH,
+ //"Kilometer": 1000.00000000000000000000 / OpenLayers.METERS_PER_INCH, //EPSG:9036
+ //"Yard": 0.91440182880365760731 / OpenLayers.METERS_PER_INCH,
+ //"SearsYard": 0.914398414616029 / OpenLayers.METERS_PER_INCH, //EPSG:9040
+ //"IndianYard": 0.91439853074444079983 / OpenLayers.METERS_PER_INCH, //EPSG:9084
+ //"IndianYd37": 0.91439523 / OpenLayers.METERS_PER_INCH, //EPSG:9085
+ //"IndianYd62": 0.9143988 / OpenLayers.METERS_PER_INCH, //EPSG:9086
+ //"IndianYd75": 0.9143985 / OpenLayers.METERS_PER_INCH, //EPSG:9087
+ //"IndianFoot": 0.30479951 / OpenLayers.METERS_PER_INCH, //EPSG:9080
+ //"IndianFt37": 0.30479841 / OpenLayers.METERS_PER_INCH, //EPSG:9081
+ //"IndianFt62": 0.3047996 / OpenLayers.METERS_PER_INCH, //EPSG:9082
+ //"IndianFt75": 0.3047995 / OpenLayers.METERS_PER_INCH, //EPSG:9083
+ //"Mile": 1609.34721869443738887477 / OpenLayers.METERS_PER_INCH,
+ //"IYard": 0.91440000000000000000 / OpenLayers.METERS_PER_INCH, //EPSG:9096
+ //"IMile": 1609.34400000000000000000 / OpenLayers.METERS_PER_INCH, //EPSG:9093
+ //"NautM": 1852.00000000000000000000 / OpenLayers.METERS_PER_INCH, //EPSG:9030
+ //"Lat-66": 110943.316488932731 / OpenLayers.METERS_PER_INCH,
+ //"Lat-83": 110946.25736872234125 / OpenLayers.METERS_PER_INCH,
+ //"Decimeter": 0.10000000000000000000 / OpenLayers.METERS_PER_INCH,
+ //"Millimeter": 0.00100000000000000000 / OpenLayers.METERS_PER_INCH,
+ //"Dekameter": 10.00000000000000000000 / OpenLayers.METERS_PER_INCH,
+ //"Decameter": 10.00000000000000000000 / OpenLayers.METERS_PER_INCH,
+ //"Hectometer": 100.00000000000000000000 / OpenLayers.METERS_PER_INCH,
+ //"GermanMeter": 1.0000135965 / OpenLayers.METERS_PER_INCH, //EPSG:9031
+ //"CaGrid": 0.999738 / OpenLayers.METERS_PER_INCH,
+ //"ClarkeChain": 20.1166194976 / OpenLayers.METERS_PER_INCH, //EPSG:9038
+ //"GunterChain": 20.11684023368047 / OpenLayers.METERS_PER_INCH, //EPSG:9033
+ //"BenoitChain": 20.116782494375872 / OpenLayers.METERS_PER_INCH, //EPSG:9062
+ //"SearsChain": 20.11676512155 / OpenLayers.METERS_PER_INCH, //EPSG:9042
+ //"ClarkeLink": 0.201166194976 / OpenLayers.METERS_PER_INCH, //EPSG:9039
+ //"GunterLink": 0.2011684023368047 / OpenLayers.METERS_PER_INCH, //EPSG:9034
+ //"BenoitLink": 0.20116782494375872 / OpenLayers.METERS_PER_INCH, //EPSG:9063
+ //"SearsLink": 0.2011676512155 / OpenLayers.METERS_PER_INCH, //EPSG:9043
+ //"Rod": 5.02921005842012 / OpenLayers.METERS_PER_INCH,
+ //"IntnlChain": 20.1168 / OpenLayers.METERS_PER_INCH, //EPSG:9097
+ //"IntnlLink": 0.201168 / OpenLayers.METERS_PER_INCH, //EPSG:9098
+ //"Perch": 5.02921005842012 / OpenLayers.METERS_PER_INCH,
+ //"Pole": 5.02921005842012 / OpenLayers.METERS_PER_INCH,
+ //"Furlong": 201.1684023368046 / OpenLayers.METERS_PER_INCH,
+ //"Rood": 3.778266898 / OpenLayers.METERS_PER_INCH,
+ //"CapeFoot": 0.3047972615 / OpenLayers.METERS_PER_INCH,
+ //"Brealey": 375.00000000000000000000 / OpenLayers.METERS_PER_INCH,
+ //"ModAmFt": 0.304812252984505969011938 / OpenLayers.METERS_PER_INCH,
+ //"Fathom": 1.8288 / OpenLayers.METERS_PER_INCH,
+ //"NautM-UK": 1853.184 / OpenLayers.METERS_PER_INCH,
+ //"50kilometers": 50000.0 / OpenLayers.METERS_PER_INCH,
+ //"150kilometers": 150000.0 / OpenLayers.METERS_PER_INCH
+//});
-//unit abbreviations supported by PROJ.4
-OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT, {
- "mm": OpenLayers.INCHES_PER_UNIT["Meter"] / 1000.0,
- "cm": OpenLayers.INCHES_PER_UNIT["Meter"] / 100.0,
- "dm": OpenLayers.INCHES_PER_UNIT["Meter"] * 100.0,
- "km": OpenLayers.INCHES_PER_UNIT["Meter"] * 1000.0,
- "kmi": OpenLayers.INCHES_PER_UNIT["nmi"], //International Nautical Mile
- "fath": OpenLayers.INCHES_PER_UNIT["Fathom"], //International Fathom
- "ch": OpenLayers.INCHES_PER_UNIT["IntnlChain"], //International Chain
- "link": OpenLayers.INCHES_PER_UNIT["IntnlLink"], //International Link
- "us-in": OpenLayers.INCHES_PER_UNIT["inches"], //U.S. Surveyor's Inch
- "us-ft": OpenLayers.INCHES_PER_UNIT["Foot"], //U.S. Surveyor's Foot
- "us-yd": OpenLayers.INCHES_PER_UNIT["Yard"], //U.S. Surveyor's Yard
- "us-ch": OpenLayers.INCHES_PER_UNIT["GunterChain"], //U.S. Surveyor's Chain
- "us-mi": OpenLayers.INCHES_PER_UNIT["Mile"], //U.S. Surveyor's Statute Mile
- "ind-yd": OpenLayers.INCHES_PER_UNIT["IndianYd37"], //Indian Yard
- "ind-ft": OpenLayers.INCHES_PER_UNIT["IndianFt37"], //Indian Foot
- "ind-ch": 20.11669506 / OpenLayers.METERS_PER_INCH //Indian Chain
-});
+////unit abbreviations supported by PROJ.4
+//OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT, {
+ //"mm": OpenLayers.INCHES_PER_UNIT["Meter"] / 1000.0,
+ //"cm": OpenLayers.INCHES_PER_UNIT["Meter"] / 100.0,
+ //"dm": OpenLayers.INCHES_PER_UNIT["Meter"] * 100.0,
+ //"km": OpenLayers.INCHES_PER_UNIT["Meter"] * 1000.0,
+ //"kmi": OpenLayers.INCHES_PER_UNIT["nmi"], //International Nautical Mile
+ //"fath": OpenLayers.INCHES_PER_UNIT["Fathom"], //International Fathom
+ //"ch": OpenLayers.INCHES_PER_UNIT["IntnlChain"], //International Chain
+ //"link": OpenLayers.INCHES_PER_UNIT["IntnlLink"], //International Link
+ //"us-in": OpenLayers.INCHES_PER_UNIT["inches"], //U.S. Surveyor's Inch
+ //"us-ft": OpenLayers.INCHES_PER_UNIT["Foot"], //U.S. Surveyor's Foot
+ //"us-yd": OpenLayers.INCHES_PER_UNIT["Yard"], //U.S. Surveyor's Yard
+ //"us-ch": OpenLayers.INCHES_PER_UNIT["GunterChain"], //U.S. Surveyor's Chain
+ //"us-mi": OpenLayers.INCHES_PER_UNIT["Mile"], //U.S. Surveyor's Statute Mile
+ //"ind-yd": OpenLayers.INCHES_PER_UNIT["IndianYd37"], //Indian Yard
+ //"ind-ft": OpenLayers.INCHES_PER_UNIT["IndianFt37"], //Indian Foot
+ //"ind-ch": 20.11669506 / OpenLayers.METERS_PER_INCH //Indian Chain
+//});
/**
* Constant: DOTS_PER_INCH
@@ -1296,9 +1294,9 @@
* Parameter:
* evt - {Event}
*/
-OpenLayers.Util.safeStopPropagation = function(evt) {
- OpenLayers.Event.stop(evt, true);
-};
+//OpenLayers.Util.safeStopPropagation = function(evt) {
+ //OpenLayers.Event.stop(evt, true);
+//};
/**
* Function: pagePosition
@@ -1845,53 +1843,53 @@
* Returns:
* {String} the coordinate value formatted as a string
*/
-OpenLayers.Util.getFormattedLonLat = function(coordinate, axis, dmsOption) {
- if (!dmsOption) {
- dmsOption = 'dms'; //default to show degree, minutes, seconds
- }
- var abscoordinate = Math.abs(coordinate);
- var coordinatedegrees = Math.floor(abscoordinate);
+//OpenLayers.Util.getFormattedLonLat = function(coordinate, axis, dmsOption) {
+ //if (!dmsOption) {
+ //dmsOption = 'dms'; //default to show degree, minutes, seconds
+ //}
+ //var abscoordinate = Math.abs(coordinate);
+ //var coordinatedegrees = Math.floor(abscoordinate);
- var coordinateminutes = (abscoordinate - coordinatedegrees)/(1/60);
- var tempcoordinateminutes = coordinateminutes;
- coordinateminutes = Math.floor(coordinateminutes);
- var coordinateseconds = (tempcoordinateminutes - coordinateminutes)/(1/60);
- coordinateseconds = Math.round(coordinateseconds*10);
- coordinateseconds /= 10;
+ //var coordinateminutes = (abscoordinate - coordinatedegrees)/(1/60);
+ //var tempcoordinateminutes = coordinateminutes;
+ //coordinateminutes = Math.floor(coordinateminutes);
+ //var coordinateseconds = (tempcoordinateminutes - coordinateminutes)/(1/60);
+ //coordinateseconds = Math.round(coordinateseconds*10);
+ //coordinateseconds /= 10;
- if( coordinateseconds >= 60) {
- coordinateseconds -= 60;
- coordinateminutes += 1;
- if( coordinateminutes >= 60) {
- coordinateminutes -= 60;
- coordinatedegrees += 1;
- }
- }
+ //if( coordinateseconds >= 60) {
+ //coordinateseconds -= 60;
+ //coordinateminutes += 1;
+ //if( coordinateminutes >= 60) {
+ //coordinateminutes -= 60;
+ //coordinatedegrees += 1;
+ //}
+ //}
- if( coordinatedegrees < 10 ) {
- coordinatedegrees = "0" + coordinatedegrees;
- }
- var str = coordinatedegrees + "\u00B0";
+ //if( coordinatedegrees < 10 ) {
+ //coordinatedegrees = "0" + coordinatedegrees;
+ //}
+ //var str = coordinatedegrees + "\u00B0";
- if (dmsOption.indexOf('dm') >= 0) {
- if( coordinateminutes < 10 ) {
- coordinateminutes = "0" + coordinateminutes;
- }
- str += coordinateminutes + "'";
+ //if (dmsOption.indexOf('dm') >= 0) {
+ //if( coordinateminutes < 10 ) {
+ //coordinateminutes = "0" + coordinateminutes;
+ //}
+ //str += coordinateminutes + "'";
- if (dmsOption.indexOf('dms') >= 0) {
- if( coordinateseconds < 10 ) {
- coordinateseconds = "0" + coordinateseconds;
- }
- str += coordinateseconds + '"';
- }
- }
+ //if (dmsOption.indexOf('dms') >= 0) {
+ //if( coordinateseconds < 10 ) {
+ //coordinateseconds = "0" + coordinateseconds;
+ //}
+ //str += coordinateseconds + '"';
+ //}
+ //}
- if (axis == "lon") {
- str += coordinate < 0 ? OpenLayers.i18n("W") : OpenLayers.i18n("E");
- } else {
- str += coordinate < 0 ? OpenLayers.i18n("S") : OpenLayers.i18n("N");
- }
- return str;
-};
+ //if (axis == "lon") {
+ //str += coordinate < 0 ? OpenLayers.i18n("W") : OpenLayers.i18n("E");
+ //} else {
+ //str += coordinate < 0 ? OpenLayers.i18n("S") : OpenLayers.i18n("N");
+ //}
+ //return str;
+//};
More information about the Commits
mailing list