MapView.SetZoomLevel
--------------------

Sets zoom level.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [MapView](component_MapView.md) | [9.5](newinversion95.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "MapView.SetZoomLevel"; MapView; ZoomLevel { ; Animated } ) 

**MBS**( **"MapView.SetZoomLevel";** /\* Sets zoom level. \*/  
**$MapView**; /\* The map view reference number.e.g. $$MapView \*/   
**$ZoomLevel**; /\* The new zoom level.  
Range 1 to 20.e.g. 5 \*/   
**$Animated**) /\* Optional; Whether to animate.  
Pass 1 to animate or 0 to not animate.  
Default is animated.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| MapView | The map view reference number. | $$MapView |  |
| ZoomLevel | The new zoom level.   Range 1 to 20. | 5 |  |
| Animated | Whether to animate.   Pass 1 to animate or 0 to not animate.   Default is animated. | 1 | Optional |

### Result

Returns OK or error.

### Description

Sets zoom level.  
### Examples

Zoom one level in:

 MBS ( "MapView.SetZoomLevel"; $$MapView ; MBS ( "[MapView.GetZoomLevel](MapViewGetZoomLevel.md)"; $$MapView ) + 1; 1)  
Zoom out:

 MBS ( "MapView.SetZoomLevel"; $$MapView ; 1; 1)  
### See also

- [MapView.GetZoomLevel](MapViewGetZoomLevel.md)

### Release notes

- **Version 9.5**
    - Added [MapView.GetZoomLevel](http://www.mbsplugins.eu/MapViewGetZoomLevel.shtml) and [MapView.SetZoomLevel](http://www.mbsplugins.eu/MapViewSetZoomLevel.shtml) functions.

### Example Databases

- [Mac and iOS/MapKit/MapView BeeExample](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/MapKit/MapView%20BeeExample.shtml#31ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 9.5pr1](https://www.mbsplugins.de/archive/2019-10-02/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 20th September 2019 , last changed 20th September 2019

  
[MapView.SetZoomEnabled](MapViewSetZoomEnabled.md) - [MapView.ShowAddress](MapViewShowAddress.md)

[HTML Version](MapViewSetZoomLevel.shtml)