-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introductie polygoon teken actie (#34)
- Loading branch information
Showing
11 changed files
with
67 additions
and
33 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import {VlDrawAction} from './vl-mapactions-draw-action'; | ||
import GeometryType from 'ol/geom/GeometryType'; | ||
|
||
export class VlDrawPolygonAction extends VlDrawAction { | ||
constructor(layer, onDraw, options = {}) { | ||
super(layer, GeometryType.POLYGON, onDraw, options); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import sinon from 'sinon/pkg/sinon-esm'; | ||
import {expect} from 'chai'; | ||
import {Vector as SourceVector} from 'ol/source'; | ||
import {VlDrawPolygonAction} from '../../src/vl-mapactions-draw-polygon-action'; | ||
|
||
describe('draw polygon action', () => { | ||
const source = new SourceVector({}); | ||
|
||
const layer = { | ||
getSource: () => { | ||
return source; | ||
}, | ||
}; | ||
|
||
const callback = sinon.spy(); | ||
|
||
it('geeft de snapping configuratie door aan de draw action', () => { | ||
const snappingLayer = sinon.spy(); | ||
const snapping = { | ||
layer: snappingLayer, | ||
}; | ||
const action = new VlDrawPolygonAction(layer, callback, snapping); | ||
expect(action.options.layer).to.deep.equal(snappingLayer); | ||
}); | ||
|
||
it('geeft de juiste configuratie mee aan de draw interaction', () => { | ||
const action = new VlDrawPolygonAction(layer, callback); | ||
expect(action.options).to.deep.equal(action.options); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters