]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#506] Apply fixes as recommended;
authorRick Waldron <waldron.rick@gmail.com>
Mon, 9 May 2011 13:22:24 +0000 (09:22 -0400)
committerRick Waldron <waldron.rick@gmail.com>
Mon, 9 May 2011 13:22:24 +0000 (09:22 -0400)
plugins/googlemap/popcorn.googlemap.js

index 311a45c6a6844056d4dfd1e39faa958fd1955699..08198705bc8d224e9c20610cd8b8f2f2f2f3eb4a 100644 (file)
@@ -128,9 +128,11 @@ var googleCallback;
         // ensure the map has been initialized in the setup function above
         var isMapSetup = function () {
           if ( map ) {
-            map.getDiv().style.display = "block";
-            // reset the location and zoom just in case the user plaid with the map
-            map.setCenter(location);
+            map.getDiv().style.display = "block";                               
+
+            // reset the location and zoom just in case the user manually moved the map
+                                               google.maps.event.trigger(map, "resize");
+            map.setCenter(location);       
 
             // make sure options.zoom is a number
             if ( options.zoom && typeof options.zoom !== "number" ) {
@@ -149,8 +151,6 @@ var googleCallback;
               options.pitch = +options.pitch;
             }
 
-            google.maps.event.trigger(map, 'resize');
-
             if ( options.type === "STREETVIEW" ) {
               // Switch this map into streeview mode
               map.setStreetView(