Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhicks committed Jan 30, 2025
1 parent 888a0c8 commit df50c27
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/Tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

The Tools part allows you to let users draw elements on the map.

## Example

```ts
// Change the settings for the line tool
felt.setToolSettings({
tool: "line",
strokeWidth: 8,
color: "#448C2A"
});

// Start using the line tool
felt.setTool("line");

// Put down the tool
felt.setTool(null);
```

## Interfaces

* [PinToolSettings](PinToolSettings.md)
Expand Down
16 changes: 16 additions & 0 deletions src/modules/tools/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
/**
* The Tools part allows you to let users draw elements on the map.
*
* @example
* ```ts
* // Change the settings for the line tool
* felt.setToolSettings({
* tool: "line",
* strokeWidth: 8,
* color: "#448C2A"
* });
*
* // Start using the line tool
* felt.setTool("line");
*
* // Put down the tool
* felt.setTool(null);
* ```
*
* @module Tools
*/
export type {
Expand Down

0 comments on commit df50c27

Please sign in to comment.