Update the tile source
This commit is contained in:
@@ -10,9 +10,9 @@ import {getTopLeft, getWidth} from '../src/ol/extent.js';
|
|||||||
const projection = getProjection('EPSG:3857');
|
const projection = getProjection('EPSG:3857');
|
||||||
const projectionExtent = projection.getExtent();
|
const projectionExtent = projection.getExtent();
|
||||||
const size = getWidth(projectionExtent) / 256;
|
const size = getWidth(projectionExtent) / 256;
|
||||||
const resolutions = new Array(14);
|
const resolutions = new Array(19);
|
||||||
const matrixIds = new Array(14);
|
const matrixIds = new Array(19);
|
||||||
for (let z = 0; z < 14; ++z) {
|
for (let z = 0; z < 19; ++z) {
|
||||||
// generate resolutions and matrixIds arrays for this WMTS
|
// generate resolutions and matrixIds arrays for this WMTS
|
||||||
resolutions[z] = size / Math.pow(2, z);
|
resolutions[z] = size / Math.pow(2, z);
|
||||||
matrixIds[z] = z;
|
matrixIds[z] = z;
|
||||||
@@ -22,19 +22,16 @@ const map = new Map({
|
|||||||
layers: [
|
layers: [
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
source: new OSM(),
|
source: new OSM(),
|
||||||
opacity: 0.7,
|
|
||||||
}),
|
}),
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
opacity: 0.7,
|
opacity: 0.7,
|
||||||
source: new WMTS({
|
source: new WMTS({
|
||||||
attributions:
|
attributions:
|
||||||
'Tiles © <a href="https://services.arcgisonline.com/arcgis/rest/' +
|
'Tiles © <a href="https://mrdata.usgs.gov/geology/state/"' +
|
||||||
'services/Demographics/USA_Population_Density/MapServer/">ArcGIS</a>',
|
' target="_blank">USGS</a>',
|
||||||
url:
|
url: 'https://mrdata.usgs.gov/mapcache/wmts',
|
||||||
'https://services.arcgisonline.com/arcgis/rest/' +
|
layer: 'sgmc2',
|
||||||
'services/Demographics/USA_Population_Density/MapServer/WMTS/',
|
matrixSet: 'GoogleMapsCompatible',
|
||||||
layer: '0',
|
|
||||||
matrixSet: 'EPSG:3857',
|
|
||||||
format: 'image/png',
|
format: 'image/png',
|
||||||
projection: projection,
|
projection: projection,
|
||||||
tileGrid: new WMTSTileGrid({
|
tileGrid: new WMTSTileGrid({
|
||||||
|
|||||||
Reference in New Issue
Block a user