You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: API.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -34,9 +34,9 @@ style | Object | An array of style objects. By default draw provides a style for
34
34
35
35
###`.add(Object: GeoJSONFeature) -> String`
36
36
37
-
This method takes any valid GeoJSON and adds it to Draw. The object will be turned into a GeoJSON feature and will be assigned a unique `id that can be used to identify it. This method return`feature.id`. If an id is provided with the feature that ID will be used.
37
+
This method takes any valid GeoJSON and adds it to Draw. The object will be turned into a GeoJSON feature and will be assigned a unique `id that can be used to identify it. This method returns`feature.id`. If an id is provided with the feature that ID will be used.
38
38
39
-
Draw does not enforce unique IDs to be passed to `.add`, but it does enforce unique ids inside of it. This means that if you provide an id for a feature that is not unqiue, Draw will override the exhisting feature with your new feature. You can think of this like PUT in http verbs.
39
+
Draw does not enforce unique IDs to be passed to `.add`, but it does enforce unique ids inside of it. This means that if you provide an id for a feature that is not unqiue, Draw will override the existing feature with your new feature. You can think of this like PUT in http verbs.
40
40
41
41
If a FeatureCollection is provided to `.add` Draw will break it up into many features as if you looped through the features in the collection and added them one at a time. This is good for bulk adding, though it is no faster than looping yourself.
42
42
@@ -150,7 +150,7 @@ Draw
150
150
151
151
### `.trash() -> Draw`
152
152
153
-
This envokes the current modes trash event. For the `default` mode this deletes all active features. For the `direct_select` mode this deletes the active vertecies. For the draw modes, these cancels the current process.
153
+
This envokes the current modes trash event. For the `default` mode this deletes all active features. For the `direct_select` mode this deletes the active vertices. For the draw modes, these cancel the current process.
154
154
155
155
This is different from `delete` or `deleteAlll` in that it follows rules described by the current mode.
156
156
@@ -211,7 +211,7 @@ This is fired every time a feature is deleted inside of `mapbox-gl-draw`. The pa
211
211
212
212
### draw.active
213
213
214
-
This is fired every time a feature is set to active or inactive. If a feature was active and is then set to active again, this is not fired. Same goes for inactive. This is only fired for features. Not for verticeies.
214
+
This is fired every time a feature is set to active or inactive. If a feature was active and is then set to active again, this is not fired. Same goes for inactive. This is only fired for features. Not for vertices.
215
215
216
216
Here is an example payload.
217
217
@@ -228,9 +228,9 @@ Draw is styled by the [Mapbox GL Style Spec](https://www.mapbox.com/mapbox-gl-st
228
228
229
229
The `GL Style Spec` requires each layer to have a source. **DO NOT PROVIDE THIS** for styling draw.
230
230
231
-
Draw moves features between sources for performence gains, because of this it is recommeneded that you **DO NOT** provide a source for a stlye despite the fact the `GL Style Spec` requires a source. **Draw will provide the source for you automaticlly**.
231
+
Draw moves features between sources for performance gains, because of this it is recommeneded that you **DO NOT** provide a source for a style despite the fact the `GL Style Spec` requires a source. **Draw will provide the source for you automatically**.
232
232
233
-
If you need to stlye gl-draw for debugging sources the source names are `mapbox-gl-draw_hot` and `mapbox-gl-draw_cold`.
233
+
If you need to style gl-draw for debugging sources the source names are `mapbox-gl-draw_hot` and `mapbox-gl-draw_cold`.
0 commit comments