map.buildGeoPositionProvider
buildGeoPositionProvider(options: BuildGeoPositionProviderOptions): BuildGeoPositionProviderResultBuild a StaticPositionProvider mapping each node to a world position derived from its lat/lng properties — without touching any engine state.
This is a pure utility: no provider swap, no node hiding, no events,
no command execution. Callers that swap the store's position provider
(instead of mutating the in-place layout) — e.g. the Kineviz platform's
GeoNodeEdgeBridge — use this to build the new provider, then decide
for themselves when to attach it and how to handle non-geo nodes.
Conventions match the engine's globe / flat-map surface:
- spherical: polar2Cartesian with the supplied
globeRadius - planar: SlippyMapFlat with the supplied
mapSize
options | BuildGeoPositionProviderOptions |
Returns: BuildGeoPositionProviderResult
Example
const { provider, nonGeoNodeIds } = api.map.buildGeoPositionProvider({
mode: "spherical",
globeRadius: 5,
});
if (provider) store.setPositionProvider(provider);
// optionally:
// await api.nodes.hide(nonGeoNodeIds);