Skip to content

Commit

Permalink
Fixes #546, rebind context.dispatch to window.api
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed Feb 2, 2017
1 parent e7cc955 commit 9766a80
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions API.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ which are supported in Chrome & Firefox.
Exposes the [Leaflet.Draw](https://github.com/Leaflet/Leaflet.draw) control Exposes the [Leaflet.Draw](https://github.com/Leaflet/Leaflet.draw) control
instance in the console. instance in the console.


## `window.api.on(event, fn)`

Exposes d3 events, including `change`.

## Protips ## Protips


To include `turf` from [turf](https://github.com/turfjs/turf) so you can manipulate features To include `turf` from [turf](https://github.com/turfjs/turf) so you can manipulate features
Expand Down
2 changes: 2 additions & 0 deletions dist/site.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25840,6 +25840,8 @@ function api(context) {
drawControl: context.drawControl, drawControl: context.drawControl,
data: context.data data: context.data
}; };

d3.rebind(window.api, context.dispatch, 'on');
} }


},{}],144:[function(require,module,exports){ },{}],144:[function(require,module,exports){
Expand Down
2 changes: 2 additions & 0 deletions src/core/api.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ function api(context) {
drawControl: context.drawControl, drawControl: context.drawControl,
data: context.data data: context.data
}; };

d3.rebind(window.api, context.dispatch, 'on');
} }

0 comments on commit 9766a80

Please sign in to comment.