Skip to content

Commit d971ef6

Browse files
committed
Only connect markers for journeys
1 parent 7ecbb84 commit d971ef6

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/main/handlebars/content.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ parent: feed
5656
{{/with}}
5757
{{/each}}
5858
59-
mapping.project(document.querySelector('#map'));
59+
mapping.project(document.querySelector('#map'), false);
6060
6161
// Update statistics
6262
{{&use 'statistics'}}

src/main/handlebars/journey.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ parent: feed
100100
{{/each}}
101101
{{/each}}
102102
103-
mapping.project(document.querySelector('#map'));
103+
mapping.project(document.querySelector('#map'), true);
104104
105105
// To determine which entries the user has spent time viewing, use intersection observer
106106
{{&use 'statistics'}}

src/main/handlebars/journeys.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
{{/each}}
4747
{{/each}}
4848
49-
mapping.project(document.querySelector('#map'));
49+
mapping.project(document.querySelector('#map'), false);
5050
</script>
5151
{{/inline}}
5252
{{/layout}}

src/main/js/mapping.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Mapping {
3232
}
3333

3434
/** Project this map on to a given DOM element */
35-
project($element) {
35+
project($element, connect) {
3636
const map = new ol.Map({
3737
target: $element,
3838
layers: [new ol.layer.Tile({source: new ol.source.OSM()})]
@@ -44,7 +44,7 @@ class Mapping {
4444
const features = new ol.source.Vector({features: this.#features});
4545

4646
// If there is more than one coordinate, connect with dotted lines
47-
if (this.#coords.length > 1) {
47+
if (connect && this.#coords.length > 1) {
4848
const line = new ol.Feature({geometry: new ol.geom.LineString(this.#coords)});
4949
line.setStyle(new ol.style.Style({
5050
stroke: new ol.style.Stroke({

0 commit comments

Comments
 (0)