Skip to content

Commit

Permalink
docs(terra-draw): correct guidance around using updateModeOptions (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesLMilner authored Feb 25, 2025
1 parent 0a20718 commit cf0099f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions guides/5.STYLING.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ The `TerraDrawSensorMode` is styled using the following properties:

## Dynamically Changing Styling

You can update styles after a mode has been initialised using the `setModeOptions` method, which takes a `styles` object. This can be done like so:
You can update styles after a mode has been initialised using the `updateModeOptions` method, which takes a `styles` object. This can be done like so:

```typescript
const draw = new TerraDraw({
Expand All @@ -179,7 +179,7 @@ const draw = new TerraDraw({

// Later on...

draw.setModeOptions<typeof TerraDrawPolygonMode>('polygon', {
draw.updateModeOptions<typeof TerraDrawPolygonMode>('polygon', {
// We can pass in a partial styles object and it will just update the fields passed
styles: {
fillColor: "#b3250a",
Expand All @@ -188,7 +188,7 @@ draw.setModeOptions<typeof TerraDrawPolygonMode>('polygon', {
})
```

This will tigger a `styling` change event, which can be listened to like so:
This will trigger a `styling` change event, which can be listened to like so:

```typescript
draw.on('change', (ids, type) => {
Expand Down

0 comments on commit cf0099f

Please sign in to comment.