Skip to content

Commit 5a1e3a4

Browse files
author
dapetri
committed
improve layout
1 parent 0714927 commit 5a1e3a4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dafolio",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"private": true,
55
"dependencies": {
66
"@testing-library/jest-dom": "^5.16.5",

src/components/pages/Map.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const Map = () => {
1717
const [geojsonData, setGeojsonData] = useState(null);
1818

1919
const addNoise = (value) => {
20-
const noise = (Math.random() - 0.5) * 0.1; // ±0.0001 degrees
20+
const noise = (Math.random() - 0.5) * 0.08; // ±0.0001 degrees
2121
return value + noise;
2222
};
2323

@@ -88,7 +88,7 @@ export const Map = () => {
8888
source: "coordinates",
8989
layout: {
9090
"icon-image": "custom-pin",
91-
"icon-size": 0.07,
91+
"icon-size": 0.065,
9292
"icon-allow-overlap": true,
9393
"icon-anchor": "bottom",
9494
},
@@ -97,6 +97,8 @@ export const Map = () => {
9797
// Just update the source data if layer exists
9898
map.current.getSource("coordinates").setData(geojsonData);
9999
}
100+
const firstLayerId = map.current.getStyle().layers[0].id;
101+
map.current.moveLayer("points", firstLayerId);
100102
});
101103
};
102104

@@ -131,7 +133,7 @@ export const Map = () => {
131133
source: "user-location",
132134
layout: {
133135
"icon-image": "user-location",
134-
"icon-size": 0.07,
136+
"icon-size": 0.075,
135137
"icon-allow-overlap": true,
136138
"icon-anchor": "bottom",
137139
},
@@ -156,7 +158,7 @@ export const Map = () => {
156158
speed: 0.5, // Lower speed value makes movement slower
157159
});
158160
isInitialLoad = false;
159-
}, 3000);
161+
}, 2000);
160162
}
161163
};
162164

0 commit comments

Comments
 (0)