From 4c1e6bfd169b0daeb85271f14bc277caf1c67a8d Mon Sep 17 00:00:00 2001 From: cw882 Date: Tue, 28 Jun 2016 11:31:13 +0100 Subject: [PATCH 1/2] Update openlayers.d.ts Added StaticImageOptions and ZoomToExtentOptions. Updated the classes to require the option types. --- openlayers/openlayers.d.ts | 47 +++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index fafaaa186b..ebdb27d979 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -4,7 +4,50 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace olx { +interface StaticImageOptions { + /** Attributions */ + attributions?: Array + + /*** The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. */ + crossOrigin?: string + + /*** Extent of the image in map coordinates. This is the [left, bottom, right, top] map coordinates of your image.*/ + imageExtent: ol.Extent; + + /*** Size of the image in pixels.*/ + imageSize?: ol.Size; + + /*** experimental Optional function to load an image given a URL.*/ + imageLoadFunction?: ol.TileLoadFunctionType; + + /*** Optional logo.*/ + logo?: olx.LogoOptions; + + /*** experimental Projection.*/ + projection: ol.proj.Projection; + + /*** Image URL.*/ + url: string; + } + + interface ZoomToExtentOptions { + /*** Class name. Default is ol-zoom-extent.*/ + className?: string; + + /*** Target.*/ + target?: Element; + + /*** Text label to use for the button. Default is E. Instead of text, also a Node (e.g. a span element) can be used.*/ + label?: string | Node; + + /*** Text label to use for the button tip. Default is Zoom to extent.*/ + tipLabel?: string; + + /*** The extent to zoom to. If undefined the validity extent of the view projection is used.*/ + extent: ol.Extent; + } + interface AttributionOptions { /** HTML markup for this attribution. */ @@ -2376,6 +2419,7 @@ declare namespace ol { } class ZoomToExtent { + constructor(options?: olx.ZoomToExtentOptions); } } @@ -4109,7 +4153,8 @@ declare namespace ol { class ImageMapGuide extends Image { } - class ImageStatic extends Image { + class ImageStatic extends ol.source.Image { + constructor(options?: olx.StaticImageOptions); } class ImageVector extends ImageCanvas { From 1eba4008703b9338fde6096645b7a2ff93df10cb Mon Sep 17 00:00:00 2001 From: cw882 Date: Tue, 28 Jun 2016 11:37:25 +0100 Subject: [PATCH 2/2] Update openlayers.d.ts Formatting change --- openlayers/openlayers.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index ebdb27d979..270876f440 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace olx { -interface StaticImageOptions { + interface StaticImageOptions { /** Attributions */ attributions?: Array