Skip to content

Commit

Permalink
fix: select the first marker on map view so there can't be orders mad…
Browse files Browse the repository at this point in the history
…e with empty pickup location
  • Loading branch information
EdieLemoine committed Dec 5, 2019
1 parent 88f7e48 commit 2e46b66
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/Pickup/Map/Leaflet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ export default {
this.fitToMarkers();
this.createCenterMarker();
this.addMapEvents();
this.selectFirstMarker();
});
},
Expand Down Expand Up @@ -362,6 +364,15 @@ export default {
getChoiceByMarkerId(id) {
return this.data.choices.find((choice) => choice.name === id);
},
/**
* Select the first marker in the choices list.
*/
selectFirstMarker() {
const firstChoice = this.markers[0];
this.selectedMarker = this.selectMarker(firstChoice);
},
},
};
</script>

0 comments on commit 2e46b66

Please sign in to comment.