Commit Graph
25 Commits
Author SHA1 Message Date
William Wall b8addb4c24 Fix missing method declaration
ol/renderer/vector was using the abstract ReplayGroup type while
referencing replayGroup.addDeclutter(), which was only defined
on the canvas and webgl implementations and was also defined
differently.
2018-10-03 16:08:26 -06:00
William Wall 8be23b799d Fix getSimplifiedGeometry definition
The override here should match the definition in ol/geom/Geometry
2018-10-03 15:23:10 -06:00
William Wall 2517b838b6 Fix type check for ol/events
Cast to ol/events/Target since the function declarations only match
between EventTarget and Target for the first two parameters.
2018-10-01 14:02:12 -06:00
William Wall 9fc8475586 Fix type check in ol/PluggableMap.js
- Added JSDoc to getRenderer()
- Cast default options to types
- Cast event to MouseEvent to satisfy tsc. Non mouse/touch events
  will simply produce [NaN, NaN]
- Cast to Layer before calling getSource(), as it does not exist
  on Base
2018-10-01 12:49:47 -06:00
William Wall 831505c425 Fix type check in ol/math
tsc considers everything in the else block to be of type 'never',
since it thinks that cosh is permanently defined for Math. Casting
back to Math in the else block fixes the error.
2018-09-29 16:40:15 -06:00
William Wall a685e85c10 Fix type checks in VectorTileSource
Use typeof(Class) instead of defining a typedef for the tile class
2018-09-28 12:33:33 -06:00
William Wall 0bbbd33bb1 Fix type check in Raster source 2018-09-28 09:38:33 -06:00
William Wall 4da372d515 Fix type checks in Vector source
The getResolutions override is unnecessary because the parent
implementation also returns undefined.
2018-09-28 09:24:55 -06:00
William Wall 1ee0c50c8a Fix type check in ol/source/Tile
Remove 'extent' because the parent Source class does not contain
'extent' on its options or use options.extent in the constructor.
Also removed 'extent' from 'Options' for 'TileSource'.
2018-09-27 10:47:51 -06:00
William Wall d37e04e8f3 Fix type checks in ImageArcGISRest
Added proper @link tags to links in descriptions. Fixed unclosed
backtick. Made params optional like the description says.
2018-09-25 14:00:23 -06:00
William Wall 3ba789eae6 Fix type checks in ImageCanvas source
Fixed constructor docs specifying optional options without a
default value. Fixed malformed @link tag in typedef description.
canvasFunction type was previously declared with the 'this' type
as ImageCanvas, but the 'this' ref was not passed on the scope when
calling the function.
2018-09-25 13:01:02 -06:00
William Wall 1c10bbf94c Fix arithmetic error on potential array
And also add zoomMax to response type
2018-09-21 11:57:25 -06:00
William Wall 1da2db83da Fix type check errors for Image source
The parent class does not accept an extent on its options. Also
check that the image is an img or video tag before setting the
source as Canvas does not have the src property.
2018-09-21 08:35:41 -06:00
William Wall 10c8371b38 Type check fixes for Cluster source
Removed options unused by super class.
2018-09-21 08:21:20 -06:00
William Wall 82cfa54584 Fix type checks in CartoDB
Removed state from super call options because super doesn't use it.
Defined CartoDBLayerInfo response type.
2018-09-21 08:00:45 -06:00
William Wall fd0d6ff6f6 Define BingMapsImageryMetadataResponse type 2018-09-20 16:25:48 -06:00
William Wall 7ff974be2c Remove superfluous bitwise operations 2018-09-20 10:27:13 -06:00
William Wall 016436ae18 Check that tile is ImageTile before using it 2018-09-19 15:04:14 -06:00
William Wall 7525c57688 Check the type of the source before using it
This satisfies tsc in addition to making the class more defensive
against source types that it does not support.
2018-09-19 14:39:10 -06:00
William Wall a4aaab5e32 Change bitwise or assignment to boolean assignment
Because `tsc` does not like using bitwise operations on booleans.
2018-09-19 13:00:55 -06:00
William Wall adfc174af3 Ensure image is Image or Video before settings src
Canvas elements do not contain the 'src' property.
2018-09-19 12:12:50 -06:00
William Wall 20125ae96c Type check fixes for VectorSource
Added parameter types to event listeners. Fixed return type for
feature collection branch. Removed duplicate template definition.
2018-09-19 11:04:35 -06:00
William Wall 0994362bfe Cast tileGrid to WMTSTileGrid for type check 2018-09-19 10:31:28 -06:00
William Wall 45f2324a4e Get width as number from number|Size
This satisfies tsc in addition to being a bit more defensive from
custom tile grids, even if using them is very uncommon for this
source.
2018-09-19 10:02:33 -06:00
William Wall 1fbefcab64 Explicitly define type of 'this'
I'm not entirely sure that I like this pattern, but there does not
appear to be a better option since TypeScript would recommend:

  function(this: SomeClass, ...)

tsdoc does not appear to support an associated annotation for the
function a la @this {SomeClass}.
2018-09-18 10:38:23 -06:00