mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16: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';
|
} from './middleware';
|
||||||
import { IRoute } from '~/redux/map/types';
|
import { IRoute } from '~/redux/map/types';
|
||||||
import { INominatimResult } from '~/redux/types';
|
import { INominatimResult } from '~/redux/types';
|
||||||
|
import { MainMap } from '~/constants/map';
|
||||||
|
|
||||||
const arrayToObject = (array: any[], key: string): {} =>
|
const arrayToObject = (array: any[], key: string): {} =>
|
||||||
array.reduce((obj, el) => ({ ...obj, [el[key]]: el }), {});
|
array.reduce((obj, el) => ({ ...obj, [el[key]]: el }), {});
|
||||||
|
@ -193,7 +194,14 @@ export const searchNominatim = (query: string) =>
|
||||||
CLIENT &&
|
CLIENT &&
|
||||||
CLIENT.NOMINATIM_URL &&
|
CLIENT.NOMINATIM_URL &&
|
||||||
axios
|
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(
|
.then(
|
||||||
data =>
|
data =>
|
||||||
data &&
|
data &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue