File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 102
102
for ( var k2 in vm . map . customMarkers ) {
103
103
bounds . extend ( vm . map . customMarkers [ k2 ] . getPosition ( ) ) ;
104
104
}
105
+ if ( vm . mapOptions . maximumZoom ) {
106
+ vm . enableMaximumZoomCheck = true ; //enable zoom check after resizing for markers
107
+ }
105
108
vm . map . fitBounds ( bounds ) ;
106
109
} ;
107
110
210
213
$parse ( $attrs . mapInitialized ) ( $scope , { map : vm . map } ) ;
211
214
}
212
215
} ) ;
216
+
217
+ //add maximum zoom listeners if zoom-to-include-markers and and maximum-zoom are valid attributes
218
+ if ( mapOptions . zoomToIncludeMarkers && mapOptions . maximumZoom ) {
219
+ google . maps . event . addListener ( vm . map , 'zoom_changed' , function ( ) {
220
+ if ( vm . enableMaximumZoomCheck == true ) {
221
+ vm . enableMaximumZoomCheck = false ;
222
+ google . maps . event . addListenerOnce ( vm . map , 'bounds_changed' , function ( ) {
223
+ vm . map . setZoom ( Math . min ( mapOptions . maximumZoom , vm . map . getZoom ( ) ) ) ;
224
+ } ) ;
225
+ }
226
+ } ) ;
227
+ }
213
228
} ;
214
229
215
230
$scope . google = google ; //used by $scope.eval to avoid eval()
You can’t perform that action at this time.
0 commit comments