Main Content

wmlimits

(To be removed) Set or obtain web map limits

The wmlimits function will be removed in a future release. Use a geographic axes object and the geolimits function instead. For information on updating your code, see Version History.

Description

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.

Note

The 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.

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

example

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

Examples

collapse all

Create a web map that uses the specified latitude and longitude limits.

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

Web map centered on Denver, Colorado

Get the latitude and longitude limits of the current web map.

[latitudeLimits,longitudeLimits] = wmlimits()
latitudeLimits =

   34.7311   44.0468


longitudeLimits =

 -113.0397  -96.5603

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.1

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

Version History

Introduced in R2013b

collapse all


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®.