From cb62c663d1e53416cd81fdb4c3adee60e59a8578 Mon Sep 17 00:00:00 2001 From: ScottDowne Date: Mon, 10 Jan 2011 16:54:16 -0500 Subject: [PATCH] [#246] fixed google maps to check that zoom is a number, and lowercased plugin unit tests --- plugins/googleMap/popcorn.googleMap.html | 2 +- plugins/googleMap/popcorn.googleMap.js | 9 ++++++++- plugins/googleMap/popcorn.googleMap.unit.js | 6 +++--- plugins/tagThisPerson/popcorn.tagThisPerson.unit.html | 4 ++-- plugins/tagThisPerson/popcorn.tagThisPerson.unit.js | 8 ++++---- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/plugins/googleMap/popcorn.googleMap.html b/plugins/googleMap/popcorn.googleMap.html index 9a216f1..00e763f 100644 --- a/plugins/googleMap/popcorn.googleMap.html +++ b/plugins/googleMap/popcorn.googleMap.html @@ -17,7 +17,7 @@ target: 'map', lat: 43.665429, long: -79.403323, - zoom: 10 + zoom: "10" } ) .googlemap({ start: 0, // seconds diff --git a/plugins/googleMap/popcorn.googleMap.js b/plugins/googleMap/popcorn.googleMap.js index 073bea4..8e7e635 100644 --- a/plugins/googleMap/popcorn.googleMap.js +++ b/plugins/googleMap/popcorn.googleMap.js @@ -124,7 +124,14 @@ var googleCallback; } // reset the location and zoom just in case the user plaid with the map options._map.setCenter(location); - options._map.setZoom(options.zoom || 0); + if ( options.zoom ) { + if ( typeof options.zoom !== "Number" ) { + options.zoom = +options.zoom; + } + } else { + options.zoom = 0; + } + options._map.setZoom( options.zoom ); } }; diff --git a/plugins/googleMap/popcorn.googleMap.unit.js b/plugins/googleMap/popcorn.googleMap.unit.js index 172c26e..b5cd31f 100644 --- a/plugins/googleMap/popcorn.googleMap.unit.js +++ b/plugins/googleMap/popcorn.googleMap.unit.js @@ -18,7 +18,7 @@ test("Popcorn Google Map Plugin", function () { stop(); - ok ('googleMap' in popped, "googleMap is a mehtod of the popped instance"); + ok ('googlemap' in popped, "googlemap is a mehtod of the popped instance"); plus(); ok ( document.getElementById('map').innerHTML === "", "initially, there is nothing inside the map" ); @@ -27,7 +27,7 @@ test("Popcorn Google Map Plugin", function () { ok ( document.getElementById('map2').innerHTML === "", "initially, there is nothing inside the map2" ); plus(); - popped.googleMap({ + popped.googlemap({ start: 0, // seconds end: 5, // seconds type: 'ROADMAP', @@ -36,7 +36,7 @@ test("Popcorn Google Map Plugin", function () { long: -79.403323, zoom: 10 } ) - .googleMap({ + .googlemap({ start: 0, // seconds end: 5, // seconds type: 'SATELLITE', diff --git a/plugins/tagThisPerson/popcorn.tagThisPerson.unit.html b/plugins/tagThisPerson/popcorn.tagThisPerson.unit.html index 43e90b7..a4ebef5 100644 --- a/plugins/tagThisPerson/popcorn.tagThisPerson.unit.html +++ b/plugins/tagThisPerson/popcorn.tagThisPerson.unit.html @@ -1,7 +1,7 @@ - Popcorn tagThisPerson test + Popcorn tagthisperson test