From: Anna Sobiepanek Date: Wed, 22 Dec 2010 19:30:20 +0000 (-0500) Subject: finished map with geolocation and testing [#171 state:peer-review-requested] X-Git-Tag: v0.2~22^2~4^2~2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=ddb48761e2e40cb10a542162a46d42647f65d187;p=popcorn-js.git finished map with geolocation and testing [#171 state:peer-review-requested] --- diff --git a/plugins/googleMap/popcorn.googleMap.html b/plugins/googleMap/popcorn.googleMap.html index 1669ee9..e0bd0fb 100644 --- a/plugins/googleMap/popcorn.googleMap.html +++ b/plugins/googleMap/popcorn.googleMap.html @@ -12,7 +12,7 @@ .play() .googleMap({ start: 0, // seconds - end: 10, // seconds + end: 20, // seconds type: 'ROADMAP', target: 'map', lat: 43.665429, @@ -20,9 +20,9 @@ zoom: 10 } ) .googleMap({ - start: 15, // seconds - end: 50, // seconds - type: 'SATELLITE', + start: 0, // seconds + end: 30, // seconds + type: 'ROADMAP', target: 'map2', location:'boston', zoom: 15 @@ -32,8 +32,8 @@

Popcorn google Map Plug-in Demo

-

A Google Map displaying Toronto, Ontario will appear at 0 seconds and disappear at 10 seconds.

-

A Google Map displaying Sao Paulo will appear at 15 seconds and disappear at 50 seconds.

+

A Google Map displaying Toronto, Ontario will appear at 0 seconds and disappear at 20 seconds.

+

A Google Map displaying Boston will appear at 0 seconds and disappear at 30 seconds.

-
+
+
diff --git a/plugins/googleMap/popcorn.googleMap.unit.js b/plugins/googleMap/popcorn.googleMap.unit.js index 7877ca1..172c26e 100644 --- a/plugins/googleMap/popcorn.googleMap.unit.js +++ b/plugins/googleMap/popcorn.googleMap.unit.js @@ -1,12 +1,12 @@ test("Popcorn Google Map Plugin", function () { var popped = Popcorn("#video"), - expects = 5, + expects = 10, count = 0, - iframeInterval, - iframeInterval2, - iframeInterval3, - iframeInterval4; + mapInterval, + mapInterval2, + mapInterval3, + mapInterval4; expect(expects); @@ -18,49 +18,65 @@ test("Popcorn Google Map Plugin", function () { stop(); - ok ('footnote' in popped, "footnote is a mehtod of the popped instance"); + ok ('googleMap' in popped, "googleMap is a mehtod of the popped instance"); plus(); - ok ( document.getElementById('footnotediv').innerHTML === "", "initially, there is nothing inside the footnotediv" ); + ok ( document.getElementById('map').innerHTML === "", "initially, there is nothing inside the map" ); plus(); - //equals( actual, expected, message ) instead of ok( boolean true, message ) - popped.footnote({ - start: 5, // seconds - end: 15, // seconds - text: 'This video made exclusively for drumbeat.org', - target: 'footnotediv' - } ) - .footnote({ - start: 35, // seconds - end: 45, // seconds - text: 'Visit webmademovies.org for more details', - target: 'footnotediv' - } ) + + ok ( document.getElementById('map2').innerHTML === "", "initially, there is nothing inside the map2" ); + plus(); + + popped.googleMap({ + start: 0, // seconds + end: 5, // seconds + type: 'ROADMAP', + target: 'map', + lat: 43.665429, + long: -79.403323, + zoom: 10 + } ) + .googleMap({ + start: 0, // seconds + end: 5, // seconds + type: 'SATELLITE', + target: 'map2', + location:'boston', + zoom: 15 + } ) + .volume(0) .play(); - interval = setInterval( function() { - if( popped.currentTime() > 5 && popped.currentTime() <= 15 ) { - ok (document.getElementById('footnotediv').innerHTML === "This video made exclusively for drumbeat.org", "footnote displaing correct information" ); + mapInterval = setInterval( function() { + if( popped.currentTime() > 3 && popped.currentTime() <= 5 ) { + ok(google.maps, "Google maps is available"); + plus(); + ok(google.maps.Geocoder, "Google maps Geocoder is available"); + plus(); + ok (document.getElementById('actualmap1'), "First map is on the page" ); plus(); - clearInterval( interval ); + equals (document.getElementById('actualmap1').offsetParent.id, "map", "First map is inside the 'map' div" ); + plus(); + clearInterval( mapInterval ); } - }, 5000); - - interval2 = setInterval( function() { - if( popped.currentTime() > 15 && popped.currentTime() < 35 ) { - ok (document.getElementById('footnotediv').innerHTML === "", "footnote cleared properly" ); + }, 1000); + mapInterval2 = setInterval( function() { + if( popped.currentTime() > 3 && popped.currentTime() <= 5 ) { + ok (document.getElementById('actualmap2'), "Second map is on the page" ); plus(); - clearInterval( interval2 ); + equals (document.getElementById('actualmap2').offsetParent.id, "map2", "Second map is inside the 'map2' div" ); + plus(); + clearInterval( mapInterval2 ); } - }, 5000); - - interval3 = setInterval( function() { - if( popped.currentTime() > 35 && popped.currentTime() < 45 ) { - ok (document.getElementById('footnotediv').innerHTML === "Visit webmademovies.org for more details", "footnote displaing correct information" ); + }, 1000); + mapInterval3 = setInterval( function() { + if( popped.currentTime() > 5 ) { + ok (document.getElementById('actualmap2').style.display === "none" && + document.getElementById('actualmap1').style.display === "none", "Both maps are no longer visible" ); plus(); - clearInterval( interval3 ); + clearInterval( mapInterval3 ); } - }, 5000); + }, 1000); }); diff --git a/plugins/googleMap/popcorngoogleMap.unit.js b/plugins/googleMap/popcorngoogleMap.unit.js deleted file mode 100644 index 7877ca1..0000000 --- a/plugins/googleMap/popcorngoogleMap.unit.js +++ /dev/null @@ -1,66 +0,0 @@ -test("Popcorn Google Map Plugin", function () { - - var popped = Popcorn("#video"), - expects = 5, - count = 0, - iframeInterval, - iframeInterval2, - iframeInterval3, - iframeInterval4; - - expect(expects); - - function plus() { - if ( ++count===expects) { - start(); - } - } - - stop(); - - ok ('footnote' in popped, "footnote is a mehtod of the popped instance"); - plus(); - - ok ( document.getElementById('footnotediv').innerHTML === "", "initially, there is nothing inside the footnotediv" ); - plus(); - //equals( actual, expected, message ) instead of ok( boolean true, message ) - popped.footnote({ - start: 5, // seconds - end: 15, // seconds - text: 'This video made exclusively for drumbeat.org', - target: 'footnotediv' - } ) - .footnote({ - start: 35, // seconds - end: 45, // seconds - text: 'Visit webmademovies.org for more details', - target: 'footnotediv' - } ) - .play(); - - - interval = setInterval( function() { - if( popped.currentTime() > 5 && popped.currentTime() <= 15 ) { - ok (document.getElementById('footnotediv').innerHTML === "This video made exclusively for drumbeat.org", "footnote displaing correct information" ); - plus(); - clearInterval( interval ); - } - }, 5000); - - interval2 = setInterval( function() { - if( popped.currentTime() > 15 && popped.currentTime() < 35 ) { - ok (document.getElementById('footnotediv').innerHTML === "", "footnote cleared properly" ); - plus(); - clearInterval( interval2 ); - } - }, 5000); - - interval3 = setInterval( function() { - if( popped.currentTime() > 35 && popped.currentTime() < 45 ) { - ok (document.getElementById('footnotediv').innerHTML === "Visit webmademovies.org for more details", "footnote displaing correct information" ); - plus(); - clearInterval( interval3 ); - } - }, 5000); - -});