@@ -4,21 +4,34 @@ function InitializeMapAndData() {
44 // Initialize Map
55
66 var map = L . map ( 'map' , { zoomControl : true } ) ;
7-
8- L . tileLayer ( 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager_nolabels/{z}/{x}/{y}{r}.png' , {
7+
8+ /* L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/voyager_nolabels/{z}/{x}/{y}{r}.png', {
99 attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>',
1010 subdomains: 'abcd',
1111 maxZoom: 20
1212 }).addTo(map);
13-
14-
15- L . tileLayer ( 'https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}{r}.png' , {
16- attribution : '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/">CARTO</a>' ,
17- subdomains : 'abcd' ,
18- maxZoom : 20
19- } ) . addTo ( map ) ;
20-
21-
13+ */
14+
15+ L . tileLayer ( 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png' , {
16+ attribution : '© <a href="https://www.openstreetmap.org/copyright">OSM</a> & CartoDB' ,
17+ subdomains : 'abcd' ,
18+ maxZoom : 19
19+ } ) . addTo ( map ) ;
20+
21+
22+
23+
24+
25+
26+
27+
28+ L . tileLayer ( 'https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}{r}.png' , {
29+ attribution : '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/">CARTO</a>' ,
30+ subdomains : 'abcd' ,
31+ maxZoom : 20
32+ } ) . addTo ( map ) ;
33+
34+
2235 // Create bounds object
2336 var bounds = L . latLngBounds ( ) ;
2437
@@ -37,15 +50,15 @@ L.tileLayer('https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}{r}.
3750 document . getElementById ( "product-name" ) . textContent = data . productName ;
3851 document . getElementById ( "product-category" ) . textContent = data . category ;
3952 const options = { day : '2-digit' , month : '2-digit' , year : 'numeric' } ;
40- document . getElementById ( "production-date" ) . textContent =
53+ document . getElementById ( "production-date" ) . textContent =
4154 new Date ( data . productionDate ) . toLocaleDateString ( "de-DE" , options ) ;
42-
55+
4356 document . getElementById ( "best-before" ) . textContent = new Date ( data . bestBefore ) . toLocaleDateString ( ) ;
4457 document . getElementById ( "company-name" ) . textContent = data . productOwner . companyName ;
4558 //document.getElementById("product-image").src = data.imageSrc;
4659 document . getElementById ( "product-image" ) . src = data . imageSrc !== "string" ? data . imageSrc : "https://via.placeholder.com/100" ;
4760
48-
61+
4962
5063 // Load Certificates
5164 let certificateContainer = document . getElementById ( "certificates" ) ;
@@ -120,7 +133,7 @@ L.tileLayer('https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}{r}.
120133 const midpointLatLng = [ midpointY , midpointX ] ;
121134
122135 const pathOptions = {
123- color : '#6ed391 ' ,
136+ color : '#3c8138 ' ,
124137 weight : 2 ,
125138 opacity : 0.8 ,
126139 } ;
@@ -167,7 +180,7 @@ L.tileLayer('https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}{r}.
167180 if ( i < latlngs . length ) {
168181 animatedLine . addLatLng ( latlngs [ i ] ) ;
169182
170-
183+
171184 i ++ ;
172185 } else {
173186 clearInterval ( interval ) ;
@@ -186,7 +199,7 @@ L.tileLayer('https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}{r}.
186199 if ( bounds . isValid ( ) ) {
187200 //map.fitBounds(bounds);
188201 const zoom = map . getBoundsZoom ( bounds ) ;
189- map . setView ( bounds . getCenter ( ) , zoom - 0.5 ) ; // Zoom um 1 verringert
202+ map . setView ( bounds . getCenter ( ) , zoom - 0.5 ) ; // Zoom um 1 verringert
190203
191204 } else {
192205 console . warn ( "No valid coordinates found." ) ;
0 commit comments