From 22ef3ad139e5b5ad4c83582d91f90b1e87d4ba65 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Mon, 6 Sep 2021 19:55:04 +0100 Subject: [PATCH] feat: allow duckduckgo proxy on map --- src/components/widgets/background/PhotoInformation.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/widgets/background/PhotoInformation.jsx b/src/components/widgets/background/PhotoInformation.jsx index 3c734287..84b3897e 100644 --- a/src/components/widgets/background/PhotoInformation.jsx +++ b/src/components/widgets/background/PhotoInformation.jsx @@ -49,13 +49,15 @@ export default function PhotoInformation({ info, url, api }) { } } + const ddgProxy = (localStorage.getItem('ddgProxy') === 'true'); + // get resolution const img = new Image(); img.onload = (event) => { setWidth(event.target.width); setHeight(event.target.height); }; - img.src = (localStorage.getItem('ddgProxy') === 'true' && !info.offline && !url.startsWith('data:')) ? window.constants.DDG_IMAGE_PROXY + url : url; + img.src = (ddgProxy && !info.offline && !url.startsWith('data:')) ? window.constants.DDG_IMAGE_PROXY + url : url; // info is still there because we want the favourite button to work if (localStorage.getItem('photoInformation') === 'false') { @@ -96,8 +98,10 @@ export default function PhotoInformation({ info, url, api }) { const lat = lat2tile(info.latitude, 12); const lon = lon2tile(info.longitude, 12); + const tile = `https://a.tile.openstreetmap.org/12/${lon}/${lat}.png`; + return ( - location + location ); }