[OpenLayers-Commits] r11311 - in sandbox/elemoine/draw-feature: .
examples lib/OpenLayers tests tests/BaseTypes tests/Control
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Wed Feb 23 08:15:28 EST 2011
Author: erilem
Date: 2011-02-23 05:15:28 -0800 (Wed, 23 Feb 2011)
New Revision: 11311
Modified:
sandbox/elemoine/draw-feature/
sandbox/elemoine/draw-feature/examples/controls.html
sandbox/elemoine/draw-feature/examples/mobile-navigation.html
sandbox/elemoine/draw-feature/examples/style.css
sandbox/elemoine/draw-feature/lib/OpenLayers/BaseTypes.js
sandbox/elemoine/draw-feature/lib/OpenLayers/Kinetic.js
sandbox/elemoine/draw-feature/tests/BaseTypes/Bounds.html
sandbox/elemoine/draw-feature/tests/BaseTypes/LonLat.html
sandbox/elemoine/draw-feature/tests/BaseTypes/Pixel.html
sandbox/elemoine/draw-feature/tests/Control/PanZoom.html
sandbox/elemoine/draw-feature/tests/Control/Scale.html
sandbox/elemoine/draw-feature/tests/run-tests.html
Log:
svn merge -r 11267:HEAD http://svn.openlayers.org/trunk/openlayers/ .
Property changes on: sandbox/elemoine/draw-feature
___________________________________________________________________
Modified: svn:mergeinfo
- /sandbox/roberthl/openlayers:9745-9748
/trunk/openlayers:11027-11037,11040-11091,11094-11140,11142-11154,11156-11266
+ /sandbox/roberthl/openlayers:9745-9748
/trunk/openlayers:11027-11037,11040-11091,11094-11140,11142-11154,11156-11266,11268-11310
Modified: sandbox/elemoine/draw-feature/examples/controls.html
===================================================================
--- sandbox/elemoine/draw-feature/examples/controls.html 2011-02-23 13:13:33 UTC (rev 11310)
+++ sandbox/elemoine/draw-feature/examples/controls.html 2011-02-23 13:15:28 UTC (rev 11311)
@@ -64,8 +64,8 @@
Attach zooming, panning, layer switcher, overview map, and permalink map controls to an OpenLayers window.
</p>
- <a style="float:right" href="" id="permalink">Permalink</a>
<div id="map" class="smallmap"></div>
+ <a href="#" id="permalink">Permalink</a>
<div id="docs"></div>
</body>
Modified: sandbox/elemoine/draw-feature/examples/mobile-navigation.html
===================================================================
--- sandbox/elemoine/draw-feature/examples/mobile-navigation.html 2011-02-23 13:13:33 UTC (rev 11310)
+++ sandbox/elemoine/draw-feature/examples/mobile-navigation.html 2011-02-23 13:15:28 UTC (rev 11311)
@@ -3,7 +3,7 @@
<head>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<meta name="apple-mobile-web-app-capable" content="yes" />
- <title>OpenLayers TouchNavigation Control</title>
+ <title>Mobile Navigation Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.mobile.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
Modified: sandbox/elemoine/draw-feature/examples/style.css
===================================================================
--- sandbox/elemoine/draw-feature/examples/style.css 2011-02-23 13:13:33 UTC (rev 11310)
+++ sandbox/elemoine/draw-feature/examples/style.css 2011-02-23 13:15:28 UTC (rev 11311)
@@ -121,3 +121,19 @@
display : none;
}
}
+ at media only screen and (orientation: landscape) and (max-width: 600px) {
+ #shortdesc {
+ float: right;
+ width: 25%;
+ }
+ #map {
+ width: 70%;
+ }
+ #docs {
+ font-size: 12px;
+ }
+}
+body {
+ -webkit-text-size-adjust: none;
+}
+
Modified: sandbox/elemoine/draw-feature/lib/OpenLayers/BaseTypes.js
===================================================================
--- sandbox/elemoine/draw-feature/lib/OpenLayers/BaseTypes.js 2011-02-23 13:13:33 UTC (rev 11310)
+++ sandbox/elemoine/draw-feature/lib/OpenLayers/BaseTypes.js 2011-02-23 13:15:28 UTC (rev 11311)
@@ -632,9 +632,11 @@
* APIMethod: parse
* Generate a date object from a string. The format for the string follows
* the profile of ISO 8601 for date and time on the Internet (see
- * http://tools.ietf.org/html/rfc3339). If the parse method on
- * the Date constructor returns a valid date for the given string,
- * that method is used.
+ * http://tools.ietf.org/html/rfc3339). We don't call the native
+ * Date.parse because of inconsistency between implmentations. In
+ * Chrome, calling Date.parse with a string that doesn't contain any
+ * indication of the timezone (e.g. "2011"), the date is interpreted
+ * in local time. On Firefox, the assumption is UTC.
*
* Parameters:
* str - {String} A string representing the date (e.g.
@@ -647,37 +649,31 @@
*/
parse: function(str) {
var date;
- // first check if the native parse method can parse it
- var elapsed = Date.parse(str);
- if (!isNaN(elapsed)) {
- date = new Date(elapsed);
- } else {
- var match = str.match(/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))?$/);
- if (match && (match[1] || match[7])) { // must have at least year or time
- var year = parseInt(match[1], 10) || 0;
- var month = (parseInt(match[2], 10) - 1) || 0;
- var day = parseInt(match[3], 10) || 1;
- date = new Date(Date.UTC(year, month, day));
- // optional time
- var type = match[7];
- if (type) {
- var hours = parseInt(match[4], 10);
- var minutes = parseInt(match[5], 10);
- var secFrac = parseFloat(match[6]);
- var seconds = secFrac | 0;
- var milliseconds = Math.round(1000 * (secFrac - seconds));
- date.setUTCHours(hours, minutes, seconds, milliseconds);
- // check offset
- if (type !== "Z") {
- var hoursOffset = parseInt(type, 10);
- var minutesOffset = parseInt(match[8], 10) || 0;
- var offset = -1000 * (60 * (hoursOffset * 60) + minutesOffset * 60);
- date = new Date(date.getTime() + offset);
- }
+ var match = str.match(/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))?$/);
+ if (match && (match[1] || match[7])) { // must have at least year or time
+ var year = parseInt(match[1], 10) || 0;
+ var month = (parseInt(match[2], 10) - 1) || 0;
+ var day = parseInt(match[3], 10) || 1;
+ date = new Date(Date.UTC(year, month, day));
+ // optional time
+ var type = match[7];
+ if (type) {
+ var hours = parseInt(match[4], 10);
+ var minutes = parseInt(match[5], 10);
+ var secFrac = parseFloat(match[6]);
+ var seconds = secFrac | 0;
+ var milliseconds = Math.round(1000 * (secFrac - seconds));
+ date.setUTCHours(hours, minutes, seconds, milliseconds);
+ // check offset
+ if (type !== "Z") {
+ var hoursOffset = parseInt(type, 10);
+ var minutesOffset = parseInt(match[8], 10) || 0;
+ var offset = -1000 * (60 * (hoursOffset * 60) + minutesOffset * 60);
+ date = new Date(date.getTime() + offset);
}
- } else {
- date = new Date("invalid");
}
+ } else {
+ date = new Date("invalid");
}
return date;
}
Modified: sandbox/elemoine/draw-feature/lib/OpenLayers/Kinetic.js
===================================================================
--- sandbox/elemoine/draw-feature/lib/OpenLayers/Kinetic.js 2011-02-23 13:13:33 UTC (rev 11310)
+++ sandbox/elemoine/draw-feature/lib/OpenLayers/Kinetic.js 2011-02-23 13:15:28 UTC (rev 11311)
@@ -63,7 +63,6 @@
/**
* Method: begin
- *
* Begins the dragging.
*/
begin: function() {
@@ -74,8 +73,10 @@
/**
* Method: update
+ * Updates during the dragging.
*
- * Updates during the dragging.
+ * Parameters:
+ * xy - {<OpenLayers.Pixel>} The new position.
*/
update: function(xy) {
this.points.unshift({xy: xy, tick: new Date().getTime()});
@@ -86,8 +87,15 @@
/**
* Method: end
+ * Ends the dragging, start the kinetic.
*
- * Ends the dragging, start the kinetic.
+ * Parameters:
+ * xy - {<OpenLayers.Pixel>} The last position.
+ *
+ * Returns:
+ * {Object} An object with two properties: "speed", and "theta". The
+ * "speed" and "theta" values are to be passed to the move
+ * function when starting the animation.
*/
end: function(xy) {
var last, now = new Date().getTime();
@@ -117,12 +125,13 @@
/**
* Method: move
- *
* Launch the kinetic move pan.
*
* Parameters:
- * info - {Object}
- * callback - arguments x, y (values to pan), end (is the last point)
+ * info - {Object} An object with two properties, "speed", and "theta".
+ * These values are those returned from the "end" call.
+ * callback - {Function} Function called on every step of the animation,
+ * receives x, y (values to pan), end (is the last point).
*/
move: function(info, callback) {
var v0 = info.speed;
Modified: sandbox/elemoine/draw-feature/tests/BaseTypes/Bounds.html
===================================================================
--- sandbox/elemoine/draw-feature/tests/BaseTypes/Bounds.html 2011-02-23 13:13:33 UTC (rev 11310)
+++ sandbox/elemoine/draw-feature/tests/BaseTypes/Bounds.html 2011-02-23 13:15:28 UTC (rev 11311)
@@ -606,6 +606,7 @@
t.ok( bounds.equals(b), "bounds is set correctly");
//null values
+ OpenLayers.Lang.setCode('en');
var desiredMsg = "You must pass both x and y values to the add function.";
OpenLayers.Console.error = function(msg) {
t.eq(msg, desiredMsg, "error correctly reported");
Modified: sandbox/elemoine/draw-feature/tests/BaseTypes/LonLat.html
===================================================================
--- sandbox/elemoine/draw-feature/tests/BaseTypes/LonLat.html 2011-02-23 13:13:33 UTC (rev 11310)
+++ sandbox/elemoine/draw-feature/tests/BaseTypes/LonLat.html 2011-02-23 13:15:28 UTC (rev 11311)
@@ -64,6 +64,7 @@
t.ok( addpx.equals(ll), "addpx is set correctly");
//null values
+ OpenLayers.Lang.setCode('en');
var desiredMsg = "You must pass both lon and lat values to the add function.";
OpenLayers.Console.error = function(msg) {
t.eq(msg, desiredMsg, "error correctly reported");
Modified: sandbox/elemoine/draw-feature/tests/BaseTypes/Pixel.html
===================================================================
--- sandbox/elemoine/draw-feature/tests/BaseTypes/Pixel.html 2011-02-23 13:13:33 UTC (rev 11310)
+++ sandbox/elemoine/draw-feature/tests/BaseTypes/Pixel.html 2011-02-23 13:15:28 UTC (rev 11311)
@@ -74,6 +74,7 @@
t.ok( pixel.equals(px), "returned pixel is correct");
//null values
+ OpenLayers.Lang.setCode('en');
var desiredMsg = "You must pass both x and y values to the add function.";
OpenLayers.Console.error = function(msg) {
t.eq(msg, desiredMsg, "error correctly reported");
Modified: sandbox/elemoine/draw-feature/tests/Control/PanZoom.html
===================================================================
--- sandbox/elemoine/draw-feature/tests/Control/PanZoom.html 2011-02-23 13:13:33 UTC (rev 11310)
+++ sandbox/elemoine/draw-feature/tests/Control/PanZoom.html 2011-02-23 13:15:28 UTC (rev 11311)
@@ -72,65 +72,65 @@
simulateClick(wnd, wnd.control.buttons[0]);
t.delay_call(2, function() {
- t.ok( wnd.mapper.getCenter().lat > wnd.centerLL.lat, "Pan up works correctly" );
- t.ok(!flag.mousedown, "mousedown does not get to the map");
- t.ok(flag.mouseup, "mouseup does get to the map");
- t.ok(!flag.click, "click does not get to the map");
- t.ok(!flag.dblclick, "dblclick does not get to the map");
+ t.ok( wnd.mapper.getCenter().lat > wnd.centerLL.lat, "1) Pan up works correctly" );
+ t.ok(!flag.mousedown, "1) mousedown does not get to the map");
+ t.ok(flag.mouseup, "1) mouseup does get to the map");
+ t.ok(!flag.click, "1) click does not get to the map");
+ t.ok(!flag.dblclick, "1) dblclick does not get to the map");
resetFlags();
simulateClick(wnd, wnd.control.buttons[1]);
}, 2, function() {
- t.ok( wnd.mapper.getCenter().lon < wnd.centerLL.lon, "Pan left works correctly" );
- t.ok(!flag.mousedown, "mousedown does not get to the map");
- t.ok(flag.mouseup, "mouseup does get to the map");
- t.ok(!flag.click, "click does not get to the map");
- t.ok(!flag.dblclick, "dblclick does not get to the map");
+ t.ok( wnd.mapper.getCenter().lon < wnd.centerLL.lon, "2) Pan left works correctly" );
+ t.ok(!flag.mousedown, "2) mousedown does not get to the map");
+ t.ok(flag.mouseup, "2) mouseup does get to the map");
+ t.ok(!flag.click, "2) click does not get to the map");
+ t.ok(!flag.dblclick, "2) dblclick does not get to the map");
resetFlags();
simulateClick(wnd, wnd.control.buttons[2]);
}, 2, function() {
- t.ok( wnd.mapper.getCenter().lon == wnd.centerLL.lon, "Pan right works correctly" );
- t.ok(!flag.mousedown, "mousedown does not get to the map");
- t.ok(flag.mouseup, "mouseup does get to the map");
- t.ok(!flag.click, "click does not get to the map");
- t.ok(!flag.dblclick, "dblclick does not get to the map");
+ t.ok( wnd.mapper.getCenter().lon == wnd.centerLL.lon, "3) Pan right works correctly" );
+ t.ok(!flag.mousedown, "3) mousedown does not get to the map");
+ t.ok(flag.mouseup, "3) mouseup does get to the map");
+ t.ok(!flag.click, "3) click does not get to the map");
+ t.ok(!flag.dblclick, "3) dblclick does not get to the map");
resetFlags();
simulateClick(wnd, wnd.control.buttons[3]);
}, 2, function() {
- t.ok( wnd.mapper.getCenter().lat == wnd.centerLL.lat, "Pan down works correctly" );
- t.ok(!flag.mousedown, "mousedown does not get to the map");
- t.ok(flag.mouseup, "mouseup does get to the map");
- t.ok(!flag.click, "click does not get to the map");
- t.ok(!flag.dblclick, "dblclick does not get to the map");
+ t.ok( wnd.mapper.getCenter().lat == wnd.centerLL.lat, "4) Pan down works correctly" );
+ t.ok(!flag.mousedown, "4) mousedown does not get to the map");
+ t.ok(flag.mouseup, "4) mouseup does get to the map");
+ t.ok(!flag.click, "4) click does not get to the map");
+ t.ok(!flag.dblclick, "4) dblclick does not get to the map");
resetFlags();
simulateClick(wnd, wnd.control.buttons[4]);
}, 2, function() {
- t.eq( wnd.mapper.getZoom(), 6, "zoomin works correctly" );
- t.ok(!flag.mousedown, "mousedown does not get to the map");
- t.ok(flag.mouseup, "mouseup does get to the map");
- t.ok(!flag.click, "click does not get to the map");
- t.ok(!flag.dblclick, "dblclick does not get to the map");
+ t.eq( wnd.mapper.getZoom(), 6, "5) zoomin works correctly" );
+ t.ok(!flag.mousedown, "5) mousedown does not get to the map");
+ t.ok(flag.mouseup, "5) mouseup does get to the map");
+ t.ok(!flag.click, "5) click does not get to the map");
+ t.ok(!flag.dblclick, "5) dblclick does not get to the map");
resetFlags();
simulateClick(wnd, wnd.control.buttons[6]);
}, 2, function() {
- t.eq( wnd.mapper.getZoom(), 5, "zoomout works correctly" );
- t.ok(!flag.mousedown, "mousedown does not get to the map");
- t.ok(flag.mouseup, "mouseup does get to the map");
- t.ok(!flag.click, "click does not get to the map");
- t.ok(!flag.dblclick, "dblclick does not get to the map");
+ t.eq( wnd.mapper.getZoom(), 5, "6) zoomout works correctly" );
+ t.ok(!flag.mousedown, "6) mousedown does not get to the map");
+ t.ok(flag.mouseup, "6) mouseup does get to the map");
+ t.ok(!flag.click, "6) click does not get to the map");
+ t.ok(!flag.dblclick, "6) dblclick does not get to the map");
resetFlags();
simulateClick(wnd, wnd.control.buttons[5]);
}, 2, function() {
- t.eq( wnd.mapper.getZoom(), 2, "zoomworld works correctly" );
- t.ok(!flag.mousedown, "mousedown does not get to the map");
- t.ok(flag.mouseup, "mouseup does get to the map");
- t.ok(!flag.click, "click does not get to the map");
- t.ok(!flag.dblclick, "dblclick does not get to the map");
+ t.eq( wnd.mapper.getZoom(), 2, "7) zoomworld works correctly" );
+ t.ok(!flag.mousedown, "7) mousedown does not get to the map");
+ t.ok(flag.mouseup, "7) mouseup does get to the map");
+ t.ok(!flag.click, "7) click does not get to the map");
+ t.ok(!flag.dblclick, "7) dblclick does not get to the map");
resetFlags();
});
});
Modified: sandbox/elemoine/draw-feature/tests/Control/Scale.html
===================================================================
--- sandbox/elemoine/draw-feature/tests/Control/Scale.html 2011-02-23 13:13:33 UTC (rev 11310)
+++ sandbox/elemoine/draw-feature/tests/Control/Scale.html 2011-02-23 13:15:28 UTC (rev 11311)
@@ -2,6 +2,7 @@
<head>
<script src="../OLLoader.js"></script>
<script type="text/javascript">
+ OpenLayers.Lang.setCode('en');
var map;
function test_Control_Scale_constructor (t) {
t.plan( 2 );
Modified: sandbox/elemoine/draw-feature/tests/run-tests.html
===================================================================
--- sandbox/elemoine/draw-feature/tests/run-tests.html 2011-02-23 13:13:33 UTC (rev 11310)
+++ sandbox/elemoine/draw-feature/tests/run-tests.html 2011-02-23 13:15:28 UTC (rev 11311)
@@ -2410,4 +2410,10 @@
</div>
</span>
+<script>
+ if (/noscroll/.test(location.href)) {
+ document.getElementById('scroller').style.height='auto';
+ document.getElementById('right_frame').style.height='auto';
+ }
+</script>
</body></html>
More information about the Commits
mailing list