Commit Graph

153 Commits

Author SHA1 Message Date
Simon Seyock
ce4f6ccb0d OnSignatures return more specific type 2021-09-10 16:11:38 +02:00
Andreas Hocevar
e9e664f3c9 Add typed signature for Observable#un() 2021-07-10 11:28:50 +02:00
Simon Seyock
d914006d51 Add signatures for once. 2021-07-10 11:28:49 +02:00
Simon Seyock
1870a64984 Add CombinedOnSignature. 2021-07-10 11:28:49 +02:00
Simon Seyock
ba9bfca9d5 Geolocation, Overlay, View 2021-07-10 11:28:48 +02:00
Simon Seyock
c8f43050c4 Revert "Merge pull request #12416 from ahocevar/eventtype-generics"
This reverts commit b6c143deb2, reversing
changes made to 7777821df5.
2021-07-10 11:28:46 +02:00
Andreas Hocevar
79f5f46d27 Remove lint 2021-06-28 18:10:51 +02:00
Andreas Hocevar
b6c143deb2 Merge pull request #12416 from ahocevar/eventtype-generics
Use generics to limit event types in on(), once() and un()
2021-06-21 09:36:25 +02:00
Andreas Hocevar
018ad97f25 Use generics to limit event types in on(), once() and un() 2021-06-20 22:25:47 +02:00
Tim Schaub
f798902ecd Fix JSDoc generated links 2021-06-17 21:54:07 -06:00
MoonE
9ab5b70e3a Merge pull request #12282 from M393/dragzoom-view-padding
Fix DragZoom with view padding
2021-06-17 19:13:03 +02:00
Simon Seyock
3d7ee5700e document descending order of resolutions array 2021-05-25 18:13:46 +02:00
Maximilian Krög
c19ebc72cb Fix dragzoom with rotated view
When the view is rotated the extent of the drag box is not the same as the
drag box.
2021-05-08 05:15:11 +02:00
Marc Jansen
df23c234dc Fix common misspellings
These were found with codespell.
2021-03-05 22:53:35 +01:00
Simon Seyock
2ad5789797 Add descriptions for properties. 2021-02-04 18:19:33 +01:00
Simon Seyock
8facb252f1 Replace google closure syntax = with brackets around name 2021-02-03 14:06:02 +01:00
Andreas Hocevar
aa2c301f3e Do not change center when the padding changes 2021-01-23 21:50:41 +01:00
Andreas Hocevar
900107df1d Take view padding into account for calculateExtent() 2021-01-22 20:08:05 +01:00
Andreas Hocevar
231390a1f0 Handle center constraint properly 2020-11-23 13:12:32 +01:00
Andreas Hocevar
0e2d17b9c6 Add padding option for View 2020-11-22 18:52:46 +01:00
Maximilian Krög
fbcf0b5009 Constrain resolution when fit called without duration 2020-09-15 17:52:22 +02:00
Tim Schaub
bfee5c00c9 Update function return types 2020-05-18 17:11:13 -06:00
Andreas Hocevar
b0f20d6bd6 Use imports for enum types 2020-04-15 10:53:23 +02:00
Tim Schaub
054af09032 Make code prettier
This updates ESLint and our shared eslint-config-openlayers to use Prettier.  Most formatting changes were automatically applied with this:

    npm run lint -- --fix

A few manual changes were required:

 * In `examples/offscreen-canvas.js`, the `//eslint-disable-line` comment needed to be moved to the appropriate line to disable the error about the `'worker-loader!./offscreen-canvas.worker.js'` import.
 * In `examples/webpack/exapmle-builder.js`, spaces could not be added after a couple `function`s for some reason.  While editing this, I reworked `ExampleBuilder` to be a class.
 * In `src/ol/format/WMSGetFeatureInfo.js`, the `// @ts-ignore` comment needed to be moved down one line so it applied to the `parsersNS` argument.
