gi-nx / getLassoShape
ts
function getLassoShape(): Promise<{
geometry: | {
coordinates: [number, number];
type: "Point";
}
| {
coordinates: [number, number][];
type: "LineString";
}
| {
coordinates: [number, number][][];
type: "Polygon";
};
properties: Record<string, any>;
type: "Feature";
}>;Prompt the user to draw a freehand lasso shape on the map. Disables the current draw tool and waits for user input.
Returns
Promise<{ geometry: | { coordinates: [number, number]; type: "Point"; } | { coordinates: [number, number][]; type: "LineString"; } | { coordinates: [number, number][][]; type: "Polygon"; }; properties: Record<string, any>; type: "Feature"; }>
Example
typescript
const lassoShape = await rpc.invoke("getLassoShape", []);
console.log("Lasso coordinates:", lassoShape.geometry.coordinates);