@@ -14,17 +14,12 @@ GMaps.prototype.createPanorama = function(streetview_options) {
14
14
GMaps . createPanorama = function ( options ) {
15
15
var el = getElementById ( options . el , options . context ) ;
16
16
17
- var panoramaService = new google . maps . StreetViewService ( ) ;
18
- var checkaround = options . checkaround || 50 ;
19
- var panorama = null ;
20
-
21
17
options . position = new google . maps . LatLng ( options . lat , options . lng ) ;
22
18
23
19
delete options . el ;
24
20
delete options . context ;
25
21
delete options . lat ;
26
22
delete options . lng ;
27
- delete options . checkaround ;
28
23
29
24
var streetview_events = [ 'closeclick' , 'links_changed' , 'pano_changed' , 'position_changed' , 'pov_changed' , 'resize' , 'visible_changed' ] ,
30
25
streetview_options = extend_object ( { visible : true } , options ) ;
@@ -33,28 +28,17 @@ GMaps.createPanorama = function(options) {
33
28
delete streetview_options [ streetview_events [ i ] ] ;
34
29
}
35
30
36
- //get only a streetview if this one is available
37
- panoramaService . getPanoramaByLocation ( options . position , checkaround , function ( data , status ) {
38
- if ( status == google . maps . StreetViewStatus . OK ) {
39
-
40
- streetview_options . position = data . location . latLng ;
31
+ var panorama = new google . maps . StreetViewPanorama ( el , streetview_options ) ;
41
32
42
- panorama = new google . maps . StreetViewPanorama ( el , streetview_options ) ;
43
-
44
- for ( var i = 0 ; i < streetview_events . length ; i ++ ) {
45
- ( function ( object , name ) {
46
- if ( options [ name ] ) {
47
- google . maps . event . addListener ( object , name , function ( ) {
48
- options [ name ] . apply ( this ) ;
49
- } ) ;
50
- }
51
- } ) ( panorama , streetview_events [ i ] ) ;
33
+ for ( var i = 0 ; i < streetview_events . length ; i ++ ) {
34
+ ( function ( object , name ) {
35
+ if ( options [ name ] ) {
36
+ google . maps . event . addListener ( object , name , function ( ) {
37
+ options [ name ] . apply ( this ) ;
38
+ } ) ;
52
39
}
53
- panorama . setVisible ( true ) ;
54
- return panorama ;
55
- // no result
56
- } else {
57
- return false ;
58
- }
59
- } ) ;
60
- } ;
40
+ } ) ( panorama , streetview_events [ i ] ) ;
41
+ }
42
+
43
+ return panorama ;
44
+ } ;
0 commit comments