mapbox-gl-geocoder
mapbox-gl-geocoder copied to clipboard
support coordinates as either Array or Object
bbox is an array of [x, y, x, y]. proximity is an object of {longitude, latitude}.
why not make them both arrays of [x, y, x, y] or [x, y]?
I'd be happy to see these inherit GL JS's LngLatLike
and LngLatBoundsLike
so both array or object are accepted interchangable.
This wouldn't be a breaking change because both as an Array and Object would be accepted.
so apparently an array is supported, but it's not documented. _geocode
converts it to an array if the documented object is provided.
if (key === 'proximity' && self.options[key] && typeof self.options[key].longitude === 'number' && typeof self.options[key].latitude === 'number') {
config[key] = [self.options[key].longitude, self.options[key].latitude]
}