Skip to content

Commit

Permalink
Routing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sookoll committed Jan 10, 2019
1 parent f82f150 commit f140d59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/geop/components/routing/Routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import log from 'Utilities/log'
import { uid } from 'Utilities/util'
import { createMarker } from 'Components/mouseposition/MousePosition'
import { createLayer } from 'Components/layer/LayerCreator'
import { toLonLat } from 'ol/proj'
import { toLonLat, fromLonLat } from 'ol/proj'
import Polyline from 'ol/format/Polyline'
import $ from 'jquery'

Expand Down Expand Up @@ -87,8 +87,8 @@ class Routing extends Component {
const coords = getState('routing/stops')
findRoute(coords).then(route => {
const routeCoords = route.getGeometry().getCoordinates()
routeCoords.unshift(this.state.from)
routeCoords.push(this.state.to)
routeCoords.unshift(fromLonLat(coords[0], getState('map/projection')))
routeCoords.push(fromLonLat(coords[coords.length - 1], getState('map/projection')))
route.getGeometry().setCoordinates(routeCoords)
}).catch(e => {})
}
Expand Down

0 comments on commit f140d59

Please sign in to comment.