Skip to content

Commit

Permalink
Version Packages (#19)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Sep 7, 2024
1 parent 4d9a435 commit 8d4bff6
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 51 deletions.
34 changes: 0 additions & 34 deletions .changeset/gorgeous-lions-cross.md

This file was deleted.

16 changes: 0 additions & 16 deletions .changeset/sixty-chairs-walk.md

This file was deleted.

48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
# @watergis/maplibre-gl-terradraw

## 0.1.0

### Minor Changes

- 4d9a435: feat: allows to overwrite default Terra Draw mode instances by using the second argument of constructor.

For example, if you only want to use polygon control, and you want to disable draggable option and node insertion/deletion on an edge of a polygon, the setting can be as follows.

```ts
const drawControl = new MaplibreTerradrawControl(
{
modes: ['polygon', 'select']
},
{
select: new TerraDrawSelectMode({
flags: {
polygon: {
feature: {
draggable: false, // users cannot drag to move polygon
rotateable: true,
scaleable: true,
coordinates: {
midpoints: false, // users cannot add a node on the middle of edge.
draggable: true,
deletable: false // users cannot delete a node.
}
}
}
}
})
}
);
map.addControl(drawControl, 'top-left');
```

- 4d9a435: feat: allows to change the order of Terra Draw modes on the plugin.

Now, an array of modes can be passed to the constructor of the plugin, and the mode controls will be added exactly the same order. You can also remove unnecessary modes from the array when you initialize the plugin.

For instance, you can only add point and select control on the plugin like the below code.

```ts
const drawControl = new MaplibreTerradrawControl({
modes: ['point', 'select']
});
map.addControl(drawControl, 'top-left');
```

## 0.0.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@watergis/maplibre-gl-terradraw",
"version": "0.0.6",
"version": "0.1.0",
"description": "This plugin is to add controls to your Maplibre for drawing powered by Terra Draw library.",
"type": "module",
"main": "dist/maplibre-gl-terradraw.umd.js",
Expand Down

0 comments on commit 8d4bff6

Please sign in to comment.