Skip to main content

Options

Everything createGlobe(canvas, options) accepts. All options can also be patched at runtime with setOptions.

Licensing

OptionTypeDefaultDescription
licenseKeystring | null"0000-0000-000-0000"Use the key supplied for a GPLv3-compatible project or with a commercial order. The default logs a production warning.

Projection and view

OptionTypeDefaultDescription
mode"globe" | "map""globe"Orthographic sphere or flat map
projection"equirectangular" | "mercator" | "naturalEarth""equirectangular"Flat-map projection
center{ lon, lat }{ lon: 10, lat: 20 }Initial view centre
zoomnumber1Initial zoom
minZoomnumber1Lower bound
maxZoomnumber8Upper bound
zoomablebooleantrueWheel and pinch zoom
radiusRationumber0.4Globe radius vs the smaller canvas side
latRange[north, south][83, -56]Latitude window for map mode

Interaction

OptionTypeDefaultDescription
interactivebooleantrueDrag, zoom, hover and click
keyboardbooleantrueArrow keys, +/-, 0, PageUp/PageDown
momentumbooleantrueCoast after a drag
autoRotatebooleantrueSpin when idle (globe mode)
rotateSpeednumber0.09Degrees per frame
tooltipboolean | functionfalsetrue, or (target, kind) => string
fpsnumber30Frame cap

Appearance

OptionTypeDefaultDescription
presetPresetNameNot setBundle of theme + render style
sceneSceneNameNot setWhole composition: preset plus layers
themeThemeName | "auto" | "css" | object"atlas"Palette
landStyle"fill" | "dots" | "outline" | "glow" | "none""fill"How land is drawn
dotSpacingnumber2Dot grid spacing in degrees
dotSizenumber1.15Dot radius in px
orbitsnumber | Orbit[]0Decorative rings, 0-6 or explicit specs
graticulebooleantrueLatitude/longitude grid
starsbooleantrueStarfield outside the sphere
shadebooleantrueLit-from-upper-left shading
transparentBackgroundbooleanfalseSkip the ocean fill, for alpha exports

Markers

OptionTypeDefaultDescription
markersMarker[][]See Markers
markerStyle"auto" | "bubble" | "dot""auto"
markerScalenumber1Scales every marker
renderMarkerfunctionNot set(ctx, marker, info) => radius
clusterbooleanfalseMerge nearby markers
clusterRadiusnumber42Cluster grid size in px

Layers

OptionTypeDefaultDescription
arcsArc[][]Great-circle connections
arcLiftnumber0.28Default arc height
arcSpeednumber1Multiplies travel speed
heatmapboolean | objectfalse{ radius, intensity, color }
spikesboolean | objectfalse{ height, width }
labelsboolean | "markers" | "countries" | "both"falseWith collision avoidance
legendobjectNot set{ title, items } or { title, scale, position }
annotationsAnnotation[]Not set[{ lat, lon, text, dx, dy }]
counterobjectNot set{ value, label, format, position }
titleobjectNot set{ text, subtitle, size, color, position }
watermarkobjectNot set{ image, text, height, opacity, position }
timeline{ at }Not setHides markers whose date has not arrived
terminatorbooleanfalseDay/night shading
timeDate | number | nullnullTerminator clock; null tracks now

Countries

OptionTypeDefaultDescription
countryColorsRecord<string,string> | "auto"Not setKeyed by ISO, id or name
countryColor(shape) => stringNot setWins over countryColors
countryKey(shape) => stringNot setKey used against countryColors
countryPalettestring[]Not setFills for countryColors: "auto"
focusstring | FocusSpecNot setFrame one country
countryMediaRecord<string, MediaSource>Not setMedia clipped to outlines

Geometry

OptionTypeDefaultDescription
worldGeoJSON | shape arraybundledReplace the country geometry
texturestring | CanvasImageSourceNot setEquirectangular image on the sphere
textureQuality"auto" | number"auto"Pixel step; higher is faster

The bundled geometry draws India on the Survey of India boundary. See India's boundary.

Viewer

OptionTypeDefaultDescription
showViewerboolean | ShowViewerOptionsfalsePin the current viewer

See Viewer location for the full spec.

Accessibility

OptionTypeDefaultDescription
ariaLabelstring"Interactive world map"Accessible name
respectReducedMotionbooleantrueHonour prefers-reduced-motion

Callbacks

OptionSignature
onHover(marker | null, { x, y } | null) => void
onClick(marker, { x, y }) => void
onCountryHover(country | null, { x, y } | null) => void
onCountryClick(country, { x, y }) => void
onRender(instance) => void: after every frame

See Callbacks for details.

Precedence

When several sources set the same key:

defaults → scene → scene's preset → your preset → your options

Your explicit options always win.