From 88d019a0bbd2bfaea829f1edf9927038cb2e7aa8 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Tue, 8 Oct 2013 15:29:44 +0200 Subject: [PATCH 1/3] Add typecasts in animation example --- examples/animation.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/animation.js b/examples/animation.js index a3cf25739e..7ee443b71c 100644 --- a/examples/animation.js +++ b/examples/animation.js @@ -55,7 +55,7 @@ var panToLondon = document.getElementById('pan-to-london'); panToLondon.addEventListener('click', function() { var pan = ol.animation.pan({ duration: 2000, - source: view.getCenter() + source: /** @type {ol.Coordinate} */ (view.getCenter()) }); map.beforeRender(pan); view.setCenter(london); @@ -66,7 +66,7 @@ elasticToMoscow.addEventListener('click', function() { var pan = ol.animation.pan({ duration: 2000, easing: ol.easing.elastic, - source: view.getCenter() + source: /** @type {ol.Coordinate} */ (view.getCenter()) }); map.beforeRender(pan); view.setCenter(moscow); @@ -77,7 +77,7 @@ bounceToIstanbul.addEventListener('click', function() { var pan = ol.animation.pan({ duration: 2000, easing: ol.easing.bounce, - source: view.getCenter() + source: /** @type {ol.Coordinate} */ (view.getCenter()) }); map.beforeRender(pan); view.setCenter(istanbul); @@ -89,7 +89,7 @@ spinToRome.addEventListener('click', function() { var start = +new Date(); var pan = ol.animation.pan({ duration: duration, - source: view.getCenter(), + source: /** @type {ol.Coordinate} */ (view.getCenter()), start: start }); var rotate = ol.animation.rotate({ @@ -107,7 +107,7 @@ flyToBern.addEventListener('click', function() { var start = +new Date(); var pan = ol.animation.pan({ duration: duration, - source: view.getCenter(), + source: /** @type {ol.Coordinate} */ (view.getCenter()), start: start }); var bounce = ol.animation.bounce({ @@ -125,7 +125,7 @@ spiralToMadrid.addEventListener('click', function() { var start = +new Date(); var pan = ol.animation.pan({ duration: duration, - source: view.getCenter(), + source: /** @type {ol.Coordinate} */ (view.getCenter()), start: start }); var bounce = ol.animation.bounce({ From 4e5d50de9811fd1af445853abe2431229ae1efb7 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Tue, 8 Oct 2013 15:30:26 +0200 Subject: [PATCH 2/3] Fix use of ol.dom.Input numeric value --- examples/mouse-position.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/mouse-position.js b/examples/mouse-position.js index 998d37edd5..d14471767f 100644 --- a/examples/mouse-position.js +++ b/examples/mouse-position.js @@ -41,6 +41,7 @@ projectionSelect.on('change:value', function() { var precisionInput = new ol.dom.Input(document.getElementById('precision')); precisionInput.on('change:value', function() { - var format = ol.coordinate.createStringXY(precisionInput.getValue()); + var precision = /** @type {number} */ (precisionInput.getValueAsNumber()); + var format = ol.coordinate.createStringXY(precision); mousePositionControl.setCoordinateFormat(format); }); From 1a000c3719f5e646d97098df3a4912a548e26e2f Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Tue, 8 Oct 2013 15:30:42 +0200 Subject: [PATCH 3/3] Add typecast in WMTS IGN example --- examples/wmts-ign.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/wmts-ign.js b/examples/wmts-ign.js index 1136e1adca..2879a1f30a 100644 --- a/examples/wmts-ign.js +++ b/examples/wmts-ign.js @@ -75,9 +75,10 @@ xhr.onload = function() { } var view = new ol.View2D(); - view.fitExtent([ - 257596.65942095537, 6250898.984085131, - 262082.55751844167, 6251854.446938695], map.getSize()); + view.fitExtent( + [257596.65942095537, 6250898.984085131, + 262082.55751844167, 6251854.446938695], + /** @type {ol.Size} */ (map.getSize())); map.setView(view); } };