mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
18 lines
340 B
JavaScript
18 lines
340 B
JavaScript
'use strict'
|
|
|
|
const formatCoord = require('./coord')
|
|
|
|
const formatPoi = (latitude, longitude, id, name) => {
|
|
if (!latitude || !longitude || !id || !name) throw new Error('invalid poi.')
|
|
return {
|
|
type: 'P',
|
|
name,
|
|
lid: 'L=' + id,
|
|
crd: {
|
|
x: formatCoord(longitude),
|
|
y: formatCoord(latitude)
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = formatPoi
|