Skip to content

Commit

Permalink
Merge pull request #14807 from Pierstoval/zoomslider-target
Browse files Browse the repository at this point in the history
Add option-based support for options.target in ZoomSlider
  • Loading branch information
ahocevar committed Jun 7, 2023
2 parents f8d9625 + 9319a2c commit 993b42f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ol/control/ZoomSlider.js
Expand Up @@ -27,6 +27,8 @@ const Direction = {
* @property {number} [duration=200] Animation duration in milliseconds.
* @property {function(import("../MapEvent.js").default):void} [render] Function called when the control
* should be re-rendered. This is called in a `requestAnimationFrame` callback.
* @property {HTMLElement|string} [target] Specify a target if you want the control to be
* rendered outside of the map's viewport.
*/

/**
Expand All @@ -47,6 +49,7 @@ class ZoomSlider extends Control {
options = options ? options : {};

super({
target: options.target,
element: document.createElement('div'),
render: options.render,
});
Expand Down

0 comments on commit 993b42f

Please sign in to comment.