From f575b14a07c2f10ea93157b15de5e9056e3a44dd Mon Sep 17 00:00:00 2001 From: dseif Date: Fri, 11 Feb 2011 15:49:15 -0800 Subject: [PATCH] Adding googlemaps streetview bug70 --- plugins/googlemap/popcorn.googlemap.html | 15 +++++++++++++- plugins/googlemap/popcorn.googlemap.js | 25 ++++++++++++++++++++---- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/plugins/googlemap/popcorn.googlemap.html b/plugins/googlemap/popcorn.googlemap.html index feb92d4..ed8141a 100644 --- a/plugins/googlemap/popcorn.googlemap.html +++ b/plugins/googlemap/popcorn.googlemap.html @@ -18,6 +18,17 @@ 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 @@

Popcorn google Map Plug-in Demo

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

+

A Google StreetView 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.

-
+

Locations in this video:

+

Locations in this video:

Locations in this video:

diff --git a/plugins/googlemap/popcorn.googlemap.js b/plugins/googlemap/popcorn.googlemap.js index 26ff866..8164347 100644 --- a/plugins/googlemap/popcorn.googlemap.js +++ b/plugins/googlemap/popcorn.googlemap.js @@ -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); } }; -- 2.43.0