\r
setTimeout( function () {\r
\r
- // Checks whether this is a generated route or not\r
+ // Checks whether this is a generated route or not\r
\r
- if( typeof options.tween === "object" ){\r
+ if( typeof options.tween === "object" ){\r
\r
- for ( var i = 0; i < rM.length; i++ ) {\r
+ for ( var i = 0; i < rM.length; i++ ) {\r
\r
- // Checks if this position along the tween should be displayed or not\r
- if( that.media.currentTime >= ( rM[ i ].interval*( i+1 ) )/1000 &&\r
- ( that.media.currentTime <= (rM[ i ].interval*( i+2 ) )/1000 || \r
- that.media.currentTime >= rM[ i ].interval*( rM.length )/1000 ) ){\r
+ // Checks if this position along the tween should be displayed or not\r
+ if( that.media.currentTime >= ( rM[ i ].interval*( i+1 ) )/1000 &&\r
+ ( that.media.currentTime <= (rM[ i ].interval*( i+2 ) )/1000 || \r
+ that.media.currentTime >= rM[ i ].interval*( rM.length )/1000 ) ){\r
\r
- sView3.setPosition( new google.maps.LatLng( rM[ i ].position.lat, rM[ i ].position.lng ) );\r
+ sView3.setPosition( new google.maps.LatLng( rM[ i ].position.lat, rM[ i ].position.lng ) );\r
\r
- sView3.setPov({\r
- heading: rM[ i ].pov.heading || 0,\r
- zoom: rM[ i ].pov.zoom || 0,\r
- pitch: rM[ i ].pov.pitch || 0\r
- });\r
+ sView3.setPov({\r
+ heading: rM[ i ].pov.heading || 0,\r
+ zoom: rM[ i ].pov.zoom || 0,\r
+ pitch: rM[ i ].pov.pitch || 0\r
+ });\r
\r
- }\r
+ }\r
+\r
+ }\r
\r
+ // Calls the tween function again at the interval set by the user\r
+ tween( rM, rM[ 0 ].interval );\r
}\r
- // Calls the tween function again at the interval set by the user\r
- tween( rM, rM[ 0 ].interval );\r
- }\r
- else{\r
+ else{\r
\r
- for ( var k = 0; k < rM.length; k++ ) {\r
+ for ( var k = 0; k < rM.length; k++ ) {\r
\r
- if( that.media.currentTime >= (options.interval*( k+1 ) )/1000 &&\r
- ( that.media.currentTime <= (options.interval*( k+2 ) )/1000 ||\r
- that.media.currentTime >= options.interval*( rM.length )/1000 ) ){\r
+ if( that.media.currentTime >= (options.interval*( k+1 ) )/1000 &&\r
+ ( that.media.currentTime <= (options.interval*( k+2 ) )/1000 ||\r
+ that.media.currentTime >= options.interval*( rM.length )/1000 ) ){\r
\r
- sView2.setPosition( checkpoints[ k ] );\r
+ sView2.setPosition( checkpoints[ k ] );\r
\r
- sView2.setPov({\r
- heading: options.heading || 0,\r
- zoom: options.zoom,\r
- pitch: options.pitch || 0\r
- }); \r
- } \r
+ sView2.setPov({\r
+ heading: options.heading || 0,\r
+ zoom: options.zoom,\r
+ pitch: options.pitch || 0\r
+ }); \r
+ } \r
\r
- }\r
+ }\r
\r
- tween( checkpoints, options.interval );\r
- } \r
+ tween( checkpoints, options.interval );\r
+ } \r
}, t );\r
\r
};\r