From 4bb4158c7ffcfb63f54d5f242d836c3ebfe67783 Mon Sep 17 00:00:00 2001 From: Krzysztof Rzymkowski Date: Fri, 2 Jun 2017 16:30:21 +0200 Subject: [PATCH] [openlayers] DrawGeometryFunctionType: second argument is optional (#16678) --- types/openlayers/index.d.ts | 2 +- types/openlayers/openlayers-tests.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/types/openlayers/index.d.ts b/types/openlayers/index.d.ts index 577e2f485a..42587298f0 100644 --- a/types/openlayers/index.d.ts +++ b/types/openlayers/index.d.ts @@ -11154,7 +11154,7 @@ declare module ol { * Array.>), ol.geom.SimpleGeometry=): * ol.geom.SimpleGeometry} */ - type DrawGeometryFunctionType = (coords: (ol.Coordinate | ol.Coordinate[] | ol.Coordinate[][]), geo: ol.geom.SimpleGeometry) => ol.geom.SimpleGeometry; + type DrawGeometryFunctionType = (coords: (ol.Coordinate | ol.Coordinate[] | ol.Coordinate[][]), geo?: ol.geom.SimpleGeometry) => ol.geom.SimpleGeometry; /** * A function that takes an {@link ol.MapBrowserEvent} and returns a diff --git a/types/openlayers/openlayers-tests.ts b/types/openlayers/openlayers-tests.ts index de12feeb80..f0abcf28ce 100644 --- a/types/openlayers/openlayers-tests.ts +++ b/types/openlayers/openlayers-tests.ts @@ -19,6 +19,8 @@ let featureStyleFunction: ol.FeatureStyleFunction; let featureLoader: ol.FeatureLoader; let easingFunction: (t: number) => number; let drawGeometryFunction: ol.DrawGeometryFunctionType; +drawGeometryFunction([0,0], new ol.geom.Point([0,0])); +drawGeometryFunction([0,0]); // Type variables for OpenLayers let attribution: ol.Attribution;