主要内容

removeCustomBasemap

Remove custom basemap

Since R2022a

Description

removeCustomBasemap(basemapName) removes the custom basemap specified by basemapName from the list of available basemaps.

If the custom basemap specified by basemapName has not been previously added using the function, the removeCustomBasemap function issues an error.

Examples

collapse all

This example shows how to register and switch between custom basemaps in satelliteScenarioViewer while visualizing a satellite scenario.

Register and use NASA VIIRS City Lights Basemap.

addCustomBasemap("viirs", ...
    "https://gitc.earthdata.nasa.gov/wmts/epsg3857/best/VIIRS_CityLights_2012/default/GoogleMapsCompatible_Level8/${z}/${y}/${x}.jpg", ...
    Attribution = "Imagery provided by services from NASA's Global Imagery Browse Services (GIBS)", ...
    MaxZoomLevel = 8);

sc = satelliteScenario;

Re = 6378.137e3; % Earth's radius in meters

perigee = Re + 300e3;    % Perigee altitude: 300 km
apogee  = Re + 16800e3;  % Apogee altitude: 16800 km

a = (perigee + apogee) / 2; % Semi-major axis (meters)
e = (apogee - perigee) / (apogee + perigee); % Eccentricity
inclination = 63.4;    % degrees
raan = 0;              % Right ascension of ascending node, degrees
argPeriapsis = 270;    % Argument of periapsis, degrees
trueAnomaly = 0;       % degrees

sat = satellite(sc, a, e, inclination, raan, argPeriapsis, trueAnomaly);

Add a ground station at Natick, MA.

gs = groundStation(sc, 42.283, -71.35, Name = "Natick, MA");

Add access analysis between satellite and ground station.

ac = access(sat, gs);

Visualize scenario with the NASA VIIRS City Lights basemap.

viewer1 = satelliteScenarioViewer(sc, Basemap = "viirs", Name = "NASA VIIRS City Lights Basemap");

Show ground track for 6 hours.

groundTrack(sat, LeadTime = 3*3600, TrailTime = 3*3600);
play(sc, PlaybackSpeedMultiplier = 1000);

Delete the viewer, remove VIIRS Basemap, and register OpenStreetMap.

delete(viewer1);
removeCustomBasemap("viirs");

addCustomBasemap("osm", ...
    "https://tile.openstreetmap.org/${z}/${x}/${y}.png", ...
    Attribution = "© OpenStreetMap contributors");

viewer2 = satelliteScenarioViewer(sc, Basemap = "osm", Name = "OpenStreetMap Basemap");
play(sc, PlaybackSpeedMultiplier = 1000);

Input Arguments

collapse all

Name of the custom basemap to remove, specified as a string scalar or character vector. You define the basemap name when you add the basemap using the addCustomBasemap function.

Data Types: string | char

Version History

Introduced in R2022a