UNPKG

lml-main

Version:

This is now a mono repository published into many standalone packages.

26 lines 994 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const lodash_1 = require("lodash"); const cosmo_redux_api_1 = require("@lml/cosmo-redux-api"); const job_1 = require("./job"); exports.getJobMarker = (state, refId) => { const job = cosmo_redux_api_1.getJobById(state, refId); const collection = job_1.getCollectionStop(job); // HACK WARNING! the job stop position is not up to date // it uses an array for lat long instead of a struct // so we need to transform it to a normal PositionModel here const latitude = lodash_1.get(collection, 'location.position.coordinates[1]', null); const longitude = lodash_1.get(collection, 'location.position.coordinates[0]', null); if (!latitude || !longitude) { return null; } return { id: job.refId, title: '', position: { type: 'Point', coordinates: { latitude, longitude }, }, }; }; //# sourceMappingURL=locations.js.map