parsePolyline: profile param 💥

This commit is contained in:
Jannis R 2018-06-13 19:54:16 +02:00
parent a45d640272
commit 6ca7924f7b
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
3 changed files with 4 additions and 4 deletions

View file

@ -42,7 +42,7 @@ const createParseJourneyLeg = (profile, data) => {
let p = pt.jny.polyG.polyXL let p = pt.jny.polyG.polyXL
p = Array.isArray(p) && polylines[p[0]] p = Array.isArray(p) && polylines[p[0]]
// todo: there can be >1 polyline // todo: there can be >1 polyline
const parse = profile.parsePolyline(data) const parse = profile.parsePolyline(profile, data)
res.polyline = p && parse(p) || null res.polyline = p && parse(p) || null
} }

View file

@ -38,13 +38,13 @@ const createParseMovement = (profile, data) => {
} }
if (m.ani.poly) { if (m.ani.poly) {
const parse = profile.parsePolyline(data) const parse = profile.parsePolyline(profile, data)
res.polyline = parse(m.ani.poly) res.polyline = parse(m.ani.poly)
} else if (m.ani.polyG) { } else if (m.ani.polyG) {
let p = m.ani.polyG.polyXL let p = m.ani.polyG.polyXL
p = Array.isArray(p) && polylines[p[0]] p = Array.isArray(p) && polylines[p[0]]
// todo: there can be >1 polyline // todo: there can be >1 polyline
const parse = profile.parsePolyline(data) const parse = profile.parsePolyline(profile, data)
res.polyline = p && parse(p) || null res.polyline = p && parse(p) || null
} }
} }

View file

@ -3,7 +3,7 @@
const {toGeoJSON} = require('@mapbox/polyline') const {toGeoJSON} = require('@mapbox/polyline')
const distance = require('gps-distance') const distance = require('gps-distance')
const createParsePolyline = ({locations}) => { const createParsePolyline = (profile, {locations}) => {
// todo: what is p.delta? // todo: what is p.delta?
// todo: what is p.type? // todo: what is p.type?
// todo: what is p.crdEncS? // todo: what is p.crdEncS?