fix: add transport_mode to entry JSON serialisation in all three map templates; note bbox approach in isNearTrack
This commit is contained in:
@@ -183,6 +183,9 @@
|
|||||||
if (Math.abs(pt[0] - markerLat) > degLat || Math.abs(pt[1] - markerLng) > degLng) continue;
|
if (Math.abs(pt[0] - markerLat) > degLat || Math.abs(pt[1] - markerLng) > degLng) continue;
|
||||||
if (haversineKm(markerLat, markerLng, pt[0], pt[1]) <= thresholdKm) return true;
|
if (haversineKm(markerLat, markerLng, pt[0], pt[1]) <= thresholdKm) return true;
|
||||||
}
|
}
|
||||||
|
// Always check the last point (may be skipped by stride=10).
|
||||||
|
// Note: per-point degree pre-filter in the loop is functionally equivalent
|
||||||
|
// to a per-file bounding-box skip at this data scale.
|
||||||
var last = trackpoints[trackpoints.length - 1];
|
var last = trackpoints[trackpoints.length - 1];
|
||||||
return haversineKm(markerLat, markerLng, last[0], last[1]) <= thresholdKm;
|
return haversineKm(markerLat, markerLng, last[0], last[1]) <= thresholdKm;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,8 @@
|
|||||||
'title': item.page.title,
|
'title': item.page.title,
|
||||||
'slug': item.page.slug,
|
'slug': item.page.slug,
|
||||||
'url': item.page.url,
|
'url': item.page.url,
|
||||||
'force_connect': item.page.header.force_connect ? true : false
|
'force_connect': item.page.header.force_connect ? true : false,
|
||||||
|
'transport_mode': item.page.header.transport_mode ? item.page.header.transport_mode : null
|
||||||
}]) %}
|
}]) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -28,7 +28,8 @@
|
|||||||
'date': entry.date|date('d M Y'),
|
'date': entry.date|date('d M Y'),
|
||||||
'url': entry.url,
|
'url': entry.url,
|
||||||
'hero': hero_url,
|
'hero': hero_url,
|
||||||
'force_connect': entry.header.force_connect ? true : false
|
'force_connect': entry.header.force_connect ? true : false,
|
||||||
|
'transport_mode': entry.header.transport_mode ? entry.header.transport_mode : null
|
||||||
}]) %}
|
}]) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -95,7 +95,8 @@
|
|||||||
'slug': item.page.slug,
|
'slug': item.page.slug,
|
||||||
'title': item.page.title,
|
'title': item.page.title,
|
||||||
'url': item.page.url,
|
'url': item.page.url,
|
||||||
'force_connect': item.page.header.force_connect ? true : false
|
'force_connect': item.page.header.force_connect ? true : false,
|
||||||
|
'transport_mode': item.page.header.transport_mode ? item.page.header.transport_mode : null
|
||||||
}]) %}
|
}]) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user