Skip to content

Commit b7a75d7

Browse files
committed
fix chase cars not appearing
1 parent 54b0532 commit b7a75d7

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

js/tracker.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,7 +2311,20 @@ function addPosition(position) {
23112311
marker = new L.Marker(point, {
23122312
title: vcallsign,
23132313
zIndexOffset: Z_CAR,
2314-
}).addTo(map).on('click', onClick);
2314+
});
2315+
2316+
if(!!!window.HTMLCanvasElement) {
2317+
carIcon = L.icon({
2318+
iconUrl: image_src,
2319+
iconSize: image_src_size,
2320+
iconAnchor: [27.22],
2321+
tooltipAnchor: [0,-32],
2322+
});
2323+
marker.setIcon(new carIcon);
2324+
} else {
2325+
marker_rotate_setup(marker, image_src);
2326+
}
2327+
marker.addTo(map).on('click', onClick);
23152328

23162329
// Scroll list stuff here.
23172330
function onClick(e) {
@@ -2325,18 +2338,6 @@ function addPosition(position) {
23252338
refreshSingleNew(_vehicle_id);
23262339
};
23272340

2328-
if(!!!window.HTMLCanvasElement) {
2329-
carIcon = L.icon({
2330-
iconUrl: image_src,
2331-
iconSize: image_src_size,
2332-
iconAnchor: [27.22],
2333-
tooltipAnchor: [0,-32],
2334-
});
2335-
marker.setIcon(new carIcon);
2336-
} else {
2337-
marker_rotate_setup(marker, image_src);
2338-
}
2339-
marker.addTo(map);
23402341
polyline = [
23412342
new L.Polyline(point, {
23422343
color: car_colors[color_index],

0 commit comments

Comments
 (0)