Navigate a Web Map

Web maps displayed in a browser using the webmap function are interactive. The browser lets you zoom in to view a portion of the map in more detail or move the map in any direction by panning with the mouse, arrow keys, or the scroll wheel. You can also perform zooming, panning, and other positioning programmatically, using the wmzoom, wmlimits, and wmcenter functions.

For example, open the default web map, using the webmap function. By default, webmap displays the entire map, scaled to fit the browser, centered at latitude and longitude [0 0].


Using the pan tool, move the map to put South America in the center and, using the zoom control, zoom in on Brazil.

You can perform the same navigation programmatically. For example, you can open a web map that is centered on Brazil at this zoom level using the wmcenter function. Specify the longitude and latitude of the center point and the zoom level as arguments. wmcenter opens a new web map is none exists.


You can also customize your view of a web map by specifying the latitude and longitude limits. For example, you can retrieve the current latitude and longitude limits using the wmlimits function.

[latlim, lonlim] = wmlimits 
latlim =

  -36.5081    7.6476

lonlim =

  -88.7077  -23.4929

You can then open a new web map, specifying these latitude and longitude limits using the wmlimits function.


Note that the resulting limits of the web map displayed might not match the specified limits, because the zoom level is quantized to discrete integer values and because the longitude limits may be constrained.

See Also

| | |

Related Topics