From 8164e6b30e007a3eeaea25decf98ccb098d9e85f Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Tue, 7 Dec 2021 00:53:01 -0600 Subject: Changed stuff --- modern/src/map/Map.js | 2 +- modern/src/map/SelectedDeviceMap.js | 4 ++-- modern/src/map/mapUtil.js | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'modern/src/map') diff --git a/modern/src/map/Map.js b/modern/src/map/Map.js index dcf5a92..a5f69e0 100644 --- a/modern/src/map/Map.js +++ b/modern/src/map/Map.js @@ -49,7 +49,7 @@ const initMap = async () => { await Promise.all(deviceCategories.map(async (category) => { const results = []; ['green', 'red', 'gray'].forEach((color) => { - results.push(loadImage(`images/icon/${category}.svg`).then((icon) => { + results.push(loadImage(`images/icon/${category}.png`).then((icon) => { map.addImage(`${category}-${color}`, prepareIcon(background, icon, palette.common[color]), { pixelRatio: window.devicePixelRatio, }); diff --git a/modern/src/map/SelectedDeviceMap.js b/modern/src/map/SelectedDeviceMap.js index 6384717..d05394b 100644 --- a/modern/src/map/SelectedDeviceMap.js +++ b/modern/src/map/SelectedDeviceMap.js @@ -16,10 +16,10 @@ const SelectedDeviceMap = () => { useEffect(() => { if (mapCenter) { - map.easeTo({ center: mapCenter.position }); + map.easeTo({ center: mapCenter.position, zoom:18 }); } }, [mapCenter]); - + return null; }; diff --git a/modern/src/map/mapUtil.js b/modern/src/map/mapUtil.js index 2aa86c6..ca7b3af 100644 --- a/modern/src/map/mapUtil.js +++ b/modern/src/map/mapUtil.js @@ -39,14 +39,14 @@ export const prepareIcon = (background, icon, color) => { context.drawImage(background, 0, 0, canvas.width, canvas.height); if (icon) { - const iconRatio = 0.5; + const iconRatio = 0.8; const imageWidth = canvas.width * iconRatio; const imageHeight = canvas.height * iconRatio; - if (navigator.userAgent.indexOf('Firefox') > 0) { + /*if (navigator.userAgent.indexOf('Firefox') > 0) {*/ context.drawImage(icon, (canvas.width - imageWidth) / 2, (canvas.height - imageHeight) / 2, imageWidth, imageHeight); - } else { + /*} else { context.drawImage(canvasTintImage(icon, color), (canvas.width - imageWidth) / 2, (canvas.height - imageHeight) / 2, imageWidth, imageHeight); - } + }*/ } return context.getImageData(0, 0, canvas.width, canvas.height); -- cgit v1.2.3