From fb0ea53ea260c712d21f774c16065269b6f43d11 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Wed, 26 Apr 2023 16:33:34 +0200 Subject: [PATCH] open layers example: set raster tile size to 512x512 [#3] --- js/examples/openlayers_raster.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/examples/openlayers_raster.html b/js/examples/openlayers_raster.html index 71bf5ad..77964f3 100644 --- a/js/examples/openlayers_raster.html +++ b/js/examples/openlayers_raster.html @@ -28,7 +28,8 @@ constructor(options) { super({ state: "loading", - attributions: options.attributions + attributions: options.attributions, + tileSize: options.tileSize }); const p = new pmtiles.PMTiles(options.url); @@ -41,7 +42,6 @@ const blob = new Blob([response.data]); const src = URL.createObjectURL(blob); const image = await this.loadImage(src); - image.width = 512; URL.revokeObjectURL(src); return image; }); @@ -50,11 +50,11 @@ } } - // TODO: tile size 512,512 const rasterLayer = new ol.layer.WebGLTile({ source: new RasterPMTilesSource({ url:"https://r2-public.protomaps.com/protomaps-sample-datasets/terrarium_z9.pmtiles", - attributions:["https://github.com/tilezen/joerd/blob/master/docs/attribution.md"] + attributions:["https://github.com/tilezen/joerd/blob/master/docs/attribution.md"], + tileSize: [512,512] }) }); @@ -64,7 +64,7 @@ target: 'map', view: new ol.View({ center: [0,0], - zoom: 0, + zoom: 1, multiWorld: true }), });