Open sshikov opened 7 years ago
It currently only handles one operation at a time by design. Processing of aggregate results is highly dependent on end users' needs and isn't something I plan on implementing at this time.
Being compatible with other providers is something I need to look into. Do you know if the APIs are similar?
You can just add one or two functions for results processing, like existing onComplete.
I know about yandex maps geocoding API in detail, and about Esri (ArcGIS). They are all similar to each other.
Only difference in general is returned JSON structure - i.e. object and field names.
Just for example: to geocode street address, we can ask google/arcgis/yandex/openstreetmap, filter results by quality (remove results like city/region, not street with buiding number), order by quality, and if we still have more that 1 result, return 1st one - as you have implemented right now.
If you don't do filtering at all - list of candidates could be used to show suggestions. I.e. this is just another use case for the same code.
Geocoder shoud be able to process multiple results of address->coordinates geocoding, filter candidates by address type, location type, order by some quality criteria.
Filtering and sorting should be customizable.
It will be freat if geocode provider will be also customizable, i.e. not Google Maps only, but OpenStreetMap, Yandex, etc, etc.