Merge pull request #19823 from Namue/master

Added minArea to @types/openlayers DragBoxOptions
This commit is contained in:
Benjamin Lichtman
2017-09-19 11:05:44 -07:00
committed by GitHub
2 changed files with 3 additions and 0 deletions

View File

@@ -12436,11 +12436,13 @@ declare module olx {
/**
* @typedef {{className: (string|undefined),
* condition: (ol.EventsConditionType|undefined),
* minArea: (number|undefined),
* boxEndCondition: (ol.DragBoxEndConditionType|undefined)}}
*/
interface DragBoxOptions {
className?: string;
condition?: ol.EventsConditionType;
minArea?: number;
boxEndCondition?: ol.DragBoxEndConditionType;
}

View File

@@ -695,6 +695,7 @@ draw = new ol.interaction.Draw({
let dragbox: ol.interaction.DragBox = new ol.interaction.DragBox({
className: stringValue,
minArea: 10,
condition: ol.events.condition.always,
boxEndCondition: function (mapBrowserEvent: ol.MapBrowserEvent, startPixel: ol.Pixel, endPixel: ol.Pixel) {
let width: number = endPixel[0] - startPixel[0];