From 1776f13f4cda5e2f1b86d6f85806ad4a40ba27db Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Wed, 22 Sep 2021 15:12:02 +0100 Subject: [PATCH] Update the tile source --- examples/wmts.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/examples/wmts.js b/examples/wmts.js index be6e0e4f86..3dba1859b3 100644 --- a/examples/wmts.js +++ b/examples/wmts.js @@ -10,9 +10,9 @@ import {getTopLeft, getWidth} from '../src/ol/extent.js'; const projection = getProjection('EPSG:3857'); const projectionExtent = projection.getExtent(); const size = getWidth(projectionExtent) / 256; -const resolutions = new Array(14); -const matrixIds = new Array(14); -for (let z = 0; z < 14; ++z) { +const resolutions = new Array(19); +const matrixIds = new Array(19); +for (let z = 0; z < 19; ++z) { // generate resolutions and matrixIds arrays for this WMTS resolutions[z] = size / Math.pow(2, z); matrixIds[z] = z; @@ -22,19 +22,16 @@ const map = new Map({ layers: [ new TileLayer({ source: new OSM(), - opacity: 0.7, }), new TileLayer({ opacity: 0.7, source: new WMTS({ attributions: - 'Tiles © ArcGIS', - url: - 'https://services.arcgisonline.com/arcgis/rest/' + - 'services/Demographics/USA_Population_Density/MapServer/WMTS/', - layer: '0', - matrixSet: 'EPSG:3857', + 'Tiles © USGS', + url: 'https://mrdata.usgs.gov/mapcache/wmts', + layer: 'sgmc2', + matrixSet: 'GoogleMapsCompatible', format: 'image/png', projection: projection, tileGrid: new WMTSTileGrid({