Commit Graph

14 Commits

Author SHA1 Message Date
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 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
Björn Harrtell 208ca098f2 Refactor constraints static methods to module functions 2018-02-14 19:00:23 +01:00
Tim Schaub ad62739a6e Use blocked scoped variables
In addition to using const and let, this also upgrades our linter config and removes lint (mostly whitespace).
2018-01-12 00:50:30 -07:00
Tim Schaub 073e7dc829 Rename _ol_ResolutionConstraint_ to ResolutionConstraint 2018-01-10 09:35:42 -07:00
Tim Schaub 7f47883c48 Transformed 2017-12-12 06:53:18 -07:00
Tim Schaub a3e3e99baa Get rid of useless test exports 2017-08-17 15:16:58 -04:00
Tim Schaub ed5dbd1293 Put test requires on top 2016-08-08 09:58:11 -06:00
Éric Lemoine de1575e457 One direction pinch zoom 2013-03-27 11:52:42 +01:00
Tobias Bieniek 89ab68cde7 Replaced jasmine testing framework by mocha, expect.js and sinon
as discussed in #319
2013-03-13 04:32:43 +01:00
Tom Payne f6fe7bd36c Make spec indentation pass strict mode 2013-03-04 20:47:20 +01:00
Éric Lemoine b6ed5f2164 Use namespaces for tests
With this commit test files provide namespaces (using goog.provide). This fixes the issue reported by @bartvde where goog objects cannot be used in Jasmine "describe" functions. It also frees us from having to add script tags for the test files in test/ol.html.
2013-01-31 10:18:21 +01:00
Éric Lemoine 79166dc1d6 Constraint objects moved to ol namespace from ol.interaction namespace 2012-09-27 00:10:54 +02:00