Main Content

Access Basemaps and Terrain in Site Viewer

Site Viewer displays data over basemaps and terrain. You can access different basemap and terrain choices in different ways.

Access Basemaps

Provide geographic context for your data by displaying the data over a basemap, also called a base layer. MathWorks® provides a variety of basemaps, including low-resolution two-tone options created using Natural Earth, high-zoom-level options hosted by Esri®, and a street map from OpenStreetMap®. For a list of basemap options, see the Basemap property of the siteviewer object.

Most of the basemaps provided by MathWorks require internet access, including the default basemap. If you do not have reliable access to the internet, you can use strategies such as displaying data over the "darkwater" basemap or downloading a selection of basemaps onto your local system.

Use Installed Basemap

The "darkwater" basemap is installed with MATLAB®. The other basemaps are not installed with MATLAB, but you can access them over an internet connection.

Download Basemaps

To work offline or to improve map responsiveness, you can download the basemaps created using Natural Earth onto your local system. The other basemaps are not available for download.

Download basemaps using the Add-On Explorer.

  1. On the MATLAB Home tab, in the Environment section, click Add-Ons > Get Add-Ons.

  2. In the Add-On Explorer, scroll to the MathWorks Optional Features section, and click Show All to find the basemap add-ons. You can also search for the basemap add-ons by name (listed in the following table) or click Optional Features in Filter by Type.

  3. Select the basemap add-ons that you want to download.

    Basemap NameBasemap Data Package Name
    "bluegreen"MATLAB Basemap Data - bluegreen
    "grayland"MATLAB Basemap Data - grayland
    "colorterrain"MATLAB Basemap Data - colorterrain
    "grayterrain"MATLAB Basemap Data - grayterrain
    "landcover"MATLAB Basemap Data - landcover

Add Custom Basemaps

Add custom basemaps from a URL by using the addCustomBasemap function. MATLAB requires an active internet connection to add and use custom basemaps from a URL.

Note

If the basemap does not render correctly in Site Viewer (for example only the ocean is visible), check if the basemap server supports CORS (cross-origin resource sharing). Site Viewer does not support basemaps that do not support CORS.

Additional Strategies

Mapping Toolbox™ enables additional strategies for using basemaps in offline environments. For example, you can use the addCustomBasemap (Mapping Toolbox) function to create custom basemaps from MBTiles files or from georeferenced images.

For more information about these strategies, see Use Basemaps in Offline Environments (Mapping Toolbox).

Access Terrain

By default, Site Viewer uses terrain data hosted by MathWorks and derived from the GMTED2010 model by the USGS and NGA. You need an active internet connection to access this terrain data, and you cannot download it.

To work offline or to improve terrain responsiveness, add custom terrain from DTED files using the addCustomTerrain function. You do not need an active internet connection to add or use custom terrain.

Alternatively, you can set the Terrain property of the Site Viewer to "none".

See Also

Objects

Related Topics