Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Xintong Xia committed Jun 28, 2019
1 parent 2275ee7 commit 3998465
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/react-map-gl-draw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"start": "webpack-dev-server --progress --hot --open",
"start-local": "webpack-dev-server --env.local --progress --hot --open",
"build-clean": "rm -rf ./dist && mkdir dist",
"build-static": "cp -r ./src/static dist/",
"build-static": "cp -r ./static dist/",
"build-script": "webpack -p --env.prod",
"build": "node scripts/validate-token.js && npm run build-clean && npm run build-static && npm run build-script"
},
Expand Down
12 changes: 4 additions & 8 deletions modules/react-map-gl-draw/src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,7 @@ export default class Editor extends PureComponent<EditorProps, EditorState> {
const elem = evt.target;

if (this._isVertex(elem)) {
// eslint-disable-next-line no-unused-vars
const [elemType, featureIndex, vertexIndex] = elem.id.split('.');
const [, , vertexIndex] = elem.id.split('.');
this.setState({
draggingVertexIndex: Number(vertexIndex),
startDragPos: { x, y },
Expand Down Expand Up @@ -399,8 +398,7 @@ export default class Editor extends PureComponent<EditorProps, EditorState> {
selectedFeature.renderType === RENDER_TYPE.POLYGON) &&
this._isLine(elem)
) {
// eslint-disable-next-line no-unused-vars
const [elemType, featureIndex, segmentId] = elem.id.split('.');
const [, , segmentId] = elem.id.split('.');
this.setState({
hoveredSegmentId: Number(segmentId),
uncommittedLngLat: lngLat
Expand Down Expand Up @@ -456,8 +454,7 @@ export default class Editor extends PureComponent<EditorProps, EditorState> {
_onClickVertex = (evt: MjolnirEvent) => {
const { mode } = this.props;
const elem = evt.target;
// eslint-disable-next-line no-unused-vars
const [elemType, featureIndex, vertexId, operation] = elem.id.split('.');
const [, , , operation] = elem.id.split('.');
if (
operation === OPERATIONS.INTERSECT ||
(operation === OPERATIONS.SET && mode === MODES.DRAW_RECTANGLE)
Expand All @@ -477,8 +474,7 @@ export default class Editor extends PureComponent<EditorProps, EditorState> {
feature.renderType === RENDER_TYPE.LINE_STRING) &&
elem
) {
// eslint-disable-next-line no-unused-vars
const [elemType, featureIndex, segmentId] = elem.id.split('.');
const [, , segmentId] = elem.id.split('.');
const [index] = segmentId.split('-');

const { x, y } = this._getEventPosition(evt);
Expand Down

0 comments on commit 3998465

Please sign in to comment.