Create geographic globe
geoglobe( creates a geographic globe in
the specified figure, panel, or tab group. The figure must be created using the parent)uifigure function. For information about navigating the globe, see Geographic Globe Navigation.
The geographic globe requires hardware graphics support for WebGL™. For more information, see Tips.
geoglobe(
specifies additional options for the globe using one or more name-value pair arguments.
Specify the options after all other input arguments. For a list of options, see parent,Name,Value)GeographicGlobe.
g = geoglobe(___) returns a
GeographicGlobe object. This syntax is useful for controlling the
properties of the geographic globe.
In the Live Editor, geographic globes appear in a separate window instead of within the live script.
In MATLAB
Online™, if you refresh the URL, then the UI figure remains open, but the geographic
globe visualization disappears. As a workaround, this code shows how to use the copyobj function to copy the property values of a geographic globe,
g, into a new geographic globe, g2, with the same
parent, and then delete the original geographic globe. The code can take several minutes
to
run.
g2 = copyobj(g,g.Parent); delete(g)
Deploying geographic globes using MATLAB Compiler™ is not supported on Linux.
If multiple windows requiring WebGL are open at once, then the geographic globe might display this error:
Globe Viewer needs to close because the WebGL context has been lost.
The geographic globe requires hardware graphics support for WebGL. To determine if your system has hardware graphics support for WebGL, display axes in a figure created using the uifigure
function. Get renderer info about the axes using the rendererinfo
function. Then, query the GraphicsRenderer property. Your system has
hardware graphics support if the GraphicsRenderer property has a
value of
'WebGL'.
fig = uifigure; ax = axes(fig); info = rendererinfo(ax); info.GraphicsRenderer
ans =
'WebGL'If you create a geographic globe with no output argument, then you can assign the
globe to a variable later by using the findall function. If there is
more than one geographic globe, then findall returns a vector of
globe
objects.
uif = uifigure; geoglobe(uif) g = findall(groot,'Type','globe');
If there is more than one geographic globe, then findall returns
a vector of globe
objects.
uif = uifigure; geoglobe(uif) uif2 = uifigure; geoglobe(uif2) g = findall(groot,'Type','globe')
g = 2×1 GeographicGlobe array: GeographicGlobe GeographicGlobe