Upgrade Guide
Latest stable releases:
| Package | Version |
|---|---|
@gi-nx/iframe-sdk | 0.0.15 |
@gi-nx/iframe-sdk-react | 0.0.10 |
@gi-nx/mini-iframe-rpc | 0.0.5 |
How to upgrade
sh
npm install @gi-nx/iframe-sdk@^0.0.15
# React apps
npm install @gi-nx/iframe-sdk-react@^0.0.10@gi-nx/mini-iframe-rpc is a transitive dependency and updates automatically. If your app depends on it directly, bump it to ^0.0.5.
There are no runtime breaking changes: the postMessage protocol is unchanged, so apps built against @gi-nx/iframe-sdk 0.0.13 keep working. This release includes bugfixes and performance improvements as well as the getProjector() function. New functions added to the SDK in Giraffe app releases do not require a Iframe SDK update.
New: getProjector()
Convert between geographic coordinates ([lng, lat]) and local metric coordinates ([x, y] metres from the project origin), using the same projection as the Giraffe engine — results exactly match computed properties like area and _height.
ts
import { getProjector } from '@gi-nx/iframe-sdk';
const proj = getProjector();
if (proj) {
const [x, y] = proj.forward([151.2093, -33.8688]);
const [lng, lat] = proj.inverse([x + 100, y]); // 100m east
}