Quantcast

Documentation Center

  • Trial Software
  • Product Updates

wmlimits

Set or obtain web map limits

Syntax

  • wmlimits(latitudeLimits,longitudeLimits) example
  • wmlimits(wm,latitudeLimits,longitudeLimits) example
  • [latlim,lonlim] = wmlimits() example
  • [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.

    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.

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

expand all

Display Web Map Centered Within Specified Limits

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.

[latitudeLimits, longitudeLimits] = wmlimits()
latitudeLimits =

   34.8664   43.9282


longitudeLimits =

 -112.9519  -96.6481

Display Several Web Maps Centered Within Specified Limits

Create two web maps, specifying different base layers.

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

Specify latitude and longitude limits and apply to both maps.

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

Input Arguments

expand all

latitudeLimits — Latitude limits in degrees1-by-2 row vector of type double

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

Example: [37, 42]

Data Types: double

longitudeLimits — Longitude limits in degrees1-by-2 row vector of type double

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

Example: [-108.9, -100.7]

Data Types: double

wm — Web mapscalar web map handle

Web map, specified as a scalar web map handle.

Output Arguments

expand all

latlim — Latitude limits in degrees1-by-2 row vector of type double

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

Example: [37, 42]

Data Types: double

lonlim — Longitude limits in degrees1-by-2 row vector of type double

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

Example: [-108.9, -100.7]

Data Types: double

See Also

| | | | | | |

Was this topic helpful?