Documentation Center

  • Trial Software
  • Product Updates

wmcenter

Set or obtain web map center point

Syntax

  • wmcenter(centerLatitude,centerLongitude) example
  • wmcenter(wm,centerLatitude,centerLongitude) example
  • wmcenter(___,zoomLevel)
  • [lat,lon] = wmcenter() example
  • [lat,lon] = wmcenter(wm)

Description

example

wmcenter(centerLatitude,centerLongitude) centers the current web map at the specified latitude and longitude. If there is no current web map, wmcenter creates a new web map.

example

wmcenter(wm,centerLatitude,centerLongitude) centers the web map, specified by the handle wm, at the specified latitude and longitude.

wmcenter(___,zoomLevel) centers and zooms the web map to the specified zoom level.

example

[lat,lon] = wmcenter() returns the latitude and longitude of the center point of the current web map.

[lat,lon] = wmcenter(wm) returns the latitude and longitude of the center point of the web map specified by the handle wm.

Examples

expand all

Display web map and center it

Display a map a find it's center point. wmcenter creates a web map if none exists.

[centerLatitude, centerLongitude] = wmcenter()
centerLatitude =

     0


centerLongitude =

     0

Center the map at the specified center point.

wmcenter(51.52, 0)

Display multiple web maps centered and zoomed

Create two web maps.

wm1 = webmap;
wm2 = webmap('mapquest open aerial map');

Center the two web maps, specifying the zoom level as well.

centerLatitude = 36.1;
centerLongitude = -113.2;
zoomLevel = 10;
wmcenter(wm1, centerLatitude, centerLongitude, zoomLevel)
wmcenter(wm2, centerLatitude, centerLongitude, zoomLevel)

Input Arguments

expand all

centerLatitude — Latitude of center pointscalar in the range [-90 90] of type single or double

Latitude of center point, specified as a scalar in the range [-90 90] of type single or double.

Data Types: single | double

centerLongitude — Longitude of center pointscalar in the range [-180 180] of type single or double

Longitude of center point, specified as a scalar in the range [-180 180] of type single or double.

Data Types: single | double

wm — Web mapweb map handle

Web map, specified as a web map handle.

zoomLevel — Zoom levelscalar numeric integer in the range [0 18] of type single or double

Zoom level, specified as a scalar numeric integer in the range [0 18] of type single or double.

Data Types: single | double

Output Arguments

expand all

lat — Latitude of center pointscalar in the range [-90 90] of type single or double

Latitude of center point, returned as a scalar in the range [-90 90] of type single or double.

Data Types: single | double

lon — Longitude of center pointscalar in the range [-180 180] of type single or double

Longitude of center point, returned as a scalar in the range [-180 180] of type single or double.

Data Types: single | double

More About

expand all

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.

See Also

| | | | | | |

Was this topic helpful?