1
1
/**
2
2
* Add Google as Leaflet layer for API integration.
3
- *
3
+ *
4
4
* @author Bencevans, Crofty, Raruto
5
5
*
6
6
* @link https://gist.github.com/bencevans/4504864
@@ -64,7 +64,7 @@ L.Google = (L.Layer || L.Class).extend({
64
64
map . on ( 'viewreset' , this . _resetCallback , this ) ;
65
65
66
66
this . _limitedUpdate = L . Util . limitExecByInterval ? L . Util . limitExecByInterval ( this . _update , 150 , this ) : L . Util . throttle ( this . _update , 150 , this ) ;
67
- map . on ( 'move' , this . _update , this ) ;
67
+ map . on ( 'move drag zoomend ' , this . _update , this ) ;
68
68
69
69
map . on ( 'zoomanim' , this . _handleZoomAnim , this ) ;
70
70
@@ -82,7 +82,7 @@ L.Google = (L.Layer || L.Class).extend({
82
82
83
83
this . _map . off ( 'viewreset' , this . _resetCallback , this ) ;
84
84
85
- this . _map . off ( 'move' , this . _update , this ) ;
85
+ this . _map . off ( 'move drag zoomend ' , this . _update , this ) ;
86
86
87
87
this . _map . off ( 'zoomanim' , this . _handleZoomAnim , this ) ;
88
88
@@ -156,6 +156,17 @@ L.Google = (L.Layer || L.Class).extend({
156
156
_this . _pegamenFix ( ) ;
157
157
}
158
158
) ;
159
+
160
+ var panorama = map . getStreetView ( ) ;
161
+ if ( panorama ) {
162
+ google . maps . event . addListener ( panorama , 'visible_changed' , function ( ) {
163
+ if ( panorama . getVisible ( ) ) {
164
+ _this . _map . _container . classList . add ( "google-streetview-enabled" ) ;
165
+ } else {
166
+ _this . _map . _container . classList . remove ( "google-streetview-enabled" ) ;
167
+ }
168
+ } ) ;
169
+ }
159
170
} ,
160
171
161
172
_checkZoomLevels : function ( ) {
0 commit comments