[openlayers] ol.interaction.Draw.createBox() (#16130)

This commit is contained in:
Krzysztof Rzymkowski
2017-04-26 10:04:54 -07:00
committed by Sheetal Nandi
parent 99d153dd1b
commit 0baf4fe3f1
2 changed files with 15 additions and 0 deletions
+9
View File
@@ -5255,6 +5255,15 @@ declare module ol {
*/
extend(feature: ol.Feature): void;
/**
* Create a `geometryFunction` that will create a box-shaped polygon (aligned
* with the coordinate system axes). Use this with the draw interaction and
* `type: 'Circle'` to return a box instead of a circle geometry.
* @return {ol.DrawGeometryFunctionType} Function that draws a box-shaped polygon.
* @api
*/
static createBox(): ol.DrawGeometryFunctionType;
/**
* Create a `geometryFunction` for `mode: 'Circle'` that will create a regular
* polygon with a user specified number of sides and start angle instead of an
+6
View File
@@ -662,6 +662,12 @@ draw = new ol.interaction.Draw({
type: "Point",
style: styleFunctionAsStyle
});
ol.interaction.Draw.createBox();
ol.interaction.Draw.createRegularPolygon();
ol.interaction.Draw.createRegularPolygon(4);
ol.interaction.Draw.createRegularPolygon(4,0);
let styleFunctionAsArray = function(feature: ol.Feature, resolution: number): ol.style.Style[] { return styleArray; }
draw = new ol.interaction.Draw({
type: "Point",