Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverheilig committed Aug 14, 2019
2 parents 7fc7ddc + 26c2fdd commit bf29f60
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
36 changes: 19 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta charset="utf-8" />
<title>Feature Layer Labs</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/Control.FullScreen.css" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet-routing-machine.css" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/css/leaflet-sidebar.min.css" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.contextmenu.min.css">
Expand Down Expand Up @@ -77,11 +78,11 @@
</head>

<body>
<div class="github-fork-ribbon-wrapper right-bottom">
<!-- <div class="github-fork-ribbon-wrapper right-bottom">
<div class="github-fork-ribbon">
<a href="https://github.com/ptv-logistics/fl-labs/">Fork me on GitHub</a>
<a href="https://github.com/ptv-logistics/fl-labs/" target="_blank">Fork me on GitHub</a>
</div>
</div>
</div> -->
<div id="sidebar" class="sidebar collapsed">
<!-- Nav tabs -->
<ul class="sidebar-tabs" role="tablist">
Expand All @@ -106,26 +107,13 @@ <h3>
<option>Karlsruhe</option>
</select>
</p>
<p>
<div>
Paste an xRoute request here and extract the coordinates
<textarea id="RequestInput" rows="1" ></textarea><button onclick="parseRequest()">Parse</button>
</div>
</p>
<div style="margin: 10px 0px 10px 0px;">
<div>Consider layers for routing:</div>
<div><input type="checkbox" id="enableTrafficIncidents" onchange="updateParams()">Traffic Incidents</div>
<div><input type="checkbox" id="enableSpeedPatterns" onchange="updateParams()">Speed Patterns</div>
<div><input type="checkbox" id="enableTruckAttributes" onchange="updateParams()">Truck Attributes</div>
<div><input type="checkbox" id="enableRestrictionZones" onchange="updateParams()">Restriction Zones</div>
</div>
<div style="margin: 10px 0px 10px 0px;">
<div>Select time of day</div>
<input id="range" type="text" style="width:120" onchange="updateParams(true)" />
<label for="utc">Z</label>
<input id="utc" type="number" onchange="updateParams(true)" style="width:32px" />
<button onclick="setNow()">Now</button>
</div>
<div style="margin: 10px 0px 10px 0px;">
Routing Profile
<select id="routingProfile" onchange="updateParams()">
Expand All @@ -140,6 +128,14 @@ <h3>
<option>pedestrian</option>
</select>
</div>
<div style="margin: 10px 0px 10px 0px;">
<div>Select time of day</div>
<input id="range" type="text" style="width:120" onchange="updateParams(true)" />
<label for="utc">Z</label>
<input id="utc" type="number" onchange="updateParams(true)" style="width:32px" />
<button onclick="setNow()">Now</button>
</div>
<p>
<div style="margin: 10px 0px 10px 0px;">
Itinerary Language
<select id="languageSelect" onchange="updateParams()">
Expand All @@ -165,7 +161,6 @@ <h3>
<option>PT</option>
</select>
</div>
</p>
<div><input type="checkbox" id="useImperial" onchange="updateParams(true)">Show imperial units</div>
</p>
<div><input type="checkbox" id="dynamicTimeOnStaticRoute" onchange="updateParams(false)">Show static Route
Expand Down Expand Up @@ -193,6 +188,12 @@ <h3>
<button onclick="replay()">Replay</button>
<input type="checkbox" id="doLoop" onchange="replay()">Loop
</div>
<p>
<div>
Paste an xRoute request here and extract the coordinates
<textarea id="RequestInput" rows="1" ></textarea><button onclick="parseRequest()">Parse</button>
</div>
</p>
</div>
</div>
<div class="sidebar-pane" id="about">
Expand Down Expand Up @@ -232,6 +233,7 @@ <h3>Data Driven Documents</h3>

<script src="https://unpkg.com/[email protected]/dist/jquery.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script src="https://unpkg.com/[email protected]/Control.FullScreen.js"></script>
<script src="https://unpkg.com/[email protected]/dist/NonTiledLayer.js"></script>
<script src="https://unpkg.com/[email protected]/dist/leaflet-routing-machine.js"></script>
<script src="https://unpkg.com/[email protected]/dist/Control.Geocoder.js"></script>
Expand Down
12 changes: 7 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ var itineraryLanguage = 'EN';
var routingProfile = 'truckfast';
var replaySpeed = 100;
var responses = null;
var doLoop = false;
var doLoop = true;
var scenario = 'New York';
var useImperial = false;

var map = L.map('map', {
minZoom: 6,
zoomControl: false,
contextmenu: true,
contextmenuWidth: 200,
fullscreenControl: true,
fullscreenControlOptions: {
fullscreenElement: document.getElementById('map').parentNode // needed for sidebar!
},
contextmenuItems: [{
text: 'Add Waypoint At Start',
callback: function (ev) {
Expand Down Expand Up @@ -123,9 +126,8 @@ L.control.layers(baseLayers, {
position: 'topleft'
}).addTo(map);

new L.Control.Zoom({
position: 'bottomleft'
}).addTo(map);
// add scale control
L.control.scale().addTo(map);

var indSelf = false;

Expand Down

0 comments on commit bf29f60

Please sign in to comment.