Open web map
webmap opens a new web map, with its center at the latitude, longitude
[0 0]. By default,
the base layer to World Street Map at the maximum spatial extent available.
After the web map opens, you can select a different base layer using the
Layer Manager available on the right side of the web map. Named base layers
are tiled at discrete zoom resolutions.
webmap function requires an Internet
connection. MathWorks® cannot guarantee the stability and accuracy of web
maps, as the servers are on the Internet and are independent
from MathWorks. Occasionally, maps may be slow to display,
display partially, or fail to display, because web map servers
can become unavailable for short periods of time.
webmap( opens a new web map with
baseLayer as the default base layer. See
baseLayer for a list of the available maps.
Opens a new web map with
wmsLayer as the default base
wmsLayer is a
LayerTitle property of each
wmsLayer is set as an item in the Layer Manager.
webmap displays WMS layers in the "Web Mercator" map
coordinate reference system, if that projection is available for all layers
in the array. Otherwise,
webmap displays the layers in
the EPSG:4326 geographic coordinate reference system. When using EPSG:4326,
webmap does not include the default base layers in
the Layer Manager since they are in a different coordinate reference system.
These projections include a geographic quadrangle bounded north/south by
parallels and east/west by meridians. Parallels map to horizontal lines.
Meridians map to vertical lines.
opens a new web map using the custom basemap specified by the
customBasemap is a string scalar or character
vector specifying the display name of the custom basemap, if provided, or
the basemap name.
specified as the logical value
false or 0, opens a new
web map with the display clipped to the west at -180 degrees and to the east
at +180 degrees. The default for
true or 1, which opens a map that supports
continuous pan and zoom across the 180-degree meridian. The
webmap function constrains zoom to show less than
180 degrees of longitude at a time.
a handle to a web map,
wm = webmap(___)
webmap( makes the
web map specified by
wm the current web map.
Display Web Map
Open a web map centered at
View the list of available base layers (basemaps) by clicking the expander arrow on the right side of the map.
Display Web Map Specifying Base Layer
Open a web map specifying the base layer and show the full extent of the world.
webmap('Light Gray Canvas Map','WrapAround',false)
Display Web Map with WMS Layer as Base Layer
Read the Blue Marble WMS layer from the Atmospheric Composition Portal (ACP) Data from NASA Goddard Earth Sciences Data and Information Services Center (GES DISC).
baselayer = wmsfind('blue*marble'); baselayer = refine(baselayer,"eosdis.nasa.gov","SearchFields","serverurl"); baselayer = wmsupdate(baselayer(1));
Display a web map with the Blue Marble WMS layer as the base layer.
Display Web Map Using Custom Base Layer
Add a custom base layer. To do this, specify its name, URL, attribution, and display name.
name = 'opentopomap'; url = 'a.tile.opentopomap.org'; attribution = '©OpenStreetMap contributors'; displayName = 'Open Topo Map'; addCustomBasemap(name,url,'Attribution',attribution, ... 'DisplayName',displayName)
Display a web map. To do this, call
webmap and specify the base layer using the name you gave it when you created it.
baseLayer — Map displayed in web map
character vector | string scalar
Map displayed in the web map, specified as a string scalar or character vector, listed in the following table. If specified as string scalar or character vector, the value is case insensitive and spaces are optional.
Worldwide street map provided by Esri®. For information about the Esri ArcGIS Online layers, visit https://www.arcgis.com/home/gallery.html#c=esri&f=basemaps&t=maps.
Street map from
Worldwide imagery provided by Esri.
Topographic map for the world from Esri.
|Surface elevation as shaded relief provided by Esri|
|Natural Earth map of the world provided by Esri|
|Shaded relief and bathymetry provided by Esri|
|Composite of Blue Marble, NAIP, and Landsat provided by the USGS.|
|Topographic map with imagery provided by the USGS.|
|Composite of contours, shaded relief, and vector layers provided by the USGS.|
|General reference map provided by Esri|
|Topographic map provided by Esri|
|Bathymetry, marine features, depth in meter provided by Esri|
|Topographic data with nautical information provided by Esri|
|Neutral background map with minimal colors provided by Esri|
Alignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks.
wmsLayer — Web map service layer
Web map service layer, specified as a
Web maps do not support layers from
customBasemap — Name of custom basemap
character vector | string
Name of custom basemap, specified as a string scalar or
character vector. The value is case-insensitive and spaces are
optional. Create a custom basemap by using the
Web maps do not support custom basemaps created from MBTiles files.
wm — Web map
web map handle
Web map, specified as a web map handle, returned by the
wm — Web map
web map handle
Web map, returned as a web map handle.
In MATLAB® Online™, if you refresh the URL, then the window containing the web map closes. In addition, if you returned a handle to the web map, then it is deleted.
An interactive map accessed through a web page. In a web map, you can select different map layers to view and navigate around the map using interactive tools, such as zooming. The web map is a window that displays map base layers obtained from web servers on the Internet. You can also display overlay layers that contain custom point and line vector data.
Particular maps may not support every available zoom level. If your map displays as white, try another zoom level. The map you are displaying might not support the zoom level you have currently selected. You can also select another base layer, which might support the specified zoom level.
Version HistoryIntroduced in R2013b
R2022a: USGS Shaded Relief base layer has been removed
Starting in R2022a, the
webmap function issues an error
when you specify the base layer as
"USGS Shaded Relief".
In previous releases, the web map window shows red tiles. Update your code
by specifying a different base layer, such as
|Has Been Removed||Recommended|
webmap("USGS Shaded Relief")
webmap("World Shaded Relief")
R2021a: Web maps appear in multiple windows and have a default size
Starting in R2021a, web maps created using the
function have these differences from previous releases:
Each web map appears in a separate window. In previous releases, each web map appeared as a tab in a single window.
Web maps have a default size of 750-by-550 pixels. In previous releases, each new web map matched the size of the previous web map.
You cannot dock a web map.
R2020a: Compiling web maps using Linux requires files in directory of application
Starting in R2020a, to compile web maps using MATLAB Compiler™ on Linux®, you must copy these files to the application directory and distribute them with the application.
You can find the path to these files using the command