]>
git.argeo.org Git - gpl/argeo-suite.git/blob - js/src/geo/SentinelCloudless.js
2 import WMTS
from 'ol/source/WMTS.js';
3 import WMTSTileGrid
from 'ol/tilegrid/WMTS';
4 import { getTopLeft
} from 'ol/extent';
5 import { getWidth
} from 'ol/extent';
6 import { get as getProjection
} from 'ol/proj';
8 export default class SentinelCloudless
extends WMTS
{
9 static source_s2CL2019
;
10 static EPSG4326
= getProjection('EPSG:4326');
20 // from https://s2maps.eu/
21 let size
= getWidth(this.EPSG4326
.getExtent()) / 512;
22 this.resolutions
= new Array(max_zoom
+ zoomOffset
);
23 this.matrixIds
= new Array(max_zoom
+ zoomOffset
);
24 for (let z
= min_zoom
; z
<= max_zoom
; ++z
) {
25 // generate resolutions and matrixIds arrays for this WMTS
26 this.resolutions
[z
] = size
/ Math
.pow(2, z
);
27 this.matrixIds
[z
] = z
;
34 "//a.s2maps-tiles.eu/wmts/",
35 "//b.s2maps-tiles.eu/wmts/",
36 "//c.s2maps-tiles.eu/wmts/",
37 "//d.s2maps-tiles.eu/wmts/",
38 "//e.s2maps-tiles.eu/wmts/"
40 layer
: 's2cloudless-2021',
43 projection
: SentinelCloudless
.EPSG4326
,
44 tileGrid
: new WMTSTileGrid({
45 origin
: getTopLeft(SentinelCloudless
.EPSG4326
.getExtent()),
46 resolutions
: SentinelCloudless
.resolutions
,
47 matrixIds
: SentinelCloudless
.matrixIds
,