]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Adding googlemaps streetview bug70
authordseif <david.c.seifried@gmail.com>
Fri, 11 Feb 2011 23:49:15 +0000 (15:49 -0800)
committerdseif <david.c.seifried@gmail.com>
Fri, 11 Feb 2011 23:49:15 +0000 (15:49 -0800)
plugins/googlemap/popcorn.googlemap.html
plugins/googlemap/popcorn.googlemap.js

index feb92d4167b1655bf8ed17e9d576bb5761ccf03f..ed8141aab2533a64eb8fd870d19ecac2eb333ca9 100644 (file)
         lat: 43.665429,
         lng: -79.403323,
         zoom: "10"
+      } )
+         .googlemap({
+        start: 0, // seconds
+        end: 20, // seconds
+        type: 'STREETVIEW',
+        target: 'map1',
+        lat: 43.665429,
+        lng: -79.403323,
+        zoom: "1",
+               heading: 0,
+               pitch: 0
       } )
       .googlemap({
         start: 0, // seconds
@@ -33,6 +44,7 @@
 <body>
   <h1 id="qunit-header">Popcorn google Map Plug-in Demo</h1>
   <p> A Google Map displaying Toronto, Ontario will appear at 0 seconds and disappear at 20 seconds.</p>
+  <p> A Google StreetView Map displaying Toronto, Ontario will appear at 0 seconds and disappear at 20 seconds.</p>
   <p> A Google Map displaying Boston will appear at 0 seconds and disappear at 30 seconds.</p>
   <div>
     <video id='video' 
@@ -52,8 +64,9 @@
 
     </video> 
   </div>
-  <div style="width:700px">
+  <div style="width:1000px">
     <div id="map" style="position:relative;float:left;width:300px;height:400px"><p>Locations in this video:</p></div>
+       <div id="map1" style="position:relative;float:left;width:300px;height:400px"><p>Locations in this video:</p></div>
     <div id="map2" style="position:relative;float:left;width:300px;height:400px"><p>Locations in this video:</p></div>
   </div>
 </body>
index 26ff8664a34e3a8392d75519009638b4a6a9e31b..81643472d64f3e7eac0c5f766111f82f7e8c048b 100644 (file)
@@ -9,8 +9,10 @@ var googleCallback;
    * -Start is the time that you want this plug-in to execute
    * -End is the time that you want this plug-in to stop executing 
    * -Target is the id of the DOM element that you want the map to appear in. This element must be in the DOM
-   * -Type [optional] either: HYBRID (default), ROADMAP, SATELLITE, TERRAIN 
+   * -Type [optional] either: HYBRID (default), ROADMAP, SATELLITE, TERRAIN, STREETVIEW 
    * -Zoom [optional] defaults to 0
+   * -Heading [optional] STREETVIEW orientation of camera in degrees relative to true north (0 north, 90 true east, ect)
+   * -Pitch [optional] STREETVIEW vertical orientation of the camera (between 1 and 3 is recommended)
    * -Lat and Lng: the coordinates of the map must be present if location is not specified.
    * -Location: the adress you want the map to display, bust be present if lat and log are not specified.
    *  Note: using location requires extra loading time, also not specifying both lat/lng and location will
@@ -45,11 +47,13 @@ var googleCallback;
           start    : {elem:'input', type:'text', label:'In'},
           end      : {elem:'input', type:'text', label:'Out'},
           target   : 'map-container',
-          type     : {elem:'select', options:['ROADMAP','SATELLITE', 'HYBRID', 'TERRAIN'], label:'Type'},
+          type     : {elem:'select', options:['ROADMAP','SATELLITE', 'STREETVIEW', 'HYBRID', 'TERRAIN'], label:'Type'},
           zoom     : {elem:'input', type:'text', label:'Zoom'},
           lat      : {elem:'input', type:'text', label:'Lat'},
-          lng     : {elem:'input', type:'text', label:'Lng'},
-          location : {elem:'input', type:'text', label:'Location'}
+          lng      : {elem:'input', type:'text', label:'Lng'},
+          location : {elem:'input', type:'text', label:'Location'},
+                 heading  : {elem:'input', type:'text', label:'Heading'},
+                 pitch    : {elem:'input', type:'text', label:'Pitch'}
         }
       },
       _setup : function( options ) {
@@ -135,6 +139,19 @@ var googleCallback;
             options._map.setZoom( options.zoom );
 
             google.maps.event.trigger(options._map, 'resize');
+                       
+                       if(options.type === 'STREETVIEW'){
+                       var streetViewOptions = {
+                         position: options._location,
+                         pov: {
+                           heading: options.heading,
+                               pitch: options.pitch,
+                               zoom: options.zoom
+                               }
+                         };
+                         var streetView = new  google.maps.StreetViewPanorama(options._newdiv, streetViewOptions);
+                       }
+                       options._map.setStreetView(streetView);
           }
         };