Skip to content

Commit

Permalink
add drag support to direct_select
Browse files Browse the repository at this point in the history
  • Loading branch information
mcwhittemore committed Nov 17, 2016
1 parent 9bdb9a1 commit 2a873a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dist/mapbox-gl-draw.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/modes/direct_select.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ module.exports = function(ctx, opts) {

const onVertex = function(e) {
startDragging(e);
ctx.ui.queueMapClasses({ mouse: Constants.cursors.MOVE });
const about = e.featureTarget.properties;
const selectedIndex = selectedCoordPaths.indexOf(about.coord_path);
if (!isShiftDown(e) && selectedIndex === -1) {
Expand All @@ -74,6 +75,7 @@ module.exports = function(ctx, opts) {
};

const onFeature = function(e) {
ctx.ui.queueMapClasses({ mouse: Constants.cursors.MOVE });
if (selectedCoordPaths.length === 0) startDragging(e);
else stopDragging();
};
Expand Down

0 comments on commit 2a873a7

Please sign in to comment.