Contenu principal

viewer

R2026b

Create viewer for 3D scenario

Since R2026b

    Description

    Add-On Required: This feature requires the 3D Scenarios add-on.

    The viewer function creates a viewer for a Scenario object.

    A viewer has these default behaviors that you can customize:

    • By default, the viewer launches in a new figure window. You can specify a different parent container for the viewer by using the Parent name-value argument.

    • By default, the viewer automatically displays all entities in the scenario. You can modify this behavior by using the AutoUpdate argument.

    • By default, the viewer automatically zooms the camera to include new content that you add. You can modify this behavior by using the CameraMode property.

    v = viewer(scnro) creates a viewer for the specified 3D scenario. You can create multiple viewers for the same scenario.

    v = viewer(scnro,Name=Value) specifies options for the viewer using one or more name-value arguments.

    viewer(cv) makes the viewer cv the current viewer and brings it into focus.

    Input Arguments

    collapse all

    3D scenario, specified as a Scenario object.

    Viewer to make current, specified as a GlobeViewer object.

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: viewer(scnro,Name="My Viewer") specifies the name of the scenario viewer.

    Note

    Use name-value arguments to specify values for the properties of the GlobeViewer object created by this function. The properties listed here are only a subset. For a full list, see GlobeViewer.

    Basemap, specified as one of the values listed in the table. Six of the basemaps in the table are tiled data sets created using Natural Earth. Five of the basemaps are high-zoom-level maps hosted by Esri®.

    "satellite" basemap.

    "satellite" (default)

    Full global basemap composed of high-resolution satellite imagery.

    Hosted by Esri.

    "streets" basemap.

    "streets"

    General-purpose road map that emphasizes accurate, legible styling of roads and transit networks.

    Hosted by Esri.

    "streets-light" basemap.

    "streets-light"

    Map designed to provide geographic context while highlighting user data on a light background.

    Hosted by Esri.

    "streets-dark" basemap.

    "streets-dark"

    Map designed to provide geographic context while highlighting user data on a dark background.

    Hosted by Esri.

    "topographic" basemap.

    "topographic"

    General-purpose map with styling to depict topographic features.

    Hosted by Esri.

    "landcover" basemap.

    "landcover"

    Map that combines satellite-derived land cover data, shaded relief, and ocean-bottom relief. The light, natural palette is suitable for thematic and reference maps.

    Created using Natural Earth.

    "colorterrain" basemap.

    "colorterrain"

    Shaded relief map blended with a land cover palette. Humid lowlands are green and arid lowlands are brown.

    Created using Natural Earth.

    "grayterrain" basemap.

    "grayterrain"

    Terrain map in shades of gray. Shaded relief emphasizes both high mountains and micro-terrain found in lowlands.

    Created using Natural Earth.

    "bluegreen" basemap.

    "bluegreen"

    Two-tone, land-ocean map with light green land areas and light blue water areas.

    Created using Natural Earth.

    "grayland" basemap.

    "grayland"

    Two-tone, land-ocean map with gray land areas and white water areas.

    Created using Natural Earth.

    "darkwater" basemap.

    "darkwater"

    Two-tone, land-ocean map with light gray land areas and dark gray water areas. This basemap is installed with MATLAB®.

    Created using Natural Earth.

    Not applicable.

    Custom basemap added using the addCustomBasemap function.

    All basemaps except "darkwater" require internet access. The "darkwater" basemap is included with MATLAB.

    If you do not have consistent access to the Internet, you can download the basemaps created using Natural Earth onto your local system by using the Add-On Explorer. The basemaps hosted by Esri are not available for download. For more about using basemaps in offline environments, see Use Basemaps in Offline Environments.

    The basemaps hosted by Esri update periodically. As a result, you might see differences in your visualizations over time.

    Alignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks®.

    Option to automatically update visuals, specified as "on" or "off", or as a numeric or logical 1 (true) or 0 (false). A value of "on" is equivalent to true, and "off" is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

    • "on" — The viewer automatically visualizes all changes to the scenario.

    • "off" — You control when the viewer visualizes changes to the scenario. Update existing visuals by using the update function. Visualize new actor, behavior, and analysis objects by setting the Visible property of the corresponding visual object to true.

    Camera motion mode, specified as one of these options:

    • "auto" — The camera automatically moves when new actor, behavior, and analysis objects are added to the scenario, so that the new object is centered in the view. The viewer maintains the current zoom level, or minimally zooms out to view the new object.

    • "manual" — The camera does not move when new objects are added to the scenario.

    Output Arguments

    collapse all

    Viewer for 3D scenario, returned as a GlobeViewer object.

    Version History

    Introduced in R2026b

    See Also

    Objects

    Functions