Ability to specify geometryName on ol.interaction.Draw

This commit is contained in:
Bart van den Eijnden
2014-05-13 19:36:36 +02:00
parent 86013c3a78
commit 945f5008f5
3 changed files with 43 additions and 2 deletions

View File

@@ -69,6 +69,28 @@ describe('ol.interaction.Draw', function() {
});
describe('specifying a geometryName', function() {
beforeEach(function() {
var draw = new ol.interaction.Draw({
source: source,
geometryName: 'the_geom',
type: ol.geom.GeometryType.POINT
});
map.addInteraction(draw);
});
it('creates a feature with the correct geometryName', function() {
simulateEvent('pointermove', 10, 20);
simulateEvent('pointerdown', 10, 20);
simulateEvent('pointerup', 10, 20);
var features = source.getFeatures();
var geometry = features[0].getGeometry();
expect(features[0].getGeometryName()).to.equal('the_geom');
expect(geometry).to.be.a(ol.geom.Point);
});
});
describe('drawing points', function() {
var draw;