Skip to content

GeoMap

Defined in: map/geo-map.ts:60

  • BaseEngine

new GeoMap(host, opts): GeoMap

Defined in: map/geo-map.ts:72

HTMLElement

GeoMapOptions

GeoMap

BaseEngine.constructor

clearStyle(name, ids?): this

Defined in: map/base-engine.ts:504

Remove overrides (all of the layer’s when ids is omitted) and restore base styles.

string

string | number | readonly (string | number)[]

this

BaseEngine.clearStyle


destroy(): void

Defined in: map/base-engine.ts:893

void

BaseEngine.destroy


disableInteraction(): this

Defined in: map/base-engine.ts:707

Detach the current pan/zoom or rotation interaction (no-op if none).

this

BaseEngine.disableInteraction


enableRotation(opts?): this

Defined in: map/geo-map.ts:243

Drag to trackball-rotate a spherical projection; wheel to scale it. Re-projects on the CPU per frame and pushes the result to whatever backend is live, so every backend (canvas, svg, webgl) renders the identical crisp vector geometry. Layers flagged hideOnInteraction are hidden mid-gesture so dense data needn’t re-project per frame. (A GPU-side shader-projected globe — no per-frame CPU reprojection — is a possible future optimization; the backend retains dormant globe-rendering support.)

RotationOptions = {}

this


enableZoom(extent?, onTransform?): this

Defined in: map/geo-map.ts:224

One entry point for both projection kinds: a spherical (azimuthal) projection gets versor rotation (drag) + wheel-zoom bounded by extent; a flat projection gets d3-zoom affine pan/zoom. extent sets the zoom limits for both. Backend-agnostic: every backend renders the same per-frame-reprojected geometry, so a backend swap needs no re-dispatch (the interaction listeners and projection state are unaffected by it).

[number, number] = ...

(t) => void

this

BaseEngine.enableZoom


highlight(name, idOrIds, styleOrDraw?): this

Defined in: map/base-engine.ts:554

Highlight one drawable / a set of drawables of name by drawing them into a tiny internal overlay layer on top (inheriting the source’s clipTo/sizeMode) — the base layer’s buffers are untouched, so the per-change cost is tessellating the highlighted items only. styleOrDraw falls back to the layer’s hover option, then to the default white outline. null clears.

string

string | number | readonly (string | number)[] | null

HighlightStyle | HighlightDraw

this

BaseEngine.highlight


layer<F>(name, features, opts?): LayerHandle<F>

Defined in: map/geo-map.ts:128

F

string

F | readonly F[] | (() => readonly F[])

LayerOptions<F> = {}

LayerHandle<F>


on(event, cb): this

Defined in: map/base-engine.ts:856

"click" | "hover"

(hit, ev) => void

this

BaseEngine.on


pick(x, y): HoverHit | null

Defined in: map/base-engine.ts:870

number

number

HoverHit | null

BaseEngine.pick


recolor(name): this

Defined in: map/base-engine.ts:477

string

this

BaseEngine.recolor


render(): this

Defined in: map/base-engine.ts:890

this

BaseEngine.render


select(name, set): this

Defined in: map/base-engine.ts:525

Select a set of drawables: style members with the layer’s selection.selected (default: keep base style) and the complement with selection.others (default { opacity: 0.3 }). One O(n) compose + one styles-only push — click-time cost only, nothing per frame. null clears. NOTE: selection rewrites the layer’s whole override map, so it replaces earlier setStyle overrides (one table, last write wins) — and select(null) restores plain base styles.

string

readonly (string | number)[] | ((d, i) => boolean) | null

this

BaseEngine.select


setBackend(type): this

Defined in: map/base-engine.ts:700

BackendType

this

BaseEngine.setBackend


setClip(name, clipTo?): this

Defined in: map/base-engine.ts:685

string

string

this

BaseEngine.setClip


setProjection(projection): this

Defined in: map/geo-map.ts:208

Swap the projection on the existing map: re-project every layer once and reset the affine view to identity (the caller fits the new projection).

GeoProjection

this


setSize(width, height): this

Defined in: map/base-engine.ts:274

Resize the engine in place to a new CSS size (px) — no teardown. Resizes the live backend, runs the subclass onResize hook (e.g. GeoMap refits its projection), then re-renders and repaints pass-through layers. Layers, view transform, and interaction state are preserved. A no-op when the size is unchanged or either axis is zero (a collapsed/hidden layout). In responsive modes the ResizeObserver calls this automatically; callers in fixed mode use it to apply a new explicit size without recreating the engine.

number

number

this

BaseEngine.setSize


setStyle(name, ids, override): this

Defined in: map/base-engine.ts:491

Override the style of one drawable or a set (replaces any previous override for those ids — last write wins). O(ids) compose + one styles-only push.

string

string | number | readonly (string | number)[]

StyleOverride

this

BaseEngine.setStyle


setTransform(t): this

Defined in: map/base-engine.ts:748

ViewTransform

this

BaseEngine.setTransform


toPNG(): string

Defined in: map/base-engine.ts:892

string

BaseEngine.toPNG


toSVG(): string

Defined in: map/base-engine.ts:891

string

BaseEngine.toSVG


whenReady(): Promise<void>

Defined in: map/base-engine.ts:294

Promise<void>

BaseEngine.whenReady