diff --git a/Classes/TiGooglemapsViewProxy.h b/Classes/TiGooglemapsViewProxy.h index 9499189..42a5bb6 100644 --- a/Classes/TiGooglemapsViewProxy.h +++ b/Classes/TiGooglemapsViewProxy.h @@ -346,4 +346,12 @@ */ - (NSNumber *)zoom; +/** + * Returns the current map view zoom level. + * + * @return A boxed float containing the current map view zoom level. + * @since 4.3.0 + */ +- (NSNumber *)zoomLevel; + @end diff --git a/Classes/TiGooglemapsViewProxy.m b/Classes/TiGooglemapsViewProxy.m index 6cbe43c..0029e08 100644 --- a/Classes/TiGooglemapsViewProxy.m +++ b/Classes/TiGooglemapsViewProxy.m @@ -826,6 +826,12 @@ - (void)showAnnotations:(id)args } - (NSNumber *)zoom +{ + DEPRECATED_REPLACED(@"Map.View.zoom", @"5.4.1", @"Map.View.zoomLevel"); + return self.zoomLevel; +} + +- (NSNumber *)zoomLevel { return @([[self mapView] mapView].camera.zoom); } diff --git a/README.md b/README.md index 0344954..6d540f8 100644 --- a/README.md +++ b/README.md @@ -178,13 +178,14 @@ mapView.rotateGestures = false; mapView.allowScrollGesturesDuringRotateOrZoom = false; ``` -#### Get current zoom +#### Get current zoom level ```js -const currentZoom = mapView.zoom; +const currentZoom = mapView.zoomLevel; ``` -Note: You can watch the `regionchanged` event to get realtime updates about the zoom level change +Note: You can watch the `regionchanged` event to get real time updates about the zoom level change. +See the `event.zoom` property for details. #### Map Padding diff --git a/manifest b/manifest index c352dae..8754dc2 100644 --- a/manifest +++ b/manifest @@ -2,7 +2,7 @@ # this is your module manifest and used by Titanium # during compilation, packaging, distribution, etc. # -version: 5.4.0 +version: 5.4.1 apiversion: 2 architectures: armv7 arm64 i386 x86_64 description: ti.googlemaps