Skip to content

Commit

Permalink
use util functions from dev branch
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-willis-arcadis committed Mar 11, 2025
1 parent d69c421 commit ddb4352
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
8 changes: 8 additions & 0 deletions lib/common/util/text.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @flow

import toLower from 'lodash/toLower'
import upperFirst from 'lodash/upperFirst'

export default function toSentenceCase (s: string): string {
return upperFirst(toLower(s))
}
15 changes: 10 additions & 5 deletions lib/editor/util/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ type R5Response = {
}>
}

export const stopIsOutOfBounds = (stop: GtfsStop, bounds: any) => {
return stop.stop_lat > bounds.getNorth() ||
stop.stop_lat < bounds.getSouth() ||
stop.stop_lon > bounds.getEast() ||
stop.stop_lon < bounds.getWest()
export const coordIsOutOfBounds = (coords: LatLng, bounds: Bounds) => {
if (!coords || !coords.lat || !coords.lng || !bounds) return true

return coords.lat > bounds.getNorth() ||
coords.lat < bounds.getSouth() ||
coords.lng > bounds.getEast() ||
coords.lng < bounds.getWest()
}
export const stopIsOutOfBounds = (stop: GtfsStop, bounds: Bounds) => {
return coordIsOutOfBounds({lat: stop.stop_lat, lng: stop.stop_lon}, bounds)
}

export const getStopIcon = (
Expand Down

0 comments on commit ddb4352

Please sign in to comment.