Skip to content

Commit

Permalink
added comments and resolve feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
CindyvdVries committed Sep 12, 2019
1 parent dfc2428 commit e5833a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/graph-line.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ export default {
type: {
type: String,
default: 'line',
validator: function(value) {
// The value must match one of these strings
return ['line', 'scatter'].indexOf(value) !== -1
},
},
},
data: () => ({
Expand Down
5 changes: 5 additions & 0 deletions layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,14 @@ export default {
return layer
},
selectLocations(detail) {
// On the selection (by mouse event on map) of a location update the
// route accordingly
this.geometry = detail.geometry
const { datasetIds } = this.$route.params
const locationIds = []
detail.features.forEach(feature => {
// When a layer has a metadata with locationIdField use this layer and
// get the locationId usin this field
const locId = _.get(feature, 'layer.metadata.locationIdField')
if (locId) {
locationIds.push(feature.properties[locId])
Expand Down Expand Up @@ -228,6 +232,7 @@ export default {
this.updateRoute(newRouteObject)
},
updateRoute(routeObj) {
// Update route with route object
const { datasetIds, locationId } = routeObj.params
if (datasetIds === undefined) {
this.geometry = {
Expand Down

0 comments on commit e5833a5

Please sign in to comment.