File tree Expand file tree Collapse file tree 6 files changed +84
-2
lines changed
Expand file tree Collapse file tree 6 files changed +84
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,31 @@ window.initializeInteractiveMap = function() {
2222 panzoom . zoomIn ( { step : 0.5 } ) ;
2323 } ) ;
2424
25+ const zoomInBtn = document . querySelector ( '.o-interactive-map__zoom-in' ) ;
26+ const zoomOutBtn = document . querySelector ( '.o-interactive-map__zoom-out' ) ;
27+ const resetBtn = document . querySelector ( '.o-interactive-map__reset' ) ;
28+
29+ if ( zoomInBtn ) {
30+ zoomInBtn . addEventListener ( 'click' , ( e ) => {
31+ e . preventDefault ( ) ;
32+ panzoom . zoomIn ( { step : 0.5 } ) ;
33+ } ) ;
34+ }
35+
36+ if ( zoomOutBtn ) {
37+ zoomOutBtn . addEventListener ( 'click' , ( e ) => {
38+ e . preventDefault ( ) ;
39+ panzoom . zoomOut ( { step : 0.5 } ) ;
40+ } ) ;
41+ }
42+
43+ if ( resetBtn ) {
44+ resetBtn . addEventListener ( 'click' , ( e ) => {
45+ e . preventDefault ( ) ;
46+ panzoom . reset ( ) ;
47+ } ) ;
48+ }
49+
2550 // Add country click functionality
2651 const countries = svg . querySelectorAll ( '[id]' ) ;
2752 countries . forEach ( country => {
Original file line number Diff line number Diff line change 11.o-interactive-map {
2+ & __wrapper {
3+ position : relative ;
4+ }
5+
26 & __container {
37 border-radius : var (--border-radius-m );
48 box-shadow : var (--box-shadow );
1115 }
1216 }
1317
18+ & __controls {
19+ position : absolute ;
20+ bottom : 1rem ;
21+ right : 1rem ;
22+ display : flex ;
23+ flex-direction : column ;
24+ gap : 0.5rem ;
25+ z-index : 10 ;
26+ }
27+
1428 .o-interactive-map__country--available {
1529 path {
1630 fill : var (--link-default ) !important ;
2640 .o-interactive-map--loading {
2741 padding : 1rem ;
2842 }
43+
44+ .o-interactive-map__controls button {
45+ background-color : var (--link-default );
46+ color : var (--bg-neutral );
47+ border-radius : var (--border-radius-m );
48+ border : 0 ;
49+ width : 4rem ;
50+ aspect-ratio : 1 / 1 ;
51+ display : flex ;
52+ align-items : center ;
53+ justify-content : center ;
54+ font-size : 3rem ;
55+ transition : all 0.2s ease ;
56+
57+ & :hover {
58+ background-color : var (--link-hovered );
59+ }
60+ }
2961}
Original file line number Diff line number Diff line change @@ -36,7 +36,10 @@ information-disclaimer-short: >-
3636 rechtliche Verbindung zu FIP oder Bahngesellschaften.
3737interactiveMap :
3838 loading : Lade interaktive Karte...
39+ resetZoom : Zoom zurücksetzen
3940 title : Interaktive Länderkarte
41+ zoomIn : Hineinzoomen
42+ zoomOut : Herauszoomen
4043menu-close : Schließen
4144menu-open : Menü
4245navigate-to-country : Gehe zu Land
Original file line number Diff line number Diff line change @@ -35,7 +35,10 @@ information-disclaimer-short: >-
3535 legal connection to FIP or railway companies.
3636interactiveMap :
3737 loading : Loading interactive map...
38+ resetZoom : Reset Zoom
3839 title : Interactive Country Map
40+ zoomIn : Zoom In
41+ zoomOut : Zoom Out
3942menu-close : Close
4043menu-open : Menu
4144navigate-to-country : Navigate to country
Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ home-page-text: Page d'accueil du FIP Guide
3030information-disclaimer-short : >-
3131 Les informations fournies sont non officielles et sans garantie. Il n'existe
3232 aucun lien juridique avec le FIP ou les compagnies ferroviaires.
33+ interactiveMap :
34+ loading : Chargement de la carte interactive...
35+ resetZoom : Réinitialiser le zoom
36+ title : Carte interactive des pays
37+ zoomIn : Zoom avant
38+ zoomOut : Zoom arrière
3339menu-close : Fermer
3440menu-open : Menu
3541navigate-to-country : Aller au pays
Original file line number Diff line number Diff line change @@ -20,8 +20,21 @@ <h2>{{ T "countries.overview" }}</h2>
2020 </ div >
2121 < div class ="o-interactive-map ">
2222 < h2 > {{ T "interactiveMap.title" }}</ h2 >
23- < div id ="interactive-map__container " class ="o-interactive-map__container ">
24- < p class ="o-interactive-map--loading "> < em > {{ T "interactiveMap.loading" }}</ em > </ p >
23+ < div class ="o-interactive-map__wrapper ">
24+ < div id ="interactive-map__container " class ="o-interactive-map__container ">
25+ < p class ="o-interactive-map--loading "> < em > {{ T "interactiveMap.loading" }}</ em > </ p >
26+ </ div >
27+ < div class ="o-interactive-map__controls ">
28+ < button class ="o-interactive-map__zoom-in " title ="{{ T "interactiveMap.zoomIn " }}" aria-label="{{ T "interactiveMap.zoomIn " }}">
29+ {{ partial "icon" "add" }}
30+ </ button >
31+ < button class ="o-interactive-map__zoom-out " title ="{{ T "interactiveMap.zoomOut " }}" aria-label="{{ T "interactiveMap.zoomOut " }}">
32+ {{ partial "icon" "remove" }}
33+ </ button >
34+ < button class ="o-interactive-map__reset " title ="{{ T "interactiveMap.resetZoom " }}" aria-label="{{ T "interactiveMap.resetZoom " }}">
35+ {{ partial "icon" "crop_free" }}
36+ </ button >
37+ </ div >
2538 </ div >
2639 </ div >
2740 </ div >
You can’t perform that action at this time.
0 commit comments