Skip to content

Commit

Permalink
set incidents language
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverheilig committed Apr 3, 2021
1 parent da1c963 commit a151ae1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
12 changes: 11 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,18 @@ <h3>
<option>SV</option>
<option>PT</option>
</select>
</div>
<div style="margin: 10px 0px 10px 0px;">
incidents Language
<select id="flLanguage" onchange="updateParams(true)">
<option>EN</option>
<option>DE</option>
<option>FR</option>
<option>IT</option>
<option>NL</option>
</select>
</div>
<div><input type="checkbox" id="useImperial" onchange="updateParams(true)">Show imperial units</div>
<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
/w dynamic Time</div>
Expand Down
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var enableTruckAttributes = false;
var dynamicTimeOnStaticRoute = true;
var staticTimeOnStaticRoute = true;
var itineraryLanguage = 'EN';
var flLanguage = 'EN';
var routingProfile = 'truckfast';
var replaySpeed = 100;
var responses = null;
Expand Down Expand Up @@ -84,11 +85,12 @@ var getLayers = function (profile) {
imperial: useImperial,
beforeSend2: function (request) {
request.mapParams.referenceTime = hour.format();
// include time domain for incidents
// set language and include time domain for incidents
if (incidentsLayer.visible)
request.callerContext.properties.push({
'key': 'ProfileXMLSnippet',
'value': '<Profile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><FeatureLayer majorVersion="1" minorVersion="0"><GlobalSettings enableTimeDependency="true"/><Themes><Theme id="PTV_TrafficIncidents" enabled="true"><FeatureDescription includeTimeDomain="true" /></Theme></Themes></FeatureLayer></Profile>'
'value': '<Profile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Common language="'+ flLanguage
+ '" majorVersion="1" minorVersion="0"/><FeatureLayer majorVersion="1" minorVersion="0"><GlobalSettings enableTimeDependency="true"/><Themes><Theme id="PTV_TrafficIncidents" enabled="true"><FeatureDescription includeTimeDomain="true" /></Theme></Themes></FeatureLayer></Profile>'
});
}
});
Expand Down Expand Up @@ -197,6 +199,7 @@ $('#dynamicTimeOnStaticRoute').attr('checked', dynamicTimeOnStaticRoute);
$('#useImperial').attr('checked', useImperial);
$('#staticTimeOnStaticRoute').attr('checked', staticTimeOnStaticRoute);
$('#languageSelect').val(itineraryLanguage);
$('#flLanguage').val(flLanguage);
$('#routingProfile').val(routingProfile);
$('#replaySpeed').val(replaySpeed);
$('#doLoop').attr('checked', doLoop);
Expand Down Expand Up @@ -291,6 +294,7 @@ var updateParams = function (refreshFeatureLayer) {
dynamicTimeOnStaticRoute = $('#dynamicTimeOnStaticRoute').is(':checked');
staticTimeOnStaticRoute = $('#staticTimeOnStaticRoute').is(':checked');
itineraryLanguage = $('#languageSelect option:selected').val();
flLanguage = $('#flLanguage option:selected').val();
useImperial = $('#useImperial').is(':checked');
routingProfile = $('#routingProfile option:selected').val();

Expand Down

0 comments on commit a151ae1

Please sign in to comment.