Adding / updating tile servers and changing the order of zoom in/out in the mouse wheel handler.

This commit is contained in:
Eric van der Vlist 2022-09-28 13:38:38 +02:00
parent 2fe7452811
commit ea97d6bc09
2 changed files with 22 additions and 5 deletions

View File

@ -27,7 +27,7 @@ export const tileProviders: any = {
osmfr: { osmfr: {
name: 'Open Street Map France', name: 'Open Street Map France',
minZoom: 0, minZoom: 0,
maxZoom: 19, maxZoom: 20,
getTileUrl: (zoom: number, x: number, y: number) => getTileUrl: (zoom: number, x: number, y: number) =>
'https://' + 'https://' +
getRandomItem(abc) + getRandomItem(abc) +
@ -41,8 +41,8 @@ export const tileProviders: any = {
}, },
otm: { otm: {
name: 'Open Topo Map', name: 'Open Topo Map',
minZoom: 0, minZoom: 2,
maxZoom: 19, maxZoom: 17,
getTileUrl: (zoom: number, x: number, y: number) => getTileUrl: (zoom: number, x: number, y: number) =>
'https://' + 'https://' +
getRandomItem(abc) + getRandomItem(abc) +
@ -69,6 +69,23 @@ export const tileProviders: any = {
y + y +
'.png', '.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: { // cyclosmlite: {
// name: 'CyclOSM lite', // name: 'CyclOSM lite',
// minZoom: 0, // minZoom: 0,

View File

@ -42,7 +42,7 @@ const WheelHandler: react.FC<WheelHandlerProps> = (
) { ) {
dispatch( dispatch(
mapActions.scale({ 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 }, center: { x: event.pageX, y: event.pageY },
}) })
); );