Skip to content

Commit 2291686

Browse files
improve(Map): Larger Icons
1 parent 13f7af6 commit 2291686

File tree

1 file changed

+11
-24
lines changed

1 file changed

+11
-24
lines changed

world-map/generate.py

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,13 @@
3535
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
3636
}).addTo(map);
3737
38-
const greenIcon = L.icon({
39-
iconUrl: '/marker/green.png',
40-
iconSize: [25, 41],
41-
iconAnchor: [12, 41],
42-
popupAnchor: [1, -34]
43-
});
44-
45-
const grayIcon = L.icon({
46-
iconUrl: '/marker/gray.png',
47-
iconSize: [25, 41],
48-
iconAnchor: [12, 41],
49-
popupAnchor: [1, -34]
50-
});
38+
const iconSize = [35, 57]
39+
const iconAnchor = [16.6, 57.4]
40+
const popupAnchor = [1, -30]
5141
52-
const blueIcon = L.icon({
53-
iconUrl: '/marker/blue.png',
54-
iconSize: [25, 41],
55-
iconAnchor: [12, 41],
56-
popupAnchor: [1, -34]
57-
});
42+
const greenIcon = L.icon({ iconUrl: '/marker/green.png', iconSize, iconAnchor, popupAnchor });
43+
const grayIcon = L.icon({ iconUrl: '/marker/gray.png', iconSize, iconAnchor, popupAnchor });
44+
const blueIcon = L.icon({ iconUrl: '/marker/blue.png', iconSize, iconAnchor, popupAnchor });
5845
5946
const currentDate = new Date();
6047
const projects = $projects
@@ -66,12 +53,12 @@
6653
return L.divIcon({
6754
className: 'custom-marker',
6855
html: `<div style="position: relative;">
69-
<img src="$${baseIcon.options.iconUrl}" style="width: 25px; height: 41px;">
70-
<img src="$${overlayUrl}" style="position: absolute; top: 5px; left: 5px; width: 15px; height: 15px; border-radius: 50%; background: white;">
56+
<img src="${baseIcon.options.iconUrl}" style="width: 35px; height: 57px;">
57+
<img src="${overlayUrl}" style="position: absolute; top: 4px; left: 4px; width: 27px; height: 27px; border-radius: 50%; background: white;">
7158
</div>`,
72-
iconSize: [25, 41],
73-
iconAnchor: [12, 41],
74-
popupAnchor: [1, -34]
59+
iconSize,
60+
iconAnchor,
61+
popupAnchor
7562
});
7663
}
7764

0 commit comments

Comments
 (0)