Skip to content

Commit 7a6e6c6

Browse files
committed
Automatic merge of T1.5-111-g71c1114b7 and 14 pull requests
- Pull request #652 at 918fdb1: Add button functions to Raildriver - Pull request #706 at 570ab21: Extended door functionality - Pull request #713 at 6ca89da: https://blueprints.launchpad.net/or/+spec/cruise-control - Pull request #719 at 13a1638: Upgraded to MonoGame 3.8.0 (+ small update for other libraries) - Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor - Pull request #732 at 9cffa6d: Improvements for air brakes - Pull request #733 at 72947b0: Fixed battery switch sound being repeted - Pull request #734 at 8f8484c: Fixed battery switch timer not working properly - Pull request #740 at b3e66ca: Refactored the circuit breaker and the traction cut-off relay in order to use the same design pattern as the C# signal scripts (compatible with current scripts) - Pull request #741 at 2dd56ad: Fixed brake controller script not being loaded in timetable mode - Pull request #744 at 3c2dc07: Fixed and improved cabview control conditions related to power supply state - Pull request #746 at 0857d9b: Website release 1.5 - Pull request #748 at 4f0e878: latitude/longitude fix for bug 1393111 - Pull request #749 at 2220414: OpenRailway Map
16 parents e009ff5 + 71c1114 + 918fdb1 + 570ab21 + 6ca89da + 13a1638 + fb9079e + 9cffa6d + 72947b0 + 8f8484c + b3e66ca + 2dd56ad + 3c2dc07 + 0857d9b + 4f0e878 + 2220414 commit 7a6e6c6

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

Source/RunActivity/Viewer3D/WebServices/Web/Map/index.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ var xmlHttpRequestCodeDone = 4;
2222

2323
var locomotivMarker;
2424
var map;
25-
var latLongPrev = [0, 0];
25+
var latLonPrev = [0, 0];
2626

27-
function MapInit(latLong) {
27+
function MapInit(latLon) {
2828

29-
map = L.map('map').setView(latLong, 13);
29+
map = L.map('map').setView(latLon, 13);
3030
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
3131
maxZoom: 19,
3232
attribution: 'Map data: &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
@@ -46,33 +46,33 @@ function ApiMap() {
4646
if (this.readyState == xmlHttpRequestCodeDone && this.status == httpCodeSuccess) {
4747
var responseText = JSON.parse(hr.responseText);
4848
if (responseText.length > 0) {
49-
latLong = responseText.split(" ");
49+
latLon = responseText.split(" ");
5050
if (typeof locomotivMarker !== 'undefined') {
51-
if ((latLong[0] != latLongPrev[0]) && (latLong[1] != latLongPrev[1])) {
52-
map.panTo(latLong);
51+
if ((latLon[0] != latLonPrev[0]) && (latLon[1] != latLonPrev[1])) {
52+
map.panTo(latLon);
5353
}
5454
} else {
55-
MapInit(latLong);
55+
MapInit(latLon);
5656
}
5757

58-
if ((latLong[0] != latLongPrev[0]) || (latLong[1] != latLongPrev[1])) {
58+
if ((latLon[0] != latLonPrev[0]) || (latLon[1] != latLonPrev[1])) {
5959
if (typeof locomotivMarker !== 'undefined') {
6060
locomotivMarker.removeFrom(map);
6161
}
6262
locomotivMarker = L.marker(
63-
latLong,
63+
latLon,
6464
{ icon: myIcon }
6565
).addTo(map);
66-
latLongPrev[0] = latLong[0];
67-
latLongPrev[1] = latLong[1];
66+
latLonPrev[0] = latLon[0];
67+
latLonPrev[1] = latLon[1];
6868
}
6969
}
7070
}
7171
}
7272
}
7373

7474
var myIcon = L.icon({
75-
iconUrl: 'locomotiv.png',
75+
iconUrl: 'locomotive.png',
7676
iconSize: [29, 24],
7777
iconAnchor: [9, 21],
7878
})

Source/RunActivity/Viewer3D/WebServices/WebServer.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,14 @@ internal class ORTSApiController : WebApiController
114114
/// The Viewer to serve train data from.
115115
/// </summary>
116116
private readonly Viewer Viewer;
117-
private bool latLongCorrToBeRead = true;
118117
protected WorldLocation cameraLocation = new WorldLocation();
119118

120119
public ORTSApiController(Viewer viewer)
121120
{
122121
Viewer = viewer;
123122
}
124123

125-
public string getLatLong()
124+
public string getLatLon()
126125
{
127126
double latitude = 0;
128127
double longitude = 0;
@@ -275,7 +274,7 @@ IEnumerable<string> GetValues()
275274

276275
#region /API/MAP
277276
[Route(HttpVerbs.Get, "/MAP")]
278-
public string LatLong() => getLatLong();
277+
public string LatLon() => getLatLon();
279278
#endregion
280279
}
281280
}

0 commit comments

Comments
 (0)