@remix/mapbox-gl-draw
Advanced tools
Comparing version 1.4.2 to 1.4.3
{ | ||
"name": "@remix/mapbox-gl-draw", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"description": "A drawing component for Mapbox GL JS", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/remix/mapbox-gl-draw", |
@@ -187,3 +187,11 @@ const setupModeHandler = require('./lib/mode_handler'); | ||
function changeMode(modename, nextModeOptions, eventOptions = {}) { | ||
if (ctx.map === null) { | ||
// It is possible that the control unloaded already | ||
return; | ||
} | ||
currentMode.stop(); | ||
if (ctx.map === null) { | ||
// It is possible that the control unloaded after stopping the current mode | ||
return; | ||
} | ||
@@ -190,0 +198,0 @@ const modebuilder = modes[modename]; |
@@ -41,2 +41,6 @@ | ||
handle.fn.call(ctx, event); | ||
if (DrawContext.map === null) { | ||
// It is possible that the control unloaded due to the handler | ||
return; | ||
} | ||
DrawContext.store.render(); | ||
@@ -43,0 +47,0 @@ DrawContext.ui.updateMapClasses(); |
@@ -59,2 +59,4 @@ const CommonSelectors = require('../lib/common_selectors'); | ||
DrawPolygon.onTap = DrawPolygon.onClick = function(state, e) { | ||
// While in draw mode, a click always does something, so we mark it as handled | ||
e.srcEvent.handledByMapboxGlDraw = true; | ||
if (CommonSelectors.isVertex(e)) return this.clickOnVertex(state, e); | ||
@@ -61,0 +63,0 @@ return this.clickAnywhere(state, e); |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3344125
50387
6