Skip to content

worldwind-ui API / react-worldwind / useDrawTool

Function: useDrawTool() ​

useDrawTool(options?): UseDrawToolResult

Defined in: react/src/hooks.ts:352

A drawing and editing tool bound to the globe for the component's lifetime.

Parameters ​

options? ​

DrawToolOptions = {}

Returns ​

UseDrawToolResult

Example ​

tsx
const { state, start, toGeoJson } = useDrawTool();
return <button onClick={() => start('polygon')}>Draw ({state.features.length})</button>;

MIT licensed. Not affiliated with NASA; WorldWind is NASA's open-source virtual globe.