]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Made updates to spacing, naming
authorNick Doiron <ndoiron@mapmeld.com>
Fri, 6 May 2011 04:49:47 +0000 (01:49 -0300)
committerNick Doiron <ndoiron@mapmeld.com>
Fri, 6 May 2011 04:49:47 +0000 (01:49 -0300)
plugins/openmap/popcorn.openmap.html
plugins/openmap/popcorn.openmap.js
plugins/openmap/popcorn.openmap.unit.html
plugins/openmap/popcorn.openmap.unit.js

index 2f5298e6dbb5eeafdac49021b70335e12b32aa57..571eb460b5667acf386bf8d1b9bce4ff06d14a40 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-  <title>Popcorn OpenMap Plug-in Demo</title>
+  <title>Popcorn Open Map Plug-in Demo</title>
   <script src="../../popcorn.js"></script>
   <script src="popcorn.openmap.js"></script>
   <script>
@@ -31,7 +31,7 @@
             location: "Cambridge, MA",
             icon: "http://google-maps-icons.googlecode.com/files/vegetarian.png",
             text: "Clickable markers",
-                       size: 10
+            size: 10
           },
           {
             lat: 42.358544,
index f0d1b074baa673d333e3e8969c9145b4b73bad39..7a8bbcc9e2feacb44f89ac679474624d21ce272a 100644 (file)
@@ -3,7 +3,7 @@ var openmapCallback;
 ( function ( Popcorn ) {
   
   /**
-   * OpenMap popcorn plug-in 
+   * openmap popcorn plug-in 
    * Adds an OpenLayers map and open map tiles (OpenStreetMap [default], NASA WorldWind, or USGS Topographic)
    * Based on the googlemap popcorn plug-in. No StreetView support
    * Options parameter will need a start, end, target, type, zoom, lat and lng
@@ -52,7 +52,7 @@ var openmapCallback;
 
   Popcorn.plugin( "openmap" , function( options ){
     var newdiv,
-           map,
+        map,
         centerlonlat,
         projection,
         displayProjection,
@@ -63,7 +63,7 @@ var openmapCallback;
     // create a new div within the target div
     // this is later passed on to the maps api
     newdiv               = document.createElement( 'div' );
-    newdiv.id            = "actualmap" + i;
+    newdiv.id            = "openmapdiv" + i;
     newdiv.style.width   = "100%";
     newdiv.style.height  = "100%";
     i++;
index 024b8b0fa8bbd6081869c0d8cab4ca9412974df8..32e9d0bf87286430aef19e5c074b49ffeb28ff61 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-  <title>Popcorn API - OpenMap Plugin Unit Test</title>
+  <title>Popcorn API</title>
   <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
   <script src="../../test/qunit/qunit.js"></script>
   <!-- 
index 79252345dcf73a22b4961138287a35404e49ebbe..952bcd382b5ea3a405a6b301e0d0f239b043f14f 100644 (file)
@@ -1,12 +1,8 @@
-test("Popcorn OpenMap Plugin", function () {
+test( "Popcorn OpenMap Plugin", function () {
   
   var popped = Popcorn("#video"),
     expects = 14, 
     count = 0,
-    mapInterval,
-    mapInterval2,
-    mapInterval3,
-    mapInterval4;
   
   expect(expects);
   
@@ -18,7 +14,7 @@ test("Popcorn OpenMap Plugin", function () {
   
   stop();
 
-  ok ('openmap' in popped, "OpenMap is a method of the popped instance");
+  ok ('openmap' in popped, "openmap is a method of the popped instance");
   plus();
   
   ok ( document.getElementById('map').innerHTML === "", "initially, there is nothing inside map" );
@@ -68,52 +64,47 @@ test("Popcorn OpenMap Plugin", function () {
   .volume(0)
   .play();
 
-  mapInterval = popped.exec( 4, function() {
+  popped.exec( 4, function() {
     if( popped.currentTime() > 3 && popped.currentTime() <= 5 ) {
       ok(OpenLayers, "OpenLayers is available");
       plus();
-      ok (document.getElementById('actualmap1'), "First map is on the page" );
+      ok (document.getElementById('openmapdiv1'), "First map is on the page" );
       plus();
-      equals (document.getElementById('actualmap1').offsetParent.id, "map", "First map is inside the 'map' div" );
+      equals (document.getElementById('openmapdiv1').offsetParent.id, "map", "First map is inside the 'map' div" );
       plus();
-      clearInterval( mapInterval );
     }
   } );
-  mapInterval2 = popped.exec( 4, function() {
+  popped.exec( 4, function() {
     if( popped.currentTime() > 3 && popped.currentTime() <= 5 ) {
-      ok (document.getElementById('actualmap2'), "Second map is on the page" );
+      ok (document.getElementById('openmapdiv2'), "Second map is on the page" );
       plus();
-      equals (document.getElementById('actualmap2').offsetParent.id, "map2", "Second map is inside the 'map2' div" );
+      equals (document.getElementById('openmapdiv2').offsetParent.id, "map2", "Second map is inside the 'map2' div" );
       plus();
-      clearInterval( mapInterval2 );
     }
   } );
-  mapInterval3 = popped.exec( 4, function() {
+  popped.exec( 4, function() {
     if( popped.currentTime() > 3 && popped.currentTime() <= 5 ) {
-      ok (document.getElementById('actualmap3'), "Third map is on the page" );
+      ok (document.getElementById('openmapdiv3'), "Third map is on the page" );
       plus();
-      equals (document.getElementById('actualmap3').offsetParent.id, "map3", "Third map is inside the 'map3' div" );
+      equals (document.getElementById('openmapdiv3').offsetParent.id, "map3", "Third map is inside the 'map3' div" );
       plus();
-      clearInterval( mapInterval3 );
     }
   } );
-  mapInterval4 = popped.exec( 4, function() {
+  popped.exec( 4, function() {
     if( popped.currentTime() > 3 && popped.currentTime() <= 5 ) {
-      ok (document.getElementById('actualmap4'), "Fourth map is on the page" );
+      ok (document.getElementById('openmapdiv4'), "Fourth map is on the page" );
       plus();
-      equals (document.getElementById('actualmap4').offsetParent.id, "map4", "Fourth map is inside the 'map4' div" );
+      equals (document.getElementById('openmapdiv4').offsetParent.id, "map4", "Fourth map is inside the 'map4' div" );
       plus();
-      clearInterval( mapInterval4 );
     }
   } );
-  mapInterval5 = popped.exec( 6, function() {
+  popped.exec( 6, function() {
     if( popped.currentTime() > 5  ) {
-      ok (document.getElementById('actualmap2').style.display === "none" && 
-          document.getElementById('actualmap3').style.display === "none" && 
-          document.getElementById('actualmap4').style.display === "none" &&
-          document.getElementById('actualmap1').style.display === "none", "All three maps are no longer visible" );
+      ok (document.getElementById('openmapdiv2').style.display === "none" && 
+          document.getElementById('openmapdiv3').style.display === "none" && 
+          document.getElementById('openmapdiv4').style.display === "none" &&
+          document.getElementById('openmapdiv1').style.display === "none", "All three maps are no longer visible" );
       plus();
-      clearInterval( mapInterval5 );
     }
   } );
 } );
\ No newline at end of file