* cause and error.\r
*\r
* Tweening works using the following specifications:\r
- * -Location is the start point when using an auto generated route\r
- * -endLoc is the end location when using an auto generated route\r
- * Note that both location and endLoc must be present when using an auto generated route, or the map will not tween\r
- * -Interval is the speed in which the tween will be executed, a reasonable time is 1000 ( time in milliseconds )\r
+ * -location is the start point when using an auto generated route\r
+ * -tween when used in this context is a string which specifies the end location for your route\r
+ * Note that both location and tween must be present when using an auto generated route, or the map will not tween\r
+ * -interval is the speed in which the tween will be executed, a reasonable time is 1000 ( time in milliseconds )\r
* Heading, Zoom, and Pitch streetview values are also used in tweening with the autogenerated route\r
*\r
- * -Tween is an array of objects, each containing data for one frame of a tween\r
+ * -tween is an array of objects, each containing data for one frame of a tween\r
* -position is an object with has two paramaters, lat and lng, both which are mandatory for a tween to work\r
* -pov is an object which houses heading, pitch, and zoom paramters, which are all optional, if undefined, these values default to 0\r
* -interval is the speed in which the tween will be executed, a reasonable time is 1000 ( time in milliseconds )\r
\r
\r
);\r
- \r
+ \r
// Function to handle tweening using a set timeout\r
var tween = function ( rM, t ) {\r
\r
setTimeout( function () {\r
-\r
+ \r
// Checks whether this is a generated route or not\r
- if( options.tween ){\r
+ if( typeof options.tween === "array" ){\r
\r
for ( var i = 0; i < rM.length; i++ ) {\r
\r
// Determines if we should use hardcoded values ( using options.tween ),\r
// or if we should use a start and end location and let google generate\r
// the route for us\r
- if ( !options.tween && ( options.location && options.endLoc ) ){\r
+ if ( options.location && typeof options.tween === "string" ){\r
\r
// Creating another variable to hold the streetview map for tweening,\r
// Doing this because if there was more then one streetview map, the tweening would sometimes appear in other maps\r
\r
var request = {\r
origin: options.location,\r
- destination: options.endLoc,\r
+ destination: options.tween,\r
travelMode: google.maps.TravelMode.DRIVING\r
};\r
\r
\r
}\r
}\r
- else if( options.tween ){\r
+ else if( typeof options.tween === "array" ){\r
\r
// Same as the above to stop streetview maps from overflowing into one another\r
var sView3 = sView;\r
ok ( document.getElementById('map2').innerHTML === "", "initially, there is nothing inside the map2" );
plus();
+ ok ( document.getElementById('map3').innerHTML === "", "initially, there is nothing inside the map3" );
+ plus();
+
popped.googlemap({
start: 0, // seconds
end: 5, // seconds
zoom: 10
})
.googlemap({
- start: 0, // seconds
- end: 5, // seconds
- type: 'SATELLITE',
- target: 'map2',
- location:'boston',
- zoom: 15
- })
- .volume(0);
-
- popped.googlemap({
start: 0, // seconds
end: 10, // seconds
type: 'SATELLITE',
target: 'map2',
location:'toronto',
zoom: 15
- });
+ });
+ var mapz = popped.googlemap({
+ start: 0, // seconds
+ end: 15, // seconds
+ type: "STREETVIEW",
+ target: "map3",
+ location: "6th Line, Oakville, Ontario",
+ zoom: "1",
+ heading: "180",
+ pitch: "1",
+ interval: 1000,
+ tween: "York university"
+ })
+ .volume(0);
setupId = popped.getLastTrackEventId();
plus();
});
- popped.exec( 6, function() {
+ popped.exec( 4, function() {
+ equals (document.getElementById('actualmap3').offsetParent.id, "map3", "Tweening map is inside the 'map3' div" );
+ plus();
+ });
+
+ popped.exec( 20, function() {
ok (document.getElementById('actualmap2').style.display === "none" &&
- document.getElementById('actualmap1').style.display === "none", "Both maps are no longer visible" );
+ document.getElementById('actualmap1').style.display === "none" &&
+ document.getElementById('actualmap3').style.display === "none", "All maps are no longer visible" );
plus();
popped.pause();
popped.removeTrackEvent( setupId );
- ok( !document.getElementById('actualmap3'), "removed map was properly destroyed" );
+ ok( !document.getElementById('actualmap4'), "removed map was properly destroyed" );
plus();
});
popped.play();
});
+