Commit Graph

32 Commits

Author SHA1 Message Date
Simon Seyock 8facb252f1 Replace google closure syntax = with brackets around name 2021-02-03 14:06:02 +01:00
Andreas Hocevar fda93cee23 Updates for TypeScript v4 2020-08-25 13:03:58 +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
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
mike-000 eaa5af2c7a Fix for #10054
Ensure zoom level is not less than minimum integer zoom level for extent
2019-09-29 12:00:08 +01: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
Tim Schaub deb00f20fe Include full filename in import specifier 2019-05-29 08:51:10 -06:00
Olivier Guyot 447266cbe8 Better smoothing of resolution and center constraints
Previously the formula for the resolution constraint allowed going way past
the minimum zoom.
Also adjusted the center constraint to avoid a zigzag effect when going out
of resolution bounds.
2019-03-04 10:14:06 +01:00
Olivier Guyot 433bccd207 Linting and fixes for unit tests 2019-02-22 15:01:30 +01:00
Olivier Guyot ef6d17d817 View / add a 'smoothResolutionConstraint' options
When enabled (true by default), the resolution min/max values will be applied with
a smoothing effect for a better user experience.
2019-02-22 15:01:30 +01:00
Olivier Guyot 49662b019c View / add a constrainResolution option
This introduces a breaking change.

This options replaces the various `constrainResolution` options on interactions
and the `fit` method.

Since constraints are now the responsibility of the View, the fact that intermediary
zoom levels are allowed or not is now set in the view options.

By default, the view resolution is unconstrained.
2019-02-22 15:01:30 +01:00
Olivier Guyot 1c5fd62e43 View / refactor how zoom and resolution are computed
This commit aims to simplify the computation of zoom and resolution in the
View class.

Previously zoom levels and resolution computations were mixed in different places,
ie resolution constraints, initial values, etc.

Now the View class only has the `getZoomForResolution` and `getResolutionForZoom`
methods to convert from one system to another.

Other than that, most computations use the resolution system internally.

The `constrainResolution` method also does not exist anymore, and is replaced
by `getValidResolution` and `getValidZoomLevel` public methods.
2019-02-22 15:01:30 +01:00
Olivier Guyot 1f379a06a4 View / add support for viewport extent constraint
This introduces a breaking change:

The `extent` view option now constrains the whole viewport and not just the
view center.
The option `constrainOnlyCenter` was added to keep the previous behaviour.

Constraining the whole viewport and not only the view center means
that the center and resolution constraints must be applied with a knowledge of
the viewport size.
2019-02-22 15:01:30 +01:00
jahow e52fab636c View / apply constraints automatically based on hints
All constraints can now function differently if they are applied during
interaction or animation.
2019-02-22 15:01:30 +01:00
Tim Schaub ccfacc5ee6 Transformed types
Using the [ts.js codemod](https://gist.github.com/tschaub/1ea498c9d1e5268cf36d212b3949be4e):

    jscodeshift --transform ts.js src
2018-09-05 08:05:29 -06:00
Tim Schaub d12ef20b12 Use Array<Foo> instead of Array.<Foo> 2018-07-25 18:32:43 -07:00
Andreas Hocevar 95d6251dbb Get rid of olx.js and typedef.js typedefs for ol 2018-03-08 18:57:24 +01:00
Björn Harrtell 208ca098f2 Refactor constraints static methods to module functions 2018-02-14 19:00:23 +01:00
Tim Schaub 1cdb6a66f0 Imports cased like the filename 2017-12-12 06:53:17 -07:00
Marc Jansen 7d6929c710 Manual adjustment of indentation 2017-06-20 10:41:03 +02:00
Marc Jansen d0ef05977b Autofix indentation issues (eslint --fix) 2017-06-19 11:58:00 +02:00
Andreas Hocevar 98fbfe4b67 Support fractional zoom levels in ol.View#getZoom and #setZoom 2016-08-03 11:48:13 +02:00
Peter Robins 535e8f5e35 Move top-level typedefs to typedefs.js
With one exception, those directly in the `ol` namespace can be moved without problem.
Some left-over goog.requires are also removed.
2016-05-11 17:18:05 +00:00
Tim Schaub 3cf8618fc7 Prefer single line assignment to 80 character limit 2016-01-11 18:56:08 -08:00
Tim Schaub f746cb7f57 Use ol.math.clamp() 2015-09-27 12:26:21 -06:00
Tim Schaub 7659e47e07 Inline simple goog.isDef() checks 2015-09-27 10:18:44 -06:00
Éric Lemoine 552853a3b8 Remove unused createContinuous function 2013-07-04 08:58:33 +02:00
Tom Payne bd9d723315 Improve type checking in ol.ResolutionConstraint 2013-04-30 22:00:22 +02:00
Éric Lemoine de1575e457 One direction pinch zoom 2013-03-27 11:52:42 +01:00
Éric Lemoine 79166dc1d6 Constraint objects moved to ol namespace from ol.interaction namespace 2012-09-27 00:10:54 +02:00