Skip to content

Commit

Permalink
feat: Enhance MapViewData constructor
Browse files Browse the repository at this point in the history
the constructor currently has no arguments at all.
- Enabled places to be passed as argument.
- preparation for MapViewData component test
  • Loading branch information
TheGreatRefrigerator committed Jan 26, 2023
1 parent 1ae02a1 commit b4767b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/models/map-view-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class MapViewData {
/**
* MapViewData constructor
*/
constructor () {
constructor ({places = []} = {}) {
this.polygons = []
this.options = {} // {origin: String, apiVersion: String, contentType: String, timestamp: timestamp, options: {avoid_polygons: Object, avoid_features: Array}},
this.places = [] // array of Place objects @see /src/models/place
this.places = places ? Place.placesFromFeatures(places) : [] // array of Place objects @see /src/models/place
this.pois = [] // array of Place objects @see /src/models/place
this.routes = [] // array of route objects containing route data and summary
this.origin = 'response' // where the data comes from
Expand Down

0 comments on commit b4767b9

Please sign in to comment.