Skip to content

Commit 7979d33

Browse files
fix zoom
1 parent 688d556 commit 7979d33

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

x-pack/plugins/maps/public/layers/sources/source.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ export interface ISource {
3131
isTimeAware(): Promise<boolean>;
3232
getImmutableProperties(): Promise<ImmutableSourceProperty[]>;
3333
getAttributions(): Promise<Attribution[]>;
34+
getMinZoom(): number;
35+
getMaxZoom(): number;
3436
}
3537

3638
export class AbstractSource implements ISource {
@@ -49,4 +51,6 @@ export class AbstractSource implements ISource {
4951
isTimeAware(): Promise<boolean>;
5052
getImmutableProperties(): Promise<ImmutableSourceProperty[]>;
5153
getAttributions(): Promise<Attribution[]>;
54+
getMinZoom(): number;
55+
getMaxZoom(): number;
5256
}

x-pack/plugins/maps/public/layers/sources/source.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
88
import { copyPersistentState } from '../../reducers/util';
9+
import { MIN_ZOOM, MAX_ZOOM } from '../../../common/constants';
910

1011
export class AbstractSource {
1112
static isIndexingSource = false;
@@ -148,4 +149,12 @@ export class AbstractSource {
148149
async getValueSuggestions(/* field, query */) {
149150
return [];
150151
}
152+
153+
getMinZoom() {
154+
return MIN_ZOOM;
155+
}
156+
157+
getMaxZoom() {
158+
return MAX_ZOOM;
159+
}
151160
}

0 commit comments

Comments
 (0)