Skip to content

Commit

Permalink
Drop map.fire monkey patch
Browse files Browse the repository at this point in the history
We no longer need this patch since we support both map.fire interfaces in GL JS
  • Loading branch information
stepankuzmin committed Jun 28, 2024
1 parent 415736d commit ca0ee42
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
5 changes: 0 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const minified = MINIFY === 'true';
const outputFile = minified ? 'dist/mapbox-gl-draw.js' : 'dist/mapbox-gl-draw-unminified.js';

import commonjs from '@rollup/plugin-commonjs';
import replace from '@rollup/plugin-replace';
import resolve from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';

Expand All @@ -18,10 +17,6 @@ export default {
},
treeshake: true,
plugins: [
replace({
'process.env.NODE_ENV': "'browser'",
preventAssignment: true
}),
minified ? terser({
ecma: 2020,
module: true,
Expand Down
16 changes: 0 additions & 16 deletions src/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,6 @@ export default function(ctx) {
ctx.events.addEventListeners();
},
onAdd(map) {
if (process.env.NODE_ENV !== 'test') {
// Monkey patch to resolve breaking change to `fire` introduced by
// mapbox-gl-js. See mapbox/mapbox-gl-draw/issues/766.
const _fire = map.fire;
map.fire = function(type, event) {
// eslint-disable-next-line
let args = arguments;

if (_fire.length === 1 && arguments.length !== 1) {
args = [Object.assign({}, { type }, event)];
}

return _fire.apply(map, args);
};
}

ctx.map = map;
ctx.events = events(ctx);
ctx.ui = ui(ctx);
Expand Down

0 comments on commit ca0ee42

Please sign in to comment.