Skip to content

Commit 6dce048

Browse files
changed latLong --> latLon, corrected locomotiv --> locomotive
1 parent e6cc553 commit 6dce048

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)