Erweiterungen
This commit is contained in:
@@ -246,19 +246,31 @@ public class JobSummaryView extends Main implements HasUrlParameter<String> {
|
||||
" }, 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); }" +
|
||||
|
||||
Reference in New Issue
Block a user