Commit Graph

28 Commits

Author SHA1 Message Date
Maximilian Krög 5a49410d82 Center should remain valid when resolution is not set 2022-02-18 00:55:34 +01:00
Simon Seyock 8facb252f1 Replace google closure syntax = with brackets around name 2021-02-03 14:06:02 +01:00
Andreas Hocevar 231390a1f0 Handle center constraint properly 2020-11-23 13:12:32 +01: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
Andreas Hocevar ac50cc3460 New eslint config with no-multi-assign 2019-11-02 15:20:21 +01: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
jahow 48ad1ffcbf View / implement a smooth rebound effect when a max extent is given
This is done by applying the center constraint differently when we're in the
middle of an interaction/animation or not.

When the view is moving, the center constraint will restrain the given value
in an "elastic" way, using a logarithmic function.

This can be disabled using the `smoothCenterConstrain` view parameter.
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
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
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 e6f6dcc230 Partial valid-jsdoc corrections 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 c8e9525f3b Remove goog.isDef from attribution.js through color.js (-54 B) 2015-09-25 11:28:54 -06:00
Peter Robins 8bc5a928a7 Remove centerConstraintType from API 2014-08-11 17:15:08 +00:00
Tim Schaub 4cf5ab4620 Use @api annotation instead of @todo api 2014-07-05 15:41:14 -04:00
Andreas Hocevar fbdbbfb7a7 Get rid of stability annotations and document stability with api
This change adds a stability value to the api annotation, with
'experimental' as default value.

enum, typedef and event annotations are never exportable, but
api annotations are needed there to make them appear in the
docs.

Nested typedefs are no longer inlined recursively, because the
resulting tables get too wide with the current template.
2014-04-29 09:53:07 -06:00
Paul Spencer bada596b45 Add default stability level to docs of exported things. 2013-10-24 18:20:24 -04:00
Tom Payne 1c003b5ab1 Add ol.CenterConstraint 2013-09-30 10:17:24 +02:00
Éric Lemoine d61a117787 Remove CenterConstraint entirely 2012-09-27 13:44:24 +02:00
Éric Lemoine 79166dc1d6 Constraint objects moved to ol namespace from ol.interaction namespace 2012-09-27 00:10:54 +02:00