@@ -8,78 +8,102 @@ The venue is **[BioCity Turku](https://biocityturku.fi/)**.
88
99
1010``` {r}
11+ #| label: map
1112#| echo: false
1213#| message: false
1314#| warning: false
1415
1516library(leaflet)
17+ library(dplyr)
1618
1719places <- data.frame(
18- name = c(
19- "BioCity Turku (venue)",
20- "Kupittaa railway station",
21- "Turku Central railway station",
22- "Turku bus station"
23- ),
24- lat = c(
25- 60.449245, # BioCity Turku
26- 60.450278, # Kupittaa station
27- 60.456560, # Turku Central station
28- 60.456720 # Turku bus station
29- ),
30- lng = c(
31- 22.293052,
32- 22.296944,
33- 22.260760,
34- 22.266810
35- )
36- )
20+ name = c(
21+ "BioCity Turku (venue)",
22+ "Kupittaa railway station",
23+ "Turku Central railway station",
24+ "Turku bus station"
25+ ),
26+ lat = c(60.449245, 60.450278, 60.456560, 60.456720),
27+ lng = c(22.293052, 22.296944, 22.260760, 22.266810)
28+ ) |>
29+ mutate(is_venue = grepl("venue", name, ignore.case = TRUE))
3730
3831leaflet(places) |>
39- addProviderTiles("OpenStreetMap.Mapnik") |>
40-
41- # Blue markers
42- addCircleMarkers(
43- ~lng, ~lat,
44- radius = 8,
45- color = "#2b7bff",
46- fillColor = "#2b7bff",
47- fillOpacity = 0.9,
48- stroke = FALSE
49- ) |>
50-
51- # Text always visible
52- addLabelOnlyMarkers(
53- ~lng, ~lat,
54- label = ~name,
55- labelOptions = labelOptions(
56- noHide = TRUE,
57- direction = "top",
58- textOnly = TRUE,
59- style = list(
60- "font-size" = "12px",
61- "font-weight" = "bold",
62- "color" = "#2b2b2b",
63- "background-color" = "rgba(255,255,255,0.85)",
64- "padding" = "2px 4px",
65- "border-radius" = "4px"
66- )
32+ addProviderTiles("OpenStreetMap.Mapnik") |>
33+ # Other places (secondary, but clearly visible)
34+ addCircleMarkers(
35+ data = filter(places, !is_venue),
36+ ~lng, ~lat,
37+ radius = 7,
38+ color = "#4a5568",
39+ fillColor = "#4a5568",
40+ fillOpacity = 0.8,
41+ stroke = FALSE
42+ ) |>
43+ addLabelOnlyMarkers(
44+ data = filter(places, !is_venue),
45+ ~lng, ~lat,
46+ label = ~name,
47+ labelOptions = labelOptions(
48+ noHide = TRUE,
49+ direction = "top",
50+ textOnly = TRUE,
51+ style = list(
52+ "font-size" = "12px",
53+ "font-weight" = "500",
54+ "color" = "#2d3748",
55+ "background-color" = "rgba(255,255,255,0.8)",
56+ "padding" = "3px 5px",
57+ "border-radius" = "4px"
58+ )
59+ )
60+ ) |>
61+ # Venue halo
62+ addCircleMarkers(
63+ data = filter(places, is_venue),
64+ ~lng, ~lat,
65+ radius = 22,
66+ color = "#2b7bff",
67+ fillColor = "#2b7bff",
68+ fillOpacity = 0.18,
69+ stroke = FALSE
70+ ) |>
71+ # Venue core
72+ addCircleMarkers(
73+ data = filter(places, is_venue),
74+ ~lng, ~lat,
75+ radius = 11,
76+ color = "#1f5eff",
77+ fillColor = "#1f5eff",
78+ fillOpacity = 1,
79+ stroke = FALSE
80+ ) |>
81+ # Venue label
82+ addLabelOnlyMarkers(
83+ data = filter(places, is_venue),
84+ ~lng, ~lat,
85+ label = ~name,
86+ labelOptions = labelOptions(
87+ noHide = TRUE,
88+ direction = "top",
89+ offset = c(0, -16),
90+ textOnly = TRUE,
91+ style = list(
92+ "font-size" = "15px",
93+ "font-weight" = "bold",
94+ "color" = "#1a365d",
95+ "background-color" = "rgba(255,255,255,0.95)",
96+ "padding" = "5px 7px",
97+ "border-radius" = "6px",
98+ "box-shadow" = "0 0 6px rgba(43,123,255,0.5)"
99+ )
100+ )
101+ ) |>
102+ fitBounds(
103+ lng1 = min(places$lng), lat1 = min(places$lat),
104+ lng2 = max(places$lng), lat2 = max(places$lat)
67105 )
68- ) |>
69-
70- # Optional hover popup
71- addPopups(
72- ~lng, ~lat,
73- popup = ~name
74- ) |>
75-
76- fitBounds(
77- lng1 = min(places$lng), lat1 = min(places$lat),
78- lng2 = max(places$lng), lat2 = max(places$lat)
79- )
80-
81106```
82- <!-- <iframe width="425" height="350" src="https://www.openstreetmap.org/export/embed.html?bbox=22.29103982448578%2C60.448813382240864%2C22.29458034038544%2C60.450019815404964&layer=mapnik&marker=60.44941660442382%2C22.292810082435608" style="border: 1px solid black"></iframe><br/><small><a href="https://www.openstreetmap.org/?mlat=60.449417&mlon=22.292810#map=19/60.449417/22.292810">View Larger Map</a></small> -->
83107
84108## How to travel to Turku
85109
0 commit comments