kea-geo
Version:
Collection of geo related utility
15 lines (14 loc) • 346 B
JavaScript
module.exports = function (bounds) {
if (typeof bounds === 'string') {
bounds = bounds.trim()
if (bounds.substr(0, 1) === '[') {
try {
bounds = JSON.parse(bounds)
} catch (err) {}
} else {
bounds = bounds.split(',')
}
bounds = bounds.map(val => parseFloat(val))
}
return bounds
}