Skip to content

Commit 1824914

Browse files
author
Mohsen Azimi
committed
No default args
1 parent 71d438a commit 1824914

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

js/ui/handler/scroll_zoom.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ class ScrollZoomHandler {
4545
* @example
4646
* map.scrollZoom.enable({ around: 'center' })
4747
*/
48-
enable(options = {}) {
48+
enable(options) {
4949
if (this.isEnabled()) return;
5050
this._el.addEventListener('wheel', this._onWheel, false);
5151
this._el.addEventListener('mousewheel', this._onWheel, false);
5252
this._enabled = true;
53-
if (options.around === 'center') {
53+
if (options && options.around === 'center') {
5454
this._aroundCenter = true;
5555
} else {
5656
this._aroundCenter = false;

js/ui/handler/touch_zoom_rotate.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ class TouchZoomRotateHandler {
4949
* @example
5050
* map.touchZoomRotate.enable({ around: 'center' });
5151
*/
52-
enable(options = {}) {
52+
enable(options) {
5353
if (this.isEnabled()) return;
5454
this._el.addEventListener('touchstart', this._onStart, false);
5555
this._enabled = true;
56-
if (options.around === 'center') {
56+
if (options && options.around === 'center') {
5757
this._aroundCenter = true;
5858
} else {
5959
this._aroundCenter = false;

0 commit comments

Comments
 (0)