主要内容

wmcenter

(To be removed) Set or obtain web map center point

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

Description

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.

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

example

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

Examples

collapse all

Create a web map that uses the specified center point.

wmcenter(51,0)

Web map of the world, centered on Europe

Query the center point of the current web map.

[lat,lon] = wmcenter()
lat =

   51.0000


lon =

     0

Input Arguments

collapse all

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

Data Types: single | double

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

Data Types: single | double

Web map, specified as a web map handle.1

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

Data Types: single | double

Output Arguments

collapse all

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

Data Types: single | double

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

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

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