2020-04-06 12:54:09 -06:00
Olivier Guyot
32321e381c View / avoid solving constraints related to map size change during anim 2020-04-02 14:22:47 +02:00
Andreas Hocevar
5e51e397bb Merge pull request #10786 from ahocevar/resolve-contraints-on-updatesize
Resolve constraints when updating size
2020-03-10 13:05:29 +01:00
Andreas Hocevar
c5fd013e31 Resolve constraints when updating size 2020-03-09 16:20:21 +01:00
mike-000
ce6d7bd55c Fix "Cannot read property 'anchor' of undefined"
replace unnecessary filter with for loop and break
2020-02-29 10:12:48 +00:00
mike-000
5ba978311e Fix "Cannot read property 'anchor' of undefined" 2020-02-28 21:47:22 +00:00
Andreas Hocevar
d93073f8d0 No trackpad mode for constrained resolutions 2020-02-16 10:05:32 +01:00
Jeremy Smith
3082972cce Updates the option to be called showFullExtent 2020-02-05 16:46:45 +10:00
Jeremy Smith
7805768942 Renamed option to constrainOneAxis 2020-01-30 07:40:28 +10:00
Jeremy Smith
4151e86c0a Adds option to View for using larger resolution value when clamping 2020-01-29 15:35:48 +10:00
Dan Lim
21e9601d7b typo in view.fit 2020-01-07 16:12:06 -08:00
Olivier Guyot
e4ea272799 Merge pull request #10413 from MoonE/zoomsliderextent
Limit the ZoomSlider's range to the view's constrained resolution.
2019-12-23 14:59:19 +01:00
Olivier Guyot
4440994ec8 Avoid recomputing the viewport size by reading the DOM everytime
Also clarify View#calculateExtent doc & remove the [data-view] attribute
on the viewport element (not needed anymore).
2019-12-23 10:47:54 +01:00
Maximilian Krög
33389969ce Limit the ZoomSlider's range to the view's constrained resolution. 2019-12-20 23:13:41 +01:00
Maximilian Krög
d7eaacf923 Small performance improvement by saving the calculated logarithm. 2019-12-20 23:13:19 +01:00
Olivier Guyot
3530b4cf12 Merge pull request #10120 from mike-000/patch-9
Resolve constraints using anchor if following a cancelled animation
2019-12-03 09:37:48 +01:00
Brian Helba
d90a4569da Allow View.adjust* methods to take a null opt_anchor
The methods `View.adjustRotation`, `View.adjustZoom` and `View.adjustResolution`
optionally take an `opt_anchor` parameter. When `opt_anchor` is `undefined`, the
methods work properly. When it is `null`, they currently attempt to access the
`null` value as though it is a `Coordinate` object, and throw:
```
TypeError: Cannot read property '0' of null
```

This change allows `opt_anchor` to safely be `null`.

Existing code paths already expect this to be supported. For example, when
`MouseWheelZoom.useAnchor_` is `false`, then
[`MouseWheelZoom.lastAnchor_` remains `null`](77bc6897dd/src/ol/interaction/MouseWheelZoom.js (L166));
thus, this `null` value
[is passed to `View.adjustZoom` as `opt_anchor`](77bc6897dd/src/ol/interaction/MouseWheelZoom.js (L209)).
2019-11-05 21:30:17 -05:00
mike-000
937f7f613e Resolve constraints using anchor
Resolve constraints using anchor if view state is the result of cancelling an animation with anchor
2019-10-12 21:13:34 +01:00
Tim Schaub
5d4e77151c Handle event coordinate in the user projection 2019-09-26 17:24:58 +02:00
mike-000
d749e244ed Improve the API description for "multiWorld"
The API description for multiWorld seems very vague compared with other view option descriptions and the upgrade notes.
2019-09-23 14:15:51 +01:00
Frédéric Junod
5630e278b9 Merge pull request #9723 from fredj/pass_param
Pass the opt_direction value to the getConstrainedResolution function
2019-09-23 14:24:31 +02:00
Olivier Guyot
90d38b428c Merge pull request #9903 from mike-000/patch-1
Respect multiWorld: false when an explicit extent constraint would be respected
2019-09-23 13:46:04 +02:00
mike-000
9d125ee340 Respect mutiWorld: false same as explicit extent
Fixes #9577

The multiWorld: false constraint is currently not taken into account when constrainResolution is set or when an explicit resolutions array is specified, while an explicit extent constraint is respected in the same situations.  This pull request takes a global projection extent into consideration in that same situations that an explicit extent would be.

Add multiWorld tests with resolution constraints

includes fix for #9937
2019-09-23 11:48:25 +01:00
Frederic Junod
e780f2e3a3 Better description for the opt_direction parameter 2019-09-23 12:47:40 +02:00
Frederic Junod
4b35b920a1 Pass the opt_direction value to the getConstrainedResolution function 2019-09-23 12:47:27 +02:00
Tim Schaub
c03c359a20 Separate internal and API methods for the view 2019-09-21 11:30:14 -06:00
ahocevar
b6bd35c15c Fix observable properties documentation 2019-07-14 10:15:00 +02:00