We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba6f4e6 commit 51ba0cbCopy full SHA for 51ba0cb
js/tracker.js
@@ -1182,13 +1182,14 @@ var mapInfoBox_handle_path = function(event) {
1182
1183
var mapInfoBox_handle_path_fetch = function(id,vehicle) {
1184
$.getJSON("http://spacenear.us/tracker/datanew.php?mode=single&format=json&position_id=" + id, function(data) {
1185
- data = data.positions.position[0];
1186
-
1187
- if(data.length === 0) {
1188
- box.setContent("unable to find data");
+ if('positions' in data && data.positions.position.length === 0) {
+ mapInfoBox.setContent("not found");
+ mapInfoBox.open(map);
1189
return;
1190
}
1191
+ data = data.positions.position[0];
1192
+
1193
div = document.createElement('div');
1194
1195
html = "<div style='line-height:16px'>";
0 commit comments