This library contains the methods available through the Giraffe SDK.

They can be called in the javascript developer console with a Giraffe project open using eg

gi = await loadGiJs();
gi.setTiles(sourceId, newTiles);

They can also be used in IFrame apps via the postmessage SDK.

import { giraffeState, rpc } from "@gi-nx/iframe-sdk";
rpc.invoke("setTiles", [sourceId, newTiles]);

See layers, projects and project for a list of available methods.

gi data

Iframes can listen to data from the parent Giraffe window. See GiraffeStateEvent in data, which can be used eg:

import { giraffeState, rpc } from "@gi-nx/iframe-sdk";
addListener(['mapContent'], (key: string) => {
console.log('mapContent has changed', giraffeState.get('mapContent'));