Skip to content

Commit 822619d

Browse files
committed
Website updates
1 parent 1ae29bd commit 822619d

9 files changed

+78
-7
lines changed

dist/en/main/apidoc/module-ol_control_ZoomToExtent-ZoomToExtent.html

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ <h4 class="name">
157157

158158
<div class="tag-source">
159159
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/control/ZoomToExtent.js">control/ZoomToExtent.js</a>,
160-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/control/ZoomToExtent.js#L29">line 29</a>
160+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/control/ZoomToExtent.js#L31">line 31</a>
161161
</div>
162162

163163
</div>
@@ -333,6 +333,32 @@ <h4 class="name">
333333
</tr>
334334

335335

336+
337+
<tr class="">
338+
339+
<td class="name"><code>fitOptions</code></td>
340+
341+
342+
343+
<td class="type">
344+
345+
346+
<span class="param-type"><a href="module-ol_View.html#~FitOptions">FitOptions</a></span>
347+
348+
| undefined
349+
350+
351+
</td>
352+
353+
354+
355+
<td class="description last">
356+
357+
<p>Options to pass to the view when fitting
358+
the extent (e.g. <code>padding</code>, <code>duration</code>, <code>minResolution</code>, <code>maxZoom</code>, <code>easing</code>, <code>callback</code>).</p></td>
359+
</tr>
360+
361+
336362
</tbody>
337363
</table>
338364

dist/en/main/apidoc/module-ol_control_ZoomToExtent.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,30 @@ <h5 class="subsection-title">Properties:</h5>
331331
</tr>
332332

333333

334+
335+
<tr>
336+
337+
<td class="name"><code>fitOptions</code></td>
338+
339+
340+
<td class="type">
341+
342+
343+
<span class="param-type"><a href="module-ol_View.html#~FitOptions">FitOptions</a></span>
344+
345+
| undefined
346+
347+
348+
</td>
349+
350+
<td class="description last">
351+
<p>Options to pass to the view when fitting
352+
the extent (e.g. <code>padding</code>, <code>duration</code>, <code>minResolution</code>, <code>maxZoom</code>, <code>easing</code>, <code>callback</code>).</p>
353+
354+
</td>
355+
</tr>
356+
357+
334358
</tbody>
335359
</table></dl>
336360

dist/en/main/examples/navigation-controls.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/navigation-controls.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/control/ZoomToExtent.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ export type Options = {
2323
* extent of the view projection is used.
2424
*/
2525
extent?: import("../extent.js").Extent | undefined;
26+
/**
27+
* Options to pass to the view when fitting
28+
* the extent (e.g. `padding`, `duration`, `minResolution`, `maxZoom`, `easing`, `callback`).
29+
*/
30+
fitOptions?: import("../View.js").FitOptions | undefined;
2631
};
2732
/**
2833
* @typedef {Object} Options
@@ -34,6 +39,8 @@ export type Options = {
3439
* @property {string} [tipLabel='Fit to extent'] Text label to use for the button tip.
3540
* @property {import("../extent.js").Extent} [extent] The extent to zoom to. If undefined the validity
3641
* extent of the view projection is used.
42+
* @property {import("../View.js").FitOptions} [fitOptions] Options to pass to the view when fitting
43+
* the extent (e.g. `padding`, `duration`, `minResolution`, `maxZoom`, `easing`, `callback`).
3744
*/
3845
/**
3946
* @classdesc
@@ -52,6 +59,11 @@ declare class ZoomToExtent extends Control {
5259
* @protected
5360
*/
5461
protected extent: (import("../extent.js").Extent | null) | null;
62+
/**
63+
* @type {import("../View.js").FitOptions}
64+
* @protected
65+
*/
66+
protected fitOptions: import("../View.js").FitOptions;
5567
/**
5668
* @param {MouseEvent} event The event to handle
5769
* @private

dist/en/main/ol/control/ZoomToExtent.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/control/ZoomToExtent.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import Control from './Control.js';
1717
* @property {string} [tipLabel='Fit to extent'] Text label to use for the button tip.
1818
* @property {import("../extent.js").Extent} [extent] The extent to zoom to. If undefined the validity
1919
* extent of the view projection is used.
20+
* @property {import("../View.js").FitOptions} [fitOptions] Options to pass to the view when fitting
21+
* the extent (e.g. `padding`, `duration`, `minResolution`, `maxZoom`, `easing`, `callback`).
2022
*/
2123

2224
/**
@@ -44,6 +46,12 @@ class ZoomToExtent extends Control {
4446
*/
4547
this.extent = options.extent ? options.extent : null;
4648

49+
/**
50+
* @type {import("../View.js").FitOptions}
51+
* @protected
52+
*/
53+
this.fitOptions = options.fitOptions || {};
54+
4755
const className =
4856
options.className !== undefined ? options.className : 'ol-zoom-extent';
4957

@@ -88,7 +96,8 @@ class ZoomToExtent extends Control {
8896
const extent = !this.extent
8997
? view.getProjection().getExtent()
9098
: fromUserExtent(this.extent, view.getProjection());
91-
view.fitInternal(polygonFromExtent(extent));
99+
100+
view.fitInternal(polygonFromExtent(extent), this.fitOptions);
92101
}
93102
}
94103

dist/en/main/ol/dist/ol.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)