Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
...request,
ready: true,
transitive
}
})
// Set all the networks
fullNetworks.forEach(n => dispatch(setNetwork(n)))
try {
// Load the config start coordinate or the center
const centerFromMap = get(map, 'centerCoordinates', getCenterFromNetwork(fullNetworks[0]))
const centerCoordinates = startCoordinate || centerFromMap
const geocoder = {
proximity: lonlat.toString(centerFromMap)
}
const maxBounds = get(map, 'maxBounds')
if (maxBounds) {
geocoder.bbox = typeof maxBounds === 'string'
? maxBounds
: `${maxBounds[0].join(',')},${maxBounds[1].join(',')}`
}
dispatch({type: 'set geocoder', payload: geocoder})
dispatch(updateStartPosition(centerCoordinates))
} catch (e) {
console.error(e)
}
}
}))
(n, e, i, s) => `${n.name}-${i}-${lonlat.toString(s)}-${lonlat.toString(e)}`
)
function searchWithProximity(t, callback) {
const map = p.getMap()
mapboxSearch(
t,
{
proximity: map ? lonlat.toString(map.getCenter()) : ''
},
callback
)
}
disableMarker={disableInputs}
markerPosition={p.profileRequestLonLat}
markerTooltip={
!p.currentProject ? message('analysis.disableFetch') : undefined
}
setDestination={p.setDestination}
setOrigin={this._setOrigin}
/>
{this.state.showBoundsEditor && (
)}
{displayedDataIsCurrent && p.destination && (
)}
))
}
{controlPoints.map(controlPoint => (
data={comparisonIsochrone}
key={`isochrone-comparison-${isochroneCutoff}-${lonlat.toString(isochroneLonLat)}${isochroneIsStale ? '-dim' : ''}`}
style={{
fillColor: isochroneIsStale
? colors.STALE_ISOCHRONE_COLOR
: colors.COMPARISON_ISOCHRONE_COLOR,
opacity: 0.65,
pointerEvents: 'none',
stroke: false
}}
/>}
{isochrone &&
}
)
}
_downloadIsochrone = memoize(index => () => {
const p = this.props
const isochrone = p.isochrones[index]
if (isochrone) {
const name = p.networks[index].name
const ll = lonlat.toString(p.start.position)
downloadJson({
data: isochrone,
filename: `${name}-${ll}-${p.timeCutoff}min-isochrone.json`
})
} else {
window.alert('No isochrone has been generated for this network.')
}
})
export function updateMap (payload) {
if (payload.zoom) {
setKeyTo('zoom', payload.zoom)
}
if (payload.centerCoordinates) {
setKeyTo(
'centerCoordinates',
lonlat.toString(payload.centerCoordinates)
)
}
return {
type: 'update map',
payload
}
}
(n, c, s, pi) => `${n.name}-${lonlat.toString(s.position)}-${c}-${pi}`
)