Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

# wmlimits

Set or obtain web map limits

## Syntax

``wmlimits(latitudeLimits,longitudeLimits)``
``wmlimits(wm,latitudeLimits,longitudeLimits)``
``````[latlim,lonlim] = wmlimits()``````
``````[latlim,lonlim] = wmlimits(wm)``````

## Description

example

````wmlimits(latitudeLimits,longitudeLimits)` center the current web map within the specified latitude limits and the longitude limits. If there is no current web map, `wmlimits` creates one. NoteThe resulting limits often do not match the specified limits because the zoom level is quantized to discrete integer values and the longitude limits may be constrained if the map was constructed with the `WrapAround` property equal to `false`. ```

example

````wmlimits(wm,latitudeLimits,longitudeLimits)` centers the web map specified by the web map handle `wm` within the specified latitude limits and longitude limits.```

example

``````[latlim,lonlim] = wmlimits()``` returns the latitude and longitude limits of the current web map.```
``````[latlim,lonlim] = wmlimits(wm)``` returns the latitude and longitude limits of the web map specified by `wm`. ```

## Examples

collapse all

Specify latitude and longitude limits. `wmlimits` creates the web map.

```wmlimits([37, 42], [-108.9, -100.7]) ```

Get the latitude and longitude limits of the current web map. (Note: The limits returned depend on the size of the web map frame and the zoom level. Your results may differ from the results shown in this example.)

`[latitudeLimits, longitudeLimits] = wmlimits()`
```latitudeLimits = 34.8664 43.9282 longitudeLimits = -112.9519 -96.6481```

Create two web maps, specifying different base layers.

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

Click the tile vertically button to make both makes visible at the same time.

Specify latitude and longitude limits and apply to both maps to get two different views of the same region.

```latitudeLimits = [37, 42]; longitudeLimits = [-108.9, -100.7]; wmlimits(wm1, latitudeLimits, longitudeLimits) wmlimits(wm2, latitudeLimits, longitudeLimits)```

## Input Arguments

collapse all

Latitude limits in degrees, specified as a 1-by-2 row vector of type `double` of the form ```[southern-limit northern-limit]```.

Example: `[37, 42]`

Data Types: `double`

Longitude limits in degrees, specified as a 1-by-2 row vector of type `double` of the form ```[western-limit eastern-limit]```.

Example: `[-108.9, -100.7]`

Data Types: `double`

Web map, specified as a scalar web map handle.

## Output Arguments

collapse all

Latitude limits in degrees, returned as a 1-by-2 row vector of type `double`.

Example: `[37, 42]`

Data Types: `double`

Longitude limits in degrees, returned as a 1-by-2 row vector of type `double`.

Example: `[-108.9, -100.7]`

Data Types: `double`