From ea97d6bc09438c3aa0b87150bde52218be5f3403 Mon Sep 17 00:00:00 2001 From: evlist Date: Wed, 28 Sep 2022 13:38:38 +0200 Subject: [PATCH] Adding / updating tile servers and changing the order of zoom in/out in the mouse wheel handler. --- src/components/map/tile.tsx | 25 +++++++++++++++++++++---- src/components/slippy/wheel-handler.tsx | 2 +- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/components/map/tile.tsx b/src/components/map/tile.tsx index 99772df..f530021 100644 --- a/src/components/map/tile.tsx +++ b/src/components/map/tile.tsx @@ -27,7 +27,7 @@ export const tileProviders: any = { osmfr: { name: 'Open Street Map France', minZoom: 0, - maxZoom: 19, + maxZoom: 20, getTileUrl: (zoom: number, x: number, y: number) => 'https://' + getRandomItem(abc) + @@ -41,8 +41,8 @@ export const tileProviders: any = { }, otm: { name: 'Open Topo Map', - minZoom: 0, - maxZoom: 19, + minZoom: 2, + maxZoom: 17, getTileUrl: (zoom: number, x: number, y: number) => 'https://' + getRandomItem(abc) + @@ -68,7 +68,24 @@ export const tileProviders: any = { '/' + y + '.png', - }, + }, + //https://b.tile.openstreetmap.fr/openriverboatmap/20/535762/382966.png + openriverboatmap: { + name: 'Open River Boat Map', + minZoom: 0, + maxZoom: 20, + getTileUrl: (zoom: number, x: number, y: number) => + 'https://' + + getRandomItem(abc) + + '.tile.openstreetmap.fr/openriverboatmap/' + + zoom + + '/' + + x + + '/' + + y + + '.png', + }, + // cyclosmlite: { // name: 'CyclOSM lite', // minZoom: 0, diff --git a/src/components/slippy/wheel-handler.tsx b/src/components/slippy/wheel-handler.tsx index 9bd5fad..652a18b 100644 --- a/src/components/slippy/wheel-handler.tsx +++ b/src/components/slippy/wheel-handler.tsx @@ -42,7 +42,7 @@ const WheelHandler: react.FC = ( ) { dispatch( mapActions.scale({ - factor: event.deltaY > 0 ? Math.SQRT2 : Math.SQRT1_2, + factor: event.deltaY < 0 ? Math.SQRT2 : Math.SQRT1_2, center: { x: event.pageX, y: event.pageY }, }) );