aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2021-12-07 00:53:01 -0600
committerIván Ávalos <avalos@disroot.org>2021-12-07 00:53:01 -0600
commit8164e6b30e007a3eeaea25decf98ccb098d9e85f (patch)
tree332aa2d38bc0f3c3ae3f1001909624e041573428 /modern/src/map
parenta273d60becc5ccc9e4626325ea2dca20271b36bc (diff)
downloadetbsa-traccar-web-8164e6b30e007a3eeaea25decf98ccb098d9e85f.tar.gz
etbsa-traccar-web-8164e6b30e007a3eeaea25decf98ccb098d9e85f.tar.bz2
etbsa-traccar-web-8164e6b30e007a3eeaea25decf98ccb098d9e85f.zip
Changed stuff
Diffstat (limited to 'modern/src/map')
-rw-r--r--modern/src/map/Map.js2
-rw-r--r--modern/src/map/SelectedDeviceMap.js4
-rw-r--r--modern/src/map/mapUtil.js8
3 files changed, 7 insertions, 7 deletions
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);