mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
nominatim
This commit is contained in:
parent
3a988d23df
commit
0fd656e5fa
1 changed files with 9 additions and 1 deletions
|
@ -12,6 +12,7 @@ import {
|
|||
} from './middleware';
|
||||
import { IRoute } from '~/redux/map/types';
|
||||
import { INominatimResult } from '~/redux/types';
|
||||
import { MainMap } from '~/constants/map';
|
||||
|
||||
const arrayToObject = (array: any[], key: string): {} =>
|
||||
array.reduce((obj, el) => ({ ...obj, [el[key]]: el }), {});
|
||||
|
@ -193,7 +194,14 @@ export const searchNominatim = (query: string) =>
|
|||
CLIENT &&
|
||||
CLIENT.NOMINATIM_URL &&
|
||||
axios
|
||||
.get(`${CLIENT.NOMINATIM_URL}${query}`, { params: { format: 'json', country_code: 'ru', 'accept-language': 'ru_RU' } })
|
||||
.get(`${CLIENT.NOMINATIM_URL} ${query}`, {
|
||||
params: {
|
||||
format: 'json',
|
||||
country_code: 'ru',
|
||||
'accept-language': 'ru_RU',
|
||||
dedupe: 1,
|
||||
},
|
||||
})
|
||||
.then(
|
||||
data =>
|
||||
data &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue