- update mapbox-gl peer dependency
- add unminified build
- clear draw classes on remove (#785)
- don't run render on unused event handlers (#783)
- Remove overridden/dupe onMouseUp in SimpleSelect (#816)
- Include userProperties in Options section of docs (#817)
- change ordering of spy creation to avoid overwrites (#839)
- Fix a bug where GeoJSON features with numeric ids would not rerender correctly #769.
- Patch
map.fire
to support function signature changes in Mapbox GL JS 0.45.0 #772.
- Handle early control removal by canceling connect and checking for sources/layers #685 via @gpbmike
- Race condition loading shapes #749 via nigelsim
- Fixes bug where event.srcElement is not defined in Firefox #752 via @pastcompute
- update browserify to version 15.0.0 #731
- update babel-eslint to version 8.0.3 #715
- update @turf/centroid to version 6.0.0 #747
- Fixes bug where map interaction setting were oven written by Draw even after Draw was removed (#696 via @alexgleith)
- Updated readme to include
import
syntax (#706 via @thiagoxvo)
- Adds support for [email protected] (#700 via @mike-marcacci)
- Uses
@mapbox
-namespaced packages for geojson-extent and point-geometry. (#700 via @mike-marcacci) - Bump sinon@^4.0.0 and babelify@^8.0.0 versions
- Fixes double click when drawing a line or polygon crashing bug (#680 via @AliceR)
- Adds support for [email protected]
- Adds support for [email protected]
- Moves some of the doc files around which fixes a bug with webpack (#675)
- Adds Custom Mode support
- Drops
static
mode, which can now be found in its own repo - Fixes bug where
MapboxDraw
would preventMapboxGeocoder
delete actions (#673)
- Fixes bug with safari where the map would move when drawing (#665).
- Improves mobile data support (thanks @z0d14c)
- Adds support for [email protected]
- Fixes bug with draw controls adding
false
to the tooltip when keybinding are turned off
- Add support for [email protected]
- Fix empty dist/mapbox-gl-draw.js file
- Fix bug where selected points that are moved would still return the same coordinates
- Adds support for continuing lines via
draw.changeMode
.
- Fixes bug where IE11 failed because it lacks
Array.find
. - Adds support for mapbox-gl-js 0.29.x.
- Uses
@mapbox
-namespaced packages for dependencies.
- Changes
mapboxglDraw
toMapboxDraw
to match other control names. - Changes
MapboxDraw()
tonew MapboxDraw()
to match other control interfaces. - Provides clearer icon support for drag feature in
direct_select
.
- Adds support for
[email protected]
. - Adds
Draw.setFeatureProperty(string, string, any)
. - Adds
mapboxglDraw({userProperties: boolean})
to add user properties to the data rendered by Draw. - Fixes bug where Draw would fail to attach to mapbox-gl-js if added while a style was loading.
- Fixes bug where Firefox would treat all mousemove events as drag events.
- Requires [email protected].
- Detects style changes and reapplies Draw if it has been removed.
- Fixes UMD support.
- Changes
mapboxgl.Draw
tomapboxglDraw
when in global scope.
- Removes deprecated
interactive
property from styles.
- Fixes a when where
draw.actionable
would fail to fire ontrash
if there were no features left. - Fixes a bug where
trash
moves Draw fromdirect_select
tosimple_select
.
- Adds
draw.actionable
as a way to track ifDraw.trash
,Draw.combineFeatures
andDraw.uncombineFeatuers
are actionable.
- Add support for mapbox-gl-js 0.26.x
- Fix bug that broke editing MultiFeatures in
direct_select
mode after using the combine feature
- Adds support for combining features into multi-features
- Adds support for uncombing multi-fetaures into features
- Upgrade mapbox-gl dependency
- Fix bug causing problems when selecting features at tile intersections.
- Fix bug with MultiLineString
- Upgrade mapbox-gl dependency
- Fix geojsonhint error filtering.
- Use geojsonhint version 2.0.0beta
- Fix bug causing render update with firing
draw.update
event when mouse leaves map container.
- Fix bug caused by
render
calling itself synchronously, side-stepping the throttle and possibly emitting the same deleted features twice.
- Add support for mapbox-gl 0.21
- Add
draw.select
anddraw.deselect
, replacingdraw.mode.simple_select.selected.*
events. - Add
Draw.getSelectedIds()
.
- Fixes bug with
draw.modified
and point creation - Prevents
draw.modifed
from emitting deleted features
- Fix bug causing deleted features to not always be deselected.
- Update default theme
- Waits for mouse events until the map has loaded
- Emits all changes to feautres all valid
- Draw now supports MultiPoint, MultiLineString and MultiPolygon geojson feature types.
- Allow use of [email protected]
- Fix mouse cursors when Draw is created before the map is available
- Fix Draw.add when adding a feature that already exhists
- Ensure keybindings option is enforced
- Major speed improvement while drawing
- Removes displaying polygons and lines as points when they are very small
- Draw.add now runs geojsonhint on provided features to confirm they are valid geojson
- Draw.add now doesn't add any features to the map if one provided has an error
- It used to be possible to trick Draw into thinking you were dragging when you meant to be clicking. This also helps not move the map while clicking rather than dragging.
- Moved to size bassed selection. This means the smallest feature is selected first. Points, than LineStrings, than Polygons where polygons are selected in order of their area.
- Upgrade to mapbox-gl-js-mock v0.18
- Upgrade to Mapbox GL JS v0.18
- When moving from a drawing mode to simple select, select the new feature
- Fix custom styling
- Draw.add now updates the stored properties of a feature
- Draw no longer emits features that are invalid as changed
- polygons and lines that are too small to see now show up as points
Upgrade to Mapbox GL JS v0.17
Cursors can now be set via css classes. Default cursor options have been added. This restores the long standing issue of hover cursors not working.
Moving from simple_select to direct_select can now be done by selecting a vertex in simple_select mode.
Bug fix for control position options thanks to @nsamala.
Fresh new style. Better selection ability for lines. Double click to end drawing a line.
draw.changed
has been updated to emit an object {features: []}
and to only emit when something has changed and is in a valid state.
This is a preview release of the work being done in the 0.6.0 milestone.
We are skipping 0.5.0 as this change is very large and breaks much of the Draw API functionality.
To preview this release please take a look API.md to get started. Feedback is very welcome and is generally being collected here.
- Name space css. If you are not using the provided CSS, update your own css to match the new naming schemes.
- displayControlsDefault lets a you change the default option for displaying controls from true to false
- fixed bug where
update
didn't render changes - fixed bug where drag events that shouldn't drag the map still would due to a featuresAt race condition
- Performance improvements
- Supports [email protected]
- Cleans up event listeners on Draw.remove
Lets shift select work again
Fixes a bug where calling Draw.add
on a FeatureCollection
resulted in an error.
Fixes a bug where calling Draw.deselect
in a draw.delete
event handler would emit a draw.set
event even though the feature had been removed from Draw.
Fixes bug where drawing: false
in the config would throw an error in the trash can control logic.
Expands support to [email protected]
- When editing a feature, clicking on a node will delete it
- When creating a feature, escape ends drawing and deletes the features. No events are fired.
- When editing a feature, escape reverts changes to what the feature looked like when editing started
- Fixed bug where the trash can would show up when zooming via the zoom box.
- Fixed bug where starting a new feature before finishing an old feature would save the old feature even if it was invalid
startDrawing
lets you initiate drawing with your controls.- The controls object now accepts
trash
letting you hide the trash control
Ships dist/mapbox-gl-draw.js
to npm even though it is not committed.
- drawId was leaked to props in the minor bump, this was a mistake
- Features added via Draw.add had to be selected twice
- Square now acts as a macro for square polygons. Before a square feature had to always be a square feature while it was in side of draw, but could be edited outside.
- Square now works as a two click tool, dropping support for click-drag-release.
- draw.select.start and draw.select.end don't fire in the creation phase of a feature
- draw.set is only fired when the feature has been completed
- Default draw styles, conform to the mapbox-gl-style-spec
- Points now appear pink when selected using the default style
- Clicking the trash can while creating a feature, concludes the drawing
- Users are able to drag the under lying map while drawing
- Works with [email protected]
- Renamed
Draw.remove
toDraw.destroy
Draw.remove
now removes Mapbox-GL-Draw from your map
Fixes publish process so the distribution is kept up to date
Fixes bug with Draw.add that was making new features not render
- Renamed style theme for selected features. Was
gl-edit-{feature}
, nowgl-draw-selected-{feature}
. - Renamed
Draw.set
method toDraw.add
. - Renamed
Draw.getEditing
method toDraw.getSelected
. - Renamed
draw.select
event todraw.select.start
. - Renamed
draw.deselect
event todraw.select.end
.
- Added 4 selection methods:
Draw.select
,Draw.selectAll
,Draw.deselect
, andDraw.deselectAll
. - Draw.add treats feature.id as its internal id so you can use external ids with Draw.get