Main Content

wmzoom

Set or obtain zoom level of web map

Description

wmzoom(zoomLevel) specifies the zoom level of the current web map, zoomLevel. If there is no current web map, wmzoom creates a new web map.

example

wmzoom(wm,zoomLevel) specifies the zoom level of the web map, specified by the handle wm.

example

zoomLevelOut = wmzoom() returns the zoom level of the current web map.

example

zoomLevelOut = wmzoom(wm) returns the zoom level of the web map specified by the handle wm.

Examples

collapse all

Create a web map at default zoom level.

zoomLevel = wmzoom()
zoomLevel =

     0

Zoom in and center the web map at the specified latitude and longitude (London).

wmzoom(10)
wmcenter(51.52, 0)

Create two web maps.

wm1 = webmap;
wm2 = webmap('worldtopographic');

Zoom in and center both maps at a specified latitude and longitude (Paris).

lat = 48.821; 
lon = 1.9391;
zoomLevel = 10;

wmzoom(wm1, zoomLevel)
wmcenter(wm1, lat, lon)
wmzoom(wm2, zoomLevel)
wmcenter(wm2, lat, lon) 

Input Arguments

collapse all

Zoom level, specified as a scalar numeric integer in the range [0 18].

Data Types: single | double

Web map, specified as a web map handle.1

Output Arguments

collapse all

Zoom level of the current web map, returned as a scalar numeric integer in the range [0 18].

Data Types: single | double

Tips

  • Particular maps may not support every available zoom level. If your map displays as completely white, try another zoom level. The map you are displaying may not support the zoom level you have currently selected. You can also select another base layer, which might support the specified zoom level.

Version History

Introduced in R2013b


1 Alignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks®.