Skip to content

Commit

Permalink
Add example of guides
Browse files Browse the repository at this point in the history
  • Loading branch information
supersonicclay committed Jul 19, 2019
1 parent 31cb022 commit 328f4b6
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions dev-docs/RFCs/v1.0/generic-edit-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,55 @@ A user of this interface will need to call `updateState` anytime the data within

An implementation of a mode is intended to override the `handle...` functions in order to handle user input. The mode can then call the callbacks provided in `ModeState` (e.g. `onEdit`).

### Guides

```js
// Example guides after drawing two points of a line string
// eslint-disable-next-line
const exampleGuides = {
type: 'FeatureCollection',
features: [
// Line string that follows the mouse as it moves
{
type: 'Feature',
properties: {
guideType: 'tentative'
},
geometry: {
type: 'LineString',
coordinates: []
}
},
// Point 0 (first one clicked)
{
type: 'Feature',
properties: {
guideType: 'existingEditHandle',
positionIndexes: [0],
featureIndex: 0
},
geometry: {
type: 'Point',
coordinates: []
}
},
// Point 1 (second one clicked)
{
type: 'Feature',
properties: {
guideType: 'existingEditHandle',
positionIndexes: [1],
featureIndex: 0
},
geometry: {
type: 'Point',
coordinates: []
}
}
]
};
```

## Integration to react-map-gl-draw

TODO
Expand Down

0 comments on commit 328f4b6

Please sign in to comment.