/
zoomOtherExtension.ts
66 lines (60 loc) · 1.65 KB
/
zoomOtherExtension.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { BaseExtension } from './baseExtension';
import { Extensions } from './extensions';
import { GeoPackageConstants } from '../geoPackageConstants';
import { TileTable } from '../tiles/user/tileTable';
import { ExtensionScopeType } from './extensionScopeType';
import type { GeoPackage } from '../geoPackage';
/**
* Zoom Other Intervals extension
*/
export class ZoomOtherExtension extends BaseExtension {
/**
* Name
*/
public static readonly NAME: string = 'zoom_other';
/**
* Extension name
*/
public static readonly EXTENSION_NAME: string =
GeoPackageConstants.EXTENSION_AUTHOR + Extensions.EXTENSION_NAME_DIVIDER + ZoomOtherExtension.NAME;
/**
* Extension definition URL
*/
public static readonly DEFINITION: string = 'https://www.geopackage.org/spec/#extension_zoom_other_intervals';
/**
* Constructor
*
* @param geoPackage
* GeoPackage
*
*/
public constructor(geoPackage: GeoPackage) {
super(geoPackage);
}
/**
* Get or create the extension
*
* @param tableName
* table name
* @return extension
*/
public getOrCreate(tableName: string): Extensions {
return super.getOrCreate(
ZoomOtherExtension.EXTENSION_NAME,
tableName,
TileTable.COLUMN_TILE_DATA,
ZoomOtherExtension.DEFINITION,
ExtensionScopeType.READ_WRITE,
);
}
/**
* Determine if the GeoPackage has the extension
*
* @param tableName
* table name
* @return true if has extension
*/
public has(tableName: string): boolean {
return this.hasExtension(ZoomOtherExtension.EXTENSION_NAME, tableName, TileTable.COLUMN_TILE_DATA);
}
}