From 655fb62e926319581f66664178efd629ab67b016 Mon Sep 17 00:00:00 2001 From: Sven Carstensen Date: Mon, 18 Aug 2025 14:31:13 +0200 Subject: [PATCH] Erweiterungen --- .../votianlt/pages/view/JobSummaryView.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/assecutor/votianlt/pages/view/JobSummaryView.java b/src/main/java/de/assecutor/votianlt/pages/view/JobSummaryView.java index a54b32d..c8a9d39 100644 --- a/src/main/java/de/assecutor/votianlt/pages/view/JobSummaryView.java +++ b/src/main/java/de/assecutor/votianlt/pages/view/JobSummaryView.java @@ -246,19 +246,31 @@ public class JobSummaryView extends Main implements HasUrlParameter { " }, function(res, status){ if(status==='OK'){ " + " infoEl.innerHTML='';" + " var bounds = new google.maps.LatLngBounds();" + + " var renderers = []; var polylines = [];" + " res.routes.forEach(function(route, idx){" + - " var dr = new google.maps.DirectionsRenderer({map: map, preserveViewport: idx>0, polylineOptions:{strokeColor: idx===0?'#1976d2':'#9e9e9e', strokeOpacity: 0.9}});" + + " var dr = new google.maps.DirectionsRenderer({map: map, preserveViewport: idx>0, suppressMarkers:false, suppressPolylines:true});" + " dr.setRouteIndex(idx); dr.setDirections(res);" + + " renderers.push(dr);" + + " var path = route.overview_path || [];" + + " var poly = new google.maps.Polyline({path: path, strokeColor: idx===0?'#1976d2':'#90caf9', strokeOpacity: 0.95, strokeWeight: idx===0?6:4});" + + " poly.setMap(map); polylines.push(poly);" + " var leg = route.legs && route.legs[0];" + " if (leg) {" + " var dur = leg.duration ? leg.duration.text : '';" + " var durT = leg.duration_in_traffic ? leg.duration_in_traffic.text : '';" + " var dist = leg.distance ? leg.distance.text : '';" + " var alt = (idx===0?'Schnellste Route':'Alternative '+idx);" + - " var row = document.createElement('div'); row.style.margin='4px 0';" + + " var row = document.createElement('div'); row.style.margin='4px 0'; row.style.cursor='pointer';" + " row.textContent = alt + ': ' + dist + ' • Dauer: ' + dur + (durT?(' (mit Verkehr: '+durT+')'):'');" + + " row.onmouseenter = function(){" + + " polylines.forEach(function(p,i){ p.setOptions({strokeColor: i===0?'#90caf9':'#e3f2fd', strokeOpacity: 0.6, strokeWeight: 3}); });" + + " poly.setOptions({strokeColor:'#0d47a1', strokeOpacity:1, strokeWeight:7});" + + " };" + + " row.onmouseleave = function(){" + + " polylines.forEach(function(p,i){ p.setOptions({strokeColor: i===0?'#1976d2':'#90caf9', strokeOpacity:0.95, strokeWeight: i===0?6:4}); });" + + " };" + " infoEl.appendChild(row);" + - " if (leg.steps) { leg.steps.forEach(function(s){ bounds.extend(s.start_location); bounds.extend(s.end_location); }); }" + + " if (path && path.length){ path.forEach(function(pt){ bounds.extend(pt); }); }" + " }" + " });" + " if (!bounds.isEmpty()) { map.fitBounds(bounds); }" +