Commit Graph

11551 Commits

Author SHA1 Message Date
Frédéric Junod de7afee96d Merge pull request #9329 from fredj/cluster_refresh
Don't refresh the layer after addFeatures call
2019-03-14 11:04:28 +01:00
Frederic Junod 92cb9f1c51 Don't refresh the layer after addFeatures call 2019-03-14 10:25:19 +01:00
Frédéric Junod 7896fa894d Merge pull request #9328 from fredj/cleanup
Mark layerFilter in AtPixelOptions as optional
2019-03-14 09:17:28 +01:00
ahocevar 4a9d2e689e Create a more accurate origin for tile positioning 2019-03-13 18:34:23 +01:00
Andreas Hocevar df3d771c53 Merge pull request #9320 from RobertOrthofer/master
enhance tile-debug readability
2019-03-13 12:16:23 +01:00
Robert Orthofer 0aa14db88b move stroke behind text to achieve halo 2019-03-13 09:31:01 +01:00
Andreas Hocevar d75caaa3df Merge pull request #9318 from ahocevar/smart-cache-size
Smart cache size
2019-03-13 08:17:24 +01:00
Andreas Hocevar cfc79254d0 Merge pull request #9322 from ahocevar/render-to-source-resolution
Use closest lower source resolution for render tiles
2019-03-13 08:15:25 +01:00
ahocevar ac0d67b273 Use closest lower source resolution for render tiles 2019-03-12 16:51:20 +01:00
Robert Orthofer a051892b92 enhance tile-debug readability
this commit enhances the readability of
tile debug coordinates by adding a stroke
for better readability on aerial imagery
and a maxWidth for high zoom levels
2019-03-12 12:48:26 +01:00
ahocevar b4fc249991 Faster calculation of target size
Since usedTiles and wantedTiles will never have an overlap, we can use their
key count directly.
2019-03-12 08:53:52 +01:00
Frédéric Junod c321c90497 Merge pull request #9300 from fredj/f9299
Fix documentation about zoomDelta for ol.interaction.default function
2019-03-12 08:31:30 +01:00
ahocevar 11f5a4c5b8 Move tile specific methods to the tile layer renderer 2019-03-12 00:19:51 +01:00
ahocevar 0f217392d7 Adjust tile cache size when too small 2019-03-12 00:19:13 +01:00
Andreas Hocevar b54b7c5989 Merge pull request #9305 from KaiVolland/fix-scaleline-test
Fixes failing tests for Chrome v74
2019-03-11 15:30:01 +01:00
Frederic Junod 4a13bf2fa9 Mark layerFilter in AtPixelOptions as optional 2019-03-11 15:11:16 +01:00
Frederic Junod d71fa78ee2 Remove unused template tag 2019-03-11 15:10:32 +01:00
Kai Volland fcf6e81430 Fixes issue with ScaleLine
Math.pow with negative exponents is inaccurate in chrome v74. `toFixed`
is called on the result to fix this.
2019-03-11 13:31:49 +01:00
Andreas Hocevar dfabcc0c66 Merge pull request #9137 from jahow/add-view-constrain-extent-2
Refactor the way view constraints are handled & add a view extent constraint
2019-03-11 10:38:31 +01:00
Andreas Hocevar 8a02a6f9f1 Merge pull request #9308 from ahocevar/vectortile-loader-projection
Simplify vector tile projection handling
2019-03-11 09:28:48 +01:00
Bart van den Eijnden 4a67bd86a8 Merge pull request #9312 from bartvde/stamen-minzoom
Update zoom levels for Stamen source
2019-03-11 09:17:50 +01:00
bartvde 9ad2924f00 Update zoom levels for Stamen source 2019-03-11 08:50:28 +01:00
Frederic Junod 0401aed6e3 Add transition options to Stamen source 2019-03-11 08:34:42 +01:00
ahocevar b2722542fe Simplify vector tile projection handling 2019-03-10 09:37:58 +01:00
Andreas Hocevar 7002053678 Merge pull request #9307 from ahocevar/line-height
Take line-height into account when measuring text height
2019-03-09 10:07:16 +01:00
ahocevar 4a7b3cde56 Take line-height into account when measuring text height 2019-03-09 08:25:09 +01:00
Frederic Junod 6de566d95b Set the canvas size to 0 on dispose 2019-03-08 13:25:49 +01:00
Frederic Junod 9e89047e6a Fix documentation about zoomDelta for ol.interaction.default function 2019-03-07 14:22:33 +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
Tim Schaub d7905896f7 Merge pull request #9266 from tschaub/vector-image-options
Full type definition for image vector layer options
2019-02-28 21:43:23 -07:00
Frederic Junod 7c7b43ee91 Use the constructor options instead of changing the private variables 2019-02-27 15:11:08 +01:00
Frederic Junod 1338a868e9 Remove setDeclutter function
Changing the declutter value after the layer creating doesn't work, remove the function to avoid confusion.
2019-02-27 11:41:08 +01:00
Tim Schaub 36cf654f09 Full type definition for image vector layer options 2019-02-25 08:37:30 -07:00
Frederic Junod cd28c8a301 Remove unused 'geometry' param from 'createFill' function 2019-02-22 16:52:32 +01:00
Frederic Junod 79c6cc5159 Remove unused 'geometry' param from '{begin,end}Geometry' functions 2019-02-22 16:45:25 +01:00
Olivier Guyot f67baa0dc0 Interactions / fix zoom level when a zoom interaction ends 2019-02-22 15:04:54 +01:00
Olivier Guyot 75c379beeb View / allow specifying an anchor on interaction end
This also fixes a bug where the animation anchor would be lost when outside
the allowed resolution.
2019-02-22 15:04:54 +01:00
Olivier Guyot 405e206717 View / better names for getValid* and applyParameters_ methods 2019-02-22 15:04:54 +01:00
Olivier Guyot c2af03f152 Update the View documentation & document breaking changes 2019-02-22 15:04:54 +01:00
Olivier Guyot 78e8f23df5 View / add getValidCenter method to improve interactions
The DragPan, KeyboardPan and DragZoom interactions now make sure to
animate to a valid center/resolution target to avoid
a chained "resolve" animation which looks weird.

The `View.fit` method was also fixed to use this.
2019-02-22 15:01:30 +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 e023c144bb View / add adjust* methods to manipulate the view more easily
API changes:
* (breaking) the `rotate` method is gone
* the `adjustRotation`, `adjustResolution` and `adjustZoom` methods are now
  available and allow using an anchor.

This means interactions do not have to do the anchor computation themselves
and this also fix anchor computation when constraints must be applied.
2019-02-22 15:01:30 +01:00
Olivier Guyot b5273babb5 View / handle resolutions array with length=1 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
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
jahow cd186ada7f Add new tests for View & Interaction w/ fixes 2019-02-22 15:01:30 +01:00
Olivier Guyot a6f65df8c4 View / add a resolveConstraints method to end interactions
This will help making sure that the view will come back to a "rested" state
once the interactions are over.

Interactions no longer need to handle the animation back to a rested state,
they simply call `endInteraction` with the desired duration and direction.
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