@pretto/places 0.28.0 → 0.31.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/dist/config/constants.d.ts +7 -0
  2. package/dist/config/constants.d.ts.map +1 -0
  3. package/dist/index.d.ts +22 -5
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +216 -1090
  6. package/dist/lib/customFetch.d.ts +4 -0
  7. package/dist/lib/customFetch.d.ts.map +1 -0
  8. package/dist/lib/formatText.d.ts +2 -0
  9. package/dist/lib/formatText.d.ts.map +1 -0
  10. package/dist/lib/formatToMunicipalityResult.d.ts +3 -0
  11. package/dist/lib/formatToMunicipalityResult.d.ts.map +1 -0
  12. package/dist/lib/getSignal.d.ts +2 -0
  13. package/dist/lib/getSignal.d.ts.map +1 -0
  14. package/dist/lib/isStartWith.d.ts +2 -0
  15. package/dist/lib/isStartWith.d.ts.map +1 -0
  16. package/dist/module.js +213 -1088
  17. package/dist/searchByAddress.d.ts +3 -0
  18. package/dist/searchByAddress.d.ts.map +1 -0
  19. package/dist/searchByCoordinates.d.ts +3 -0
  20. package/dist/searchByCoordinates.d.ts.map +1 -0
  21. package/dist/searchByCountry.d.ts +11 -0
  22. package/dist/searchByCountry.d.ts.map +1 -0
  23. package/dist/searchByDepartment.d.ts +3 -0
  24. package/dist/searchByDepartment.d.ts.map +1 -0
  25. package/dist/searchByMunicipality.d.ts +3 -0
  26. package/dist/searchByMunicipality.d.ts.map +1 -0
  27. package/dist/searchByZipcode.d.ts +3 -0
  28. package/dist/searchByZipcode.d.ts.map +1 -0
  29. package/dist/types.d.ts +76 -0
  30. package/dist/types.d.ts.map +1 -0
  31. package/package.json +4 -2
  32. package/dist/addressSearch.d.ts +0 -27
  33. package/dist/addressSearch.d.ts.map +0 -1
  34. package/dist/countrySearch.d.ts +0 -20
  35. package/dist/countrySearch.d.ts.map +0 -1
  36. package/dist/geolocSearch.d.ts +0 -7
  37. package/dist/geolocSearch.d.ts.map +0 -1
  38. package/dist/municipalitySearch.d.ts +0 -42
  39. package/dist/municipalitySearch.d.ts.map +0 -1
  40. package/dist/outline/paris.d.ts +0 -8
  41. package/dist/outline/paris.d.ts.map +0 -1
  42. package/dist/reverseGeolocSearch.d.ts +0 -19
  43. package/dist/reverseGeolocSearch.d.ts.map +0 -1
  44. package/dist/utils.d.ts +0 -3
  45. package/dist/utils.d.ts.map +0 -1
package/dist/module.js CHANGED
@@ -1,8 +1,6 @@
1
- import flat from 'array.prototype.flat';
2
- import isEqual from 'lodash.isequal';
3
1
  import algoliasearch from 'algoliasearch';
4
2
 
5
- /*! *****************************************************************************
3
+ /******************************************************************************
6
4
  Copyright (c) Microsoft Corporation.
7
5
 
8
6
  Permission to use, copy, modify, and/or distribute this software for any
@@ -25,201 +23,204 @@ function __awaiter(thisArg, _arguments, P, generator) {
25
23
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
26
24
  step((generator = generator.apply(thisArg, _arguments || [])).next());
27
25
  });
28
- }
29
-
30
- const convertFirstLetterToUpperCase = (str) => {
31
- return [...str.toLowerCase()].reduce((acc, curr, idx, array) => {
32
- if (idx === 0)
33
- return curr.toUpperCase();
34
- if ([' ', '-', '('].indexOf(array[idx - 1]) !== -1)
35
- return acc + curr.toUpperCase();
36
- return acc + curr;
37
- }, '');
38
- };
39
- const getUri = (search, departmentOnly, withType = true) => {
40
- const PLACES_API = 'https://geo.api.gouv.fr';
41
- const QUERY_FIELDS = `boost=population&fields=departement${departmentOnly ? ',centre,contour' : ',codesPostaux,centre,contour'}`;
42
- const formatedSearch = encodeURIComponent(search);
43
- const type = withType ? 'type=arrondissement-municipal&' : '';
44
- const uri = {
45
- departments: `${PLACES_API}/departements/${formatedSearch}/communes?${QUERY_FIELDS}`,
46
- municipality: `${PLACES_API}/communes?${type}&nom=${formatedSearch}&${QUERY_FIELDS}`,
47
- zipcode: `${PLACES_API}/communes?${type}codePostal=${formatedSearch}&${QUERY_FIELDS}`,
48
- };
49
- if (isNaN(parseInt(search, 10)))
50
- return uri.municipality;
51
- return search.length === 5 ? uri.zipcode : uri.departments;
26
+ }
27
+
28
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
29
+ var e = new Error(message);
30
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
52
31
  };
53
32
 
54
- let PREVIOUS_SEARCH = [];
55
- let SEARCH_CACHE = [];
56
- let PREVIOUS_VALUE = '';
57
- const responseFormat = (places, country, search, departmentOnly) => {
58
- var _a;
59
- if (places.length === 0 || !places)
60
- return [];
61
- if (departmentOnly) {
62
- return places.map(place => {
63
- var _a, _b;
64
- const center = !(place === null || place === void 0 ? void 0 : place.centre)
65
- ? null
66
- : { latitude: place.centre.coordinates[1], longitude: place.centre.coordinates[0] };
67
- return {
68
- label: `${place.nom}${!!((_a = place.departement) === null || _a === void 0 ? void 0 : _a.code) ? ` (${place.departement.code})` : ''}`,
69
- value: {
70
- center,
71
- city: place.nom,
72
- country,
73
- outline: place.contour.coordinates[0].map(([longitude, latitude]) => ({ longitude, latitude })),
74
- zipcode: ((_b = place.departement) === null || _b === void 0 ? void 0 : _b.code) || '',
75
- },
76
- };
33
+ const MUNICIPALITY_API_URL = 'https://geo.api.gouv.fr/communes';
34
+ const DEPARTMENT_API_URL = 'https://geo.api.gouv.fr/departements';
35
+ const ADDRESS_API_URL = 'https://api-adresse.data.gouv.fr/search';
36
+ const FIELDS = '&fields=codeDepartement,nom,codesPostaux,contour,mairie,centre';
37
+ const BOOST = '&boost=population';
38
+ const TYPES = '&type=arrondissement-municipal,commune-actuelle';
39
+
40
+ const DEFAULT_DEBOUNCE_TIME = 300;
41
+ let getDelayedData;
42
+ function customFetch(url, options = { debouncetime: DEFAULT_DEBOUNCE_TIME }) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ clearTimeout(getDelayedData);
45
+ return new Promise((resolve, reject) => {
46
+ getDelayedData = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
47
+ const fetchData = (singleUrl) => __awaiter(this, void 0, void 0, function* () {
48
+ const response = yield fetch(singleUrl, { signal: options.signal });
49
+ if (!response.ok) {
50
+ throw new Error('Error: ' + response.status);
51
+ }
52
+ return response;
53
+ });
54
+ try {
55
+ if (Array.isArray(url)) {
56
+ const responses = yield Promise.all(url.map(singleUrl => fetchData(singleUrl)));
57
+ resolve(responses);
58
+ }
59
+ else {
60
+ const response = yield fetchData(url);
61
+ resolve(response);
62
+ }
63
+ }
64
+ catch (error) {
65
+ reject(error);
66
+ }
67
+ }), options.debouncetime);
77
68
  });
69
+ });
70
+ }
71
+
72
+ const getSignal = (controller) => {
73
+ if (controller) {
74
+ controller.abort();
78
75
  }
79
- if (!isNaN(parseInt(search, 10)) && search.length === 5 && places.length === 1) {
80
- const center = !((_a = places[0]) === null || _a === void 0 ? void 0 : _a.centre)
81
- ? null
82
- : { latitude: places[0].centre.coordinates[1], longitude: places[0].centre.coordinates[0] };
76
+ controller = new AbortController();
77
+ return controller.signal;
78
+ };
79
+
80
+ let controller$4 = null;
81
+ const searchByAddress = (searchValue, options) => __awaiter(void 0, void 0, void 0, function* () {
82
+ const url = `${ADDRESS_API_URL}/?q=${searchValue}&autocomplete=1&limit=${(options === null || options === void 0 ? void 0 : options.limit) || 10}`;
83
+ const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal(controller$4);
84
+ const addressResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
85
+ const addressResult = yield addressResponse.json();
86
+ const formatAddressResult = addressResult.features.reduce((acc, { properties }) => {
83
87
  return [
88
+ ...acc,
84
89
  {
85
- label: `${places[0].nom} (${search})`,
90
+ label: `${properties.name} ${properties.postcode}, ${properties.city}`,
86
91
  value: {
87
- center,
88
- city: places[0].nom,
89
- country,
90
- outline: places[0].contour.coordinates[0].map(([longitude, latitude]) => ({ longitude, latitude })),
91
- zipcode: search,
92
+ city: properties.city,
93
+ country: 'fr',
94
+ street: `${properties.name}`,
95
+ zipcode: properties.postcode,
92
96
  },
93
97
  },
94
98
  ];
95
- }
96
- const allPlaces = places.map(place => {
97
- return place.codesPostaux.reduce((acc, curr) => {
98
- const center = !(place === null || place === void 0 ? void 0 : place.centre)
99
- ? null
100
- : { latitude: place.centre.coordinates[1], longitude: place.centre.coordinates[0] };
101
- return [
102
- ...acc,
103
- {
104
- label: `${place.nom} (${curr})`,
105
- value: {
106
- center,
107
- city: place.nom,
108
- country,
109
- outline: place.contour.coordinates[0].map(([longitude, latitude]) => ({ longitude, latitude })),
110
- zipcode: curr,
111
- },
112
- },
113
- ];
114
- }, []);
115
- });
116
- return flat(allPlaces);
99
+ }, []);
100
+ return formatAddressResult;
101
+ });
102
+
103
+ const formatToMunicipalitySearchResult = (results) => {
104
+ return results.map(result => ({
105
+ label: result.nom + ' ' + result.codesPostaux[0],
106
+ value: {
107
+ center: result.centre,
108
+ city: result.nom,
109
+ country: 'fr',
110
+ outline: result.contour.coordinates[0].map(([longitude, latitude]) => ({ longitude, latitude })),
111
+ zipcode: result.codesPostaux[0],
112
+ },
113
+ }));
117
114
  };
118
- const getData$3 = (search, options) => __awaiter(void 0, void 0, void 0, function* () {
119
- const { country = 'fr', limit = 5, departmentOnly = false } = options || {};
120
- const isNumber = !isNaN(parseInt(search, 10));
121
- if (!search || (isNumber && search.length < 2))
122
- return [];
123
- if (isNumber && search.length > 2 && search.length < 5 && SEARCH_CACHE.length > 0) {
124
- return SEARCH_CACHE.filter(i => i.value.zipcode.includes(search)).slice(0, limit);
125
- }
115
+
116
+ let controller$3 = null;
117
+ const searchByCoordinates = ({ latitude, longitude }, options) => __awaiter(void 0, void 0, void 0, function* () {
118
+ const url = `${MUNICIPALITY_API_URL}?lat=${latitude}&lon=${longitude}${FIELDS}${BOOST}`;
119
+ const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal(controller$3);
126
120
  try {
127
- let result = [];
128
- const response = yield fetch(getUri(search, departmentOnly));
129
- if (!response.ok)
130
- return Promise.reject(response);
131
- result = yield response.json();
132
- if (result.length === 0) {
133
- const response = yield fetch(getUri(search, departmentOnly, false));
134
- if (!response.ok)
135
- return Promise.reject(response);
136
- result = yield response.json();
137
- }
138
- const formatedResponse = responseFormat(result, country, search, departmentOnly);
139
- if (isEqual(PREVIOUS_SEARCH, formatedResponse)) {
140
- const cleanValue = search.replace(' ', '').replace(PREVIOUS_VALUE, '');
141
- return PREVIOUS_SEARCH.filter(i => i.label.includes(cleanValue)).slice(0, limit);
142
- }
143
- PREVIOUS_VALUE = search;
144
- PREVIOUS_SEARCH = formatedResponse;
145
- if (isNumber && search.length !== 5) {
146
- SEARCH_CACHE = formatedResponse;
147
- }
148
- return formatedResponse.slice(0, limit);
121
+ const gpsResponse = yield customFetch([url + TYPES, url], Object.assign(Object.assign({}, options), { signal }));
122
+ const arrondissementsResponse = yield gpsResponse[0].json();
123
+ const communeResponse = yield gpsResponse[1].json();
124
+ const result = arrondissementsResponse.length > 0 ? arrondissementsResponse : communeResponse;
125
+ return formatToMunicipalitySearchResult(result);
149
126
  }
150
127
  catch (error) {
151
- if (typeof error === 'string')
152
- throw new Error(error);
153
- if (error instanceof Error)
154
- throw new Error((error === null || error === void 0 ? void 0 : error.message) || 'An error occurred.');
155
- return 'An error occurred.';
128
+ console.log(error);
129
+ return [];
156
130
  }
157
131
  });
158
- let getDelayedData$3;
159
- const get$4 = (search, options, debounceValue = 300) => {
160
- clearTimeout(getDelayedData$3);
161
- return new Promise((resolve, reject) => {
162
- getDelayedData$3 = setTimeout(() => {
163
- resolve(getData$3(search, options));
164
- }, debounceValue);
165
- });
166
- };
167
132
 
168
- var municipalitySearch = /*#__PURE__*/Object.freeze({
169
- __proto__: null,
170
- getData: getData$3,
171
- get: get$4
133
+ let controller$2 = null;
134
+ const searchByDepartment = (searchValue, options) => __awaiter(void 0, void 0, void 0, function* () {
135
+ if (isNaN(parseInt(searchValue))) {
136
+ const nameDepartmentUrl = `${DEPARTMENT_API_URL}?nom=${searchValue}&fields=region,codeRegion&limit=21`;
137
+ const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal(controller$2);
138
+ const departmentResponse = yield customFetch(nameDepartmentUrl, Object.assign(Object.assign({}, options), { signal }));
139
+ const departmentResult = yield departmentResponse.json();
140
+ return departmentResult.map(result => ({
141
+ label: `${result.nom} (${result.code})`,
142
+ value: {
143
+ code: result.code,
144
+ codeRegion: result.codeRegion,
145
+ country: 'fr',
146
+ region: result.region,
147
+ },
148
+ }));
149
+ }
150
+ const codeDepartmentUrl = `${DEPARTMENT_API_URL}/${searchValue}?limit=1`;
151
+ const departmentResponse = yield customFetch(codeDepartmentUrl, options);
152
+ const departmentResult = yield departmentResponse.json();
153
+ if ('nom' in departmentResult) {
154
+ return searchByDepartment(departmentResult.nom, options);
155
+ }
156
+ return [];
172
157
  });
173
158
 
174
- const getData$2 = (search, options) => __awaiter(void 0, void 0, void 0, function* () {
175
- if (!search || search.length < 2)
176
- return [];
177
- try {
178
- const { country = 'fr', limit = 5 } = options || {};
179
- const format = encodeURIComponent(search);
180
- const response = yield fetch(`https://api-adresse.data.gouv.fr/search/?q=${format}&autocomplete=1&limit=${limit}`);
181
- if (!response.ok)
182
- return Promise.reject(response);
183
- const result = yield response.json();
184
- return result.features.reduce((acc, { properties }) => {
185
- return [
186
- ...acc,
187
- {
188
- label: `${properties.name} (${properties.postcode})`,
189
- value: {
190
- city: properties.city,
191
- country,
192
- street: `${properties.name}`,
193
- zipcode: properties.postcode,
194
- },
195
- },
196
- ];
197
- }, []);
159
+ function isStartsWith(arr, value) {
160
+ const lowerCaseValue = value.toLowerCase();
161
+ return arr.some(item => lowerCaseValue.startsWith(item.toLowerCase()));
162
+ }
163
+
164
+ const SPECIAL_CITIES = ['paris ', 'lyon ', 'marseille '];
165
+ let CURRENT_RESULT = [];
166
+ let controller$1 = null;
167
+ const filterOnCurrentResult = (searchValue) => {
168
+ const searchRegex = new RegExp(searchValue
169
+ .split(' ')
170
+ .map(word => `(?=.*${word})`)
171
+ .join(''), 'i');
172
+ return CURRENT_RESULT.filter(item => searchRegex.test(item.nom));
173
+ };
174
+ const filterCityResults = (cities) => cities.filter(city => !(['75', '13', '69'].includes(city.codeDepartement) && city.codesPostaux.length > 1));
175
+ const searchByMunicipality = (searchValue, options) => __awaiter(void 0, void 0, void 0, function* () {
176
+ if (isStartsWith(SPECIAL_CITIES, searchValue.toLowerCase()) && CURRENT_RESULT.length > 0) {
177
+ const filtredCurrentResult = filterOnCurrentResult(searchValue);
178
+ return formatToMunicipalitySearchResult(filtredCurrentResult);
198
179
  }
199
- catch (error) {
200
- if (typeof error === 'string')
201
- throw new Error(error);
202
- if (error instanceof Error)
203
- throw new Error((error === null || error === void 0 ? void 0 : error.message) || 'An error occurred.');
204
- return 'An error occurred.';
180
+ CURRENT_RESULT = [];
181
+ const url = `${MUNICIPALITY_API_URL}?nom=${searchValue}${FIELDS}${BOOST}&limit=${(options === null || options === void 0 ? void 0 : options.limit) || 10}`;
182
+ const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal(controller$1);
183
+ const cityResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
184
+ const cityResult = yield cityResponse.json();
185
+ // The first result is Paris, Lyon or Marseille, we want get all arrondissements
186
+ if (cityResult.length > 0 && ['75', '13', '69'].includes(cityResult[0].codeDepartement)) {
187
+ const url = `${MUNICIPALITY_API_URL}?nom=${searchValue}&codeDepartement=${cityResult[0].codeDepartement}${FIELDS}${BOOST}${TYPES}&limit=21`;
188
+ const arrondissementsResponse = yield customFetch(url, options);
189
+ const arrondissementsResult = yield arrondissementsResponse.json();
190
+ const filtredAndSortArrondissementsResult = arrondissementsResult
191
+ .filter(item => item.codesPostaux.length === 1)
192
+ .sort((a, b) => parseInt(a.codesPostaux[0]) - parseInt(b.codesPostaux[0]));
193
+ CURRENT_RESULT = filtredAndSortArrondissementsResult;
194
+ if (isStartsWith(SPECIAL_CITIES, searchValue.toLowerCase())) {
195
+ const filtredCurrentResult = filterOnCurrentResult(searchValue);
196
+ return formatToMunicipalitySearchResult(filtredCurrentResult);
197
+ }
198
+ return formatToMunicipalitySearchResult(filterCityResults([...filtredAndSortArrondissementsResult, ...cityResult]));
205
199
  }
200
+ return formatToMunicipalitySearchResult(filterCityResults(cityResult));
206
201
  });
207
- let getDelayedData$2;
208
- const get$3 = (search, options, debounceValue = 300) => {
209
- clearTimeout(getDelayedData$2);
210
- return new Promise((resolve, reject) => {
211
- getDelayedData$2 = setTimeout(() => {
212
- resolve(getData$2(search, options));
213
- }, debounceValue);
214
- });
215
- };
216
202
 
217
- var addressSearch = /*#__PURE__*/Object.freeze({
218
- __proto__: null,
219
- get: get$3
203
+ let controller = null;
204
+ const searchByZipcode = (searchValue, options) => __awaiter(void 0, void 0, void 0, function* () {
205
+ const url = `${MUNICIPALITY_API_URL}?codePostal=${searchValue}${FIELDS}${BOOST}${TYPES}`;
206
+ const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal(controller);
207
+ const zipCodeResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
208
+ const zipCodeResult = yield zipCodeResponse.json();
209
+ const filtredZipCodeResult = zipCodeResult.filter(item => item.codesPostaux.length <= 1);
210
+ return formatToMunicipalitySearchResult(filtredZipCodeResult);
220
211
  });
221
212
 
222
- const get$2 = (instance, search, options) => __awaiter(void 0, void 0, void 0, function* () {
213
+ const convertFirstLetterToUpperCase = (str) => {
214
+ return [...str.toLowerCase()].reduce((acc, curr, idx, array) => {
215
+ if (idx === 0)
216
+ return curr.toUpperCase();
217
+ if ([' ', '-', '('].indexOf(array[idx - 1]) !== -1)
218
+ return acc + curr.toUpperCase();
219
+ return acc + curr;
220
+ }, '');
221
+ };
222
+
223
+ const get = (instance, search, options) => __awaiter(void 0, void 0, void 0, function* () {
223
224
  const selectedLanguage = (options === null || options === void 0 ? void 0 : options.language) || 'fr';
224
225
  const indexName = selectedLanguage === 'fr' ? 'Countries' : 'CountriesEN';
225
226
  if (!search)
@@ -243,7 +244,7 @@ const init = (appId, apiKey, options) => {
243
244
  return {
244
245
  get(search, options) {
245
246
  return __awaiter(this, void 0, void 0, function* () {
246
- return yield get$2(ALGOLIA_COUNTRIES_API, search, options);
247
+ return yield get(ALGOLIA_COUNTRIES_API, search, options);
247
248
  });
248
249
  },
249
250
  };
@@ -257,933 +258,57 @@ const init = (appId, apiKey, options) => {
257
258
  }
258
259
  };
259
260
 
260
- var countrySearch = /*#__PURE__*/Object.freeze({
261
+ var searchByCountry = /*#__PURE__*/Object.freeze({
261
262
  __proto__: null,
262
263
  init: init
263
264
  });
264
265
 
265
- const formatData$1 = (results) => results.map(result => ({
266
- city: result.nom,
267
- code: result.code,
268
- coordinates: result.centre.coordinates,
269
- }));
270
- // All french zipcode are only numbers, even particular cases like Corse (2A, 2B > 20), Finistère (29N, 29S > 29x), etc..
271
- // For more information: https://fr.wikipedia.org/wiki/Code_postal_en_France
272
- // Kept as string for consistency with geo.api.gouv.fr
273
- const getData$1 = (search) => __awaiter(void 0, void 0, void 0, function* () {
274
- if (!search || !/(\d){5}/.test(search))
266
+ const searchPlaces = (searchValue, options, searchType = ['city', 'zipcode', 'coordinates']) => __awaiter(void 0, void 0, void 0, function* () {
267
+ if (!searchValue) {
275
268
  return [];
269
+ }
276
270
  try {
277
- let results = [];
278
- const formattedSearch = encodeURIComponent(search);
279
- const response = yield fetch(`https://geo.api.gouv.fr/communes?codePostal=${formattedSearch}&type=arrondissement-municipal&fields=centre`);
280
- if (!response.ok)
281
- return Promise.reject(response);
282
- results = yield response.json();
283
- if (results.length === 0) {
284
- const response = yield fetch(`https://geo.api.gouv.fr/communes?codePostal=${formattedSearch}&fields=centre`);
285
- if (!response.ok)
286
- return Promise.reject(response);
287
- results = yield response.json();
271
+ if (typeof searchValue === 'object' && searchType.includes('coordinates')) {
272
+ const result = yield searchByCoordinates(searchValue, options);
273
+ return result;
288
274
  }
289
- return formatData$1(results);
290
- }
291
- catch (error) {
292
- if (typeof error === 'string')
293
- throw new Error(error);
294
- throw new Error(error instanceof Error && error.message ? error.message : 'An error occurred.');
295
- }
296
- });
297
- let getDelayedData$1;
298
- const get$1 = (search, debounceValue = 300) => {
299
- clearTimeout(getDelayedData$1);
300
- return new Promise((resolve, reject) => {
301
- getDelayedData$1 = setTimeout(() => {
302
- resolve(getData$1(search));
303
- }, debounceValue);
304
- });
305
- };
306
-
307
- var geolocSearch = /*#__PURE__*/Object.freeze({
308
- __proto__: null,
309
- get: get$1
310
- });
311
-
312
- const parisOutline = [
313
- {
314
- name: '75001',
315
- coordinates: [
316
- { latitude: 48.86957652371833, longitude: 2.325888016639641 },
317
- { latitude: 48.86941686979254, longitude: 2.325166186173742 },
318
- { latitude: 48.869012125448094, longitude: 2.325318661731758 },
319
- { latitude: 48.86647318158315, longitude: 2.323549402969781 },
320
- { latitude: 48.86301926292805, longitude: 2.320933472558735 },
321
- { latitude: 48.860820561109485, longitude: 2.327980452922264 },
322
- { latitude: 48.85967940127131, longitude: 2.331211887811374 },
323
- { latitude: 48.85933546785559, longitude: 2.332915970801086 },
324
- { latitude: 48.85831054598589, longitude: 2.337672258257702 },
325
- { latitude: 48.856675326020245, longitude: 2.340567474956991 },
326
- { latitude: 48.85612842977291, longitude: 2.341367616268793 },
327
- { latitude: 48.85510403355428, longitude: 2.342506315232651 },
328
- { latitude: 48.854832954713046, longitude: 2.342929504859985 },
329
- { latitude: 48.85408864570293, longitude: 2.344634297019094 },
330
- { latitude: 48.855305967418026, longitude: 2.345875578039897 },
331
- { latitude: 48.85724094546822, longitude: 2.347114738902889 },
332
- { latitude: 48.85735856694371, longitude: 2.347573942712777 },
333
- { latitude: 48.86198542309833, longitude: 2.350164450262719 },
334
- { latitude: 48.86340168752486, longitude: 2.350955108041353 },
335
- { latitude: 48.86826017309677, longitude: 2.330425554638063 },
336
- { latitude: 48.86840948237775, longitude: 2.330107362963977 },
337
- { latitude: 48.86992115311998, longitude: 2.327999372502886 },
338
- { latitude: 48.86957652371833, longitude: 2.325888016639641 },
339
- ],
340
- },
341
- {
342
- name: '75002',
343
- coordinates: [
344
- { latitude: 48.86992115311998, longitude: 2.327999372502886 },
345
- { latitude: 48.86840948237775, longitude: 2.330107362963977 },
346
- { latitude: 48.86826017309677, longitude: 2.330425554638063 },
347
- { latitude: 48.86340168752486, longitude: 2.350955108041353 },
348
- { latitude: 48.869323712716465, longitude: 2.35425267163513 },
349
- { latitude: 48.870687845194766, longitude: 2.347918228212595 },
350
- { latitude: 48.871972099441614, longitude: 2.340041163195277 },
351
- { latitude: 48.86992115311998, longitude: 2.327999372502886 },
352
- ],
353
- },
354
- {
355
- name: '75003',
356
- coordinates: [
357
- { latitude: 48.86751628680611, longitude: 2.363872116727158 },
358
- { latitude: 48.86781627185984, longitude: 2.363290446814835 },
359
- { latitude: 48.86882946521955, longitude: 2.356495893113925 },
360
- { latitude: 48.869323712716465, longitude: 2.35425267163513 },
361
- { latitude: 48.86340168752486, longitude: 2.350955108041353 },
362
- { latitude: 48.86198542309833, longitude: 2.350164450262719 },
363
- { latitude: 48.86121296232192, longitude: 2.353499932088789 },
364
- { latitude: 48.86014672001949, longitude: 2.356742165886385 },
365
- { latitude: 48.8583394999781, longitude: 2.359344591623221 },
366
- { latitude: 48.85724355063003, longitude: 2.36176775751168 },
367
- { latitude: 48.856306224209064, longitude: 2.36494121805568 },
368
- { latitude: 48.85578517844436, longitude: 2.36827851557945 },
369
- { latitude: 48.855805185784135, longitude: 2.368490886682737 },
370
- { latitude: 48.86307619289049, longitude: 2.366747947246461 },
371
- { latitude: 48.86616998447825, longitude: 2.364890494038093 },
372
- { latitude: 48.86730904970824, longitude: 2.364306784904801 },
373
- { latitude: 48.86751628680611, longitude: 2.363872116727158 },
374
- ],
375
- },
376
- {
377
- name: '75004',
378
- coordinates: [
379
- { latitude: 48.8531662305869, longitude: 2.369123881441927 },
380
- { latitude: 48.855805185784135, longitude: 2.368490886682737 },
381
- { latitude: 48.85578517844436, longitude: 2.36827851557945 },
382
- { latitude: 48.856306224209064, longitude: 2.36494121805568 },
383
- { latitude: 48.85724355063003, longitude: 2.36176775751168 },
384
- { latitude: 48.8583394999781, longitude: 2.359344591623221 },
385
- { latitude: 48.86014672001949, longitude: 2.356742165886385 },
386
- { latitude: 48.86121296232192, longitude: 2.353499932088789 },
387
- { latitude: 48.86198542309833, longitude: 2.350164450262719 },
388
- { latitude: 48.85735856694371, longitude: 2.347573942712777 },
389
- { latitude: 48.85724094546822, longitude: 2.347114738902889 },
390
- { latitude: 48.855305967418026, longitude: 2.345875578039897 },
391
- { latitude: 48.85408864570293, longitude: 2.344634297019094 },
392
- { latitude: 48.853399201086006, longitude: 2.346673612596327 },
393
- { latitude: 48.85236336321757, longitude: 2.3490238379796 },
394
- { latitude: 48.851688322372794, longitude: 2.351245463223946 },
395
- { latitude: 48.85098606491656, longitude: 2.354597116127078 },
396
- { latitude: 48.849427619946795, longitude: 2.359308341799822 },
397
- { latitude: 48.84855560655669, longitude: 2.361057893168453 },
398
- { latitude: 48.847811960431926, longitude: 2.362260736113708 },
399
- { latitude: 48.846185908499045, longitude: 2.364455435684601 },
400
- { latitude: 48.847309858182896, longitude: 2.366443514943608 },
401
- { latitude: 48.8531662305869, longitude: 2.369123881441927 },
402
- ],
403
- },
404
- {
405
- name: '75005',
406
- coordinates: [
407
- { latitude: 48.846185908499045, longitude: 2.364455435684601 },
408
- { latitude: 48.847811960431926, longitude: 2.362260736113708 },
409
- { latitude: 48.84855560655669, longitude: 2.361057893168453 },
410
- { latitude: 48.849427619946795, longitude: 2.359308341799822 },
411
- { latitude: 48.85098606491656, longitude: 2.354597116127078 },
412
- { latitude: 48.851688322372794, longitude: 2.351245463223946 },
413
- { latitude: 48.85236336321757, longitude: 2.3490238379796 },
414
- { latitude: 48.853399201086006, longitude: 2.346673612596327 },
415
- { latitude: 48.85408864570293, longitude: 2.344634297019094 },
416
- { latitude: 48.853756649406066, longitude: 2.344281403902506 },
417
- { latitude: 48.85034803298138, longitude: 2.342631736794723 },
418
- { latitude: 48.846709989769, longitude: 2.340482359554029 },
419
- { latitude: 48.84087508203468, longitude: 2.337256165772474 },
420
- { latitude: 48.84074558478256, longitude: 2.336771393206437 },
421
- { latitude: 48.83967110759586, longitude: 2.336656991547953 },
422
- { latitude: 48.838863210249016, longitude: 2.33969740550839 },
423
- { latitude: 48.83834304474304, longitude: 2.3420855672544 },
424
- { latitude: 48.8373159561145, longitude: 2.347007359776023 },
425
- { latitude: 48.83680458564547, longitude: 2.351870772035156 },
426
- { latitude: 48.83994070616588, longitude: 2.361745287380767 },
427
- { latitude: 48.84441324001663, longitude: 2.365127018289573 },
428
- { latitude: 48.84496784315353, longitude: 2.36608772597324 },
429
- { latitude: 48.846185908499045, longitude: 2.364455435684601 },
430
- ],
431
- },
432
- {
433
- name: '75006',
434
- coordinates: [
435
- { latitude: 48.85933546785559, longitude: 2.332915970801086 },
436
- { latitude: 48.85853065910707, longitude: 2.332451956624262 },
437
- { latitude: 48.858290596608704, longitude: 2.333270093392227 },
438
- { latitude: 48.85511182678856, longitude: 2.330771694941244 },
439
- { latitude: 48.852730724714114, longitude: 2.329395832185783 },
440
- { latitude: 48.852055672942136, longitude: 2.328659059558951 },
441
- { latitude: 48.85186769794419, longitude: 2.328657392915725 },
442
- { latitude: 48.8515812406585, longitude: 2.326814484762852 },
443
- { latitude: 48.851362150651724, longitude: 2.326877278259198 },
444
- { latitude: 48.85023523821869, longitude: 2.324162209437007 },
445
- { latitude: 48.84791387995067, longitude: 2.3195413908368 },
446
- { latitude: 48.8468634910953, longitude: 2.316712552321029 },
447
- { latitude: 48.84663569580366, longitude: 2.31698262350471 },
448
- { latitude: 48.84516563132351, longitude: 2.319893405967863 },
449
- { latitude: 48.84362134269369, longitude: 2.324641767064502 },
450
- { latitude: 48.83967110759586, longitude: 2.336656991547953 },
451
- { latitude: 48.84074558478256, longitude: 2.336771393206437 },
452
- { latitude: 48.84087508203468, longitude: 2.337256165772474 },
453
- { latitude: 48.846709989769, longitude: 2.340482359554029 },
454
- { latitude: 48.85034803298138, longitude: 2.342631736794723 },
455
- { latitude: 48.853756649406066, longitude: 2.344281403902506 },
456
- { latitude: 48.85408864570293, longitude: 2.344634297019094 },
457
- { latitude: 48.854832954713046, longitude: 2.342929504859985 },
458
- { latitude: 48.85510403355428, longitude: 2.342506315232651 },
459
- { latitude: 48.85612842977291, longitude: 2.341367616268793 },
460
- { latitude: 48.856675326020245, longitude: 2.340567474956991 },
461
- { latitude: 48.85831054598589, longitude: 2.337672258257702 },
462
- { latitude: 48.85933546785559, longitude: 2.332915970801086 },
463
- ],
464
- },
465
- {
466
- name: '75007',
467
- coordinates: [
468
- { latitude: 48.86301926292805, longitude: 2.320933472558735 },
469
- { latitude: 48.86372322409194, longitude: 2.318677870940691 },
470
- { latitude: 48.863496076964175, longitude: 2.301737287583634 },
471
- { latitude: 48.86328352059519, longitude: 2.299222465550165 },
472
- { latitude: 48.863144008401505, longitude: 2.298589132813498 },
473
- { latitude: 48.86261949443383, longitude: 2.296870514172013 },
474
- { latitude: 48.861875619399484, longitude: 2.294864562062728 },
475
- { latitude: 48.861246340432466, longitude: 2.293689941916094 },
476
- { latitude: 48.860253620211, longitude: 2.292195882851742 },
477
- { latitude: 48.85818288040792, longitude: 2.289695682973308 },
478
- { latitude: 48.857475043730936, longitude: 2.291053303527222 },
479
- { latitude: 48.85138469655275, longitude: 2.3005463196733 },
480
- { latitude: 48.8510622115364, longitude: 2.301227956943836 },
481
- { latitude: 48.84713344729916, longitude: 2.307354149221546 },
482
- { latitude: 48.847433437634464, longitude: 2.308218200598362 },
483
- { latitude: 48.84797630479076, longitude: 2.310494899377193 },
484
- { latitude: 48.84594337806365, longitude: 2.313715867497841 },
485
- { latitude: 48.8468634910953, longitude: 2.316712552321029 },
486
- { latitude: 48.84791387995067, longitude: 2.3195413908368 },
487
- { latitude: 48.85023523821869, longitude: 2.324162209437007 },
488
- { latitude: 48.851362150651724, longitude: 2.326877278259198 },
489
- { latitude: 48.8515812406585, longitude: 2.326814484762852 },
490
- { latitude: 48.85186769794419, longitude: 2.328657392915725 },
491
- { latitude: 48.852055672942136, longitude: 2.328659059558951 },
492
- { latitude: 48.852730724714114, longitude: 2.329395832185783 },
493
- { latitude: 48.85511182678856, longitude: 2.330771694941244 },
494
- { latitude: 48.858290596608704, longitude: 2.333270093392227 },
495
- { latitude: 48.85853065910707, longitude: 2.332451956624262 },
496
- { latitude: 48.85933546785559, longitude: 2.332915970801086 },
497
- { latitude: 48.85967940127131, longitude: 2.331211887811374 },
498
- { latitude: 48.860820561109485, longitude: 2.327980452922264 },
499
- { latitude: 48.86301926292805, longitude: 2.320933472558735 },
500
- ],
501
- },
502
- {
503
- name: '75008',
504
- coordinates: [
505
- { latitude: 48.88345508679081, longitude: 2.327164725373034 },
506
- { latitude: 48.88134138388508, longitude: 2.316479725210514 },
507
- { latitude: 48.88043436140222, longitude: 2.308874779443685 },
508
- { latitude: 48.87807688568086, longitude: 2.29815486307795 },
509
- { latitude: 48.87377317675925, longitude: 2.295032069299387 },
510
- { latitude: 48.87330312962187, longitude: 2.295542880656993 },
511
- { latitude: 48.87093857212867, longitude: 2.297501223263733 },
512
- { latitude: 48.868644254049464, longitude: 2.298866790658252 },
513
- { latitude: 48.86553729851455, longitude: 2.29983829121079 },
514
- { latitude: 48.864986916136104, longitude: 2.299841599006072 },
515
- { latitude: 48.8650075721619, longitude: 2.300297979606478 },
516
- { latitude: 48.86449106268491, longitude: 2.301635346720621 },
517
- { latitude: 48.863496076964175, longitude: 2.301737287583634 },
518
- { latitude: 48.86372322409194, longitude: 2.318677870940691 },
519
- { latitude: 48.86301926292805, longitude: 2.320933472558735 },
520
- { latitude: 48.86647318158315, longitude: 2.323549402969781 },
521
- { latitude: 48.869012125448094, longitude: 2.325318661731758 },
522
- { latitude: 48.86941686979254, longitude: 2.325166186173742 },
523
- { latitude: 48.86957652371833, longitude: 2.325888016639641 },
524
- { latitude: 48.87259790076228, longitude: 2.326613754960452 },
525
- { latitude: 48.87276167043616, longitude: 2.32646984849174 },
526
- { latitude: 48.87342696649887, longitude: 2.326911159247377 },
527
- { latitude: 48.8737810482106, longitude: 2.327025197965383 },
528
- { latitude: 48.87535450560443, longitude: 2.326636742372628 },
529
- { latitude: 48.87618413885571, longitude: 2.326875527168119 },
530
- { latitude: 48.88345508679081, longitude: 2.327164725373034 },
531
- ],
532
- },
533
- {
534
- name: '75009',
535
- coordinates: [
536
- { latitude: 48.86957652371833, longitude: 2.325888016639641 },
537
- { latitude: 48.86992115311998, longitude: 2.327999372502886 },
538
- { latitude: 48.871972099441614, longitude: 2.340041163195277 },
539
- { latitude: 48.870687845194766, longitude: 2.347918228212595 },
540
- { latitude: 48.87401890252242, longitude: 2.347901065991873 },
541
- { latitude: 48.875483531082025, longitude: 2.348159503994068 },
542
- { latitude: 48.876082639873374, longitude: 2.348352431817903 },
543
- { latitude: 48.877528529751466, longitude: 2.349134703151032 },
544
- { latitude: 48.879103264973295, longitude: 2.349300461788451 },
545
- { latitude: 48.88064322368599, longitude: 2.349852552535392 },
546
- { latitude: 48.88348014130957, longitude: 2.349600316361947 },
547
- { latitude: 48.883724923006355, longitude: 2.34946498589375 },
548
- { latitude: 48.88341423078806, longitude: 2.346909326916857 },
549
- { latitude: 48.88202355548529, longitude: 2.33980196854301 },
550
- { latitude: 48.882386207496275, longitude: 2.337400148117986 },
551
- { latitude: 48.883825698481346, longitude: 2.332482251093436 },
552
- { latitude: 48.88458988070801, longitude: 2.329540571639999 },
553
- { latitude: 48.88370687653772, longitude: 2.328121477639862 },
554
- { latitude: 48.88350780062572, longitude: 2.327423135703935 },
555
- { latitude: 48.88345508679081, longitude: 2.327164725373034 },
556
- { latitude: 48.87618413885571, longitude: 2.326875527168119 },
557
- { latitude: 48.87535450560443, longitude: 2.326636742372628 },
558
- { latitude: 48.8737810482106, longitude: 2.327025197965383 },
559
- { latitude: 48.87342696649887, longitude: 2.326911159247377 },
560
- { latitude: 48.87276167043616, longitude: 2.32646984849174 },
561
- { latitude: 48.87259790076228, longitude: 2.326613754960452 },
562
- { latitude: 48.86957652371833, longitude: 2.325888016639641 },
563
- ],
564
- },
565
- {
566
- name: '75010',
567
- coordinates: [
568
- { latitude: 48.870687845194766, longitude: 2.347918228212595 },
569
- { latitude: 48.869323712716465, longitude: 2.35425267163513 },
570
- { latitude: 48.86882946521955, longitude: 2.356495893113925 },
571
- { latitude: 48.86781627185984, longitude: 2.363290446814835 },
572
- { latitude: 48.86751628680611, longitude: 2.363872116727158 },
573
- { latitude: 48.86823693070764, longitude: 2.365617798452501 },
574
- { latitude: 48.86881945661765, longitude: 2.36761059037576 },
575
- { latitude: 48.86948519613973, longitude: 2.369358394801618 },
576
- { latitude: 48.87072296605545, longitude: 2.373350142111482 },
577
- { latitude: 48.87204825945157, longitude: 2.376904765014237 },
578
- { latitude: 48.87799062237773, longitude: 2.370290292159464 },
579
- { latitude: 48.882467160769735, longitude: 2.37022798018227 },
580
- { latitude: 48.88284025325768, longitude: 2.370032562091205 },
581
- { latitude: 48.88331304763526, longitude: 2.369301392563939 },
582
- { latitude: 48.883872634050874, longitude: 2.368828249426273 },
583
- { latitude: 48.88406515070385, longitude: 2.368498640571453 },
584
- { latitude: 48.88415593345443, longitude: 2.367977988946442 },
585
- { latitude: 48.884366186588224, longitude: 2.364713572113417 },
586
- { latitude: 48.88440647786752, longitude: 2.358943445165456 },
587
- { latitude: 48.883724923006355, longitude: 2.34946498589375 },
588
- { latitude: 48.88348014130957, longitude: 2.349600316361947 },
589
- { latitude: 48.88064322368599, longitude: 2.349852552535392 },
590
- { latitude: 48.879103264973295, longitude: 2.349300461788451 },
591
- { latitude: 48.877528529751466, longitude: 2.349134703151032 },
592
- { latitude: 48.876082639873374, longitude: 2.348352431817903 },
593
- { latitude: 48.875483531082025, longitude: 2.348159503994068 },
594
- { latitude: 48.87401890252242, longitude: 2.347901065991873 },
595
- { latitude: 48.870687845194766, longitude: 2.347918228212595 },
596
- ],
597
- },
598
- {
599
- name: '75011',
600
- coordinates: [
601
- { latitude: 48.848098095643415, longitude: 2.39912112864224 },
602
- { latitude: 48.84887037371109, longitude: 2.399247133361469 },
603
- { latitude: 48.85121814099133, longitude: 2.398443279692394 },
604
- { latitude: 48.856519817264434, longitude: 2.394345091773725 },
605
- { latitude: 48.85762982783316, longitude: 2.392259137884479 },
606
- { latitude: 48.858488337142234, longitude: 2.38953680290813 },
607
- { latitude: 48.862960316687904, longitude: 2.387334803982951 },
608
- { latitude: 48.86626682231115, longitude: 2.383583978668194 },
609
- { latitude: 48.86717829087716, longitude: 2.382970657129259 },
610
- { latitude: 48.87077480734893, longitude: 2.378290113390532 },
611
- { latitude: 48.87204825945157, longitude: 2.376904765014237 },
612
- { latitude: 48.87072296605545, longitude: 2.373350142111482 },
613
- { latitude: 48.86948519613973, longitude: 2.369358394801618 },
614
- { latitude: 48.86881945661765, longitude: 2.36761059037576 },
615
- { latitude: 48.86823693070764, longitude: 2.365617798452501 },
616
- { latitude: 48.86751628680611, longitude: 2.363872116727158 },
617
- { latitude: 48.86730904970824, longitude: 2.364306784904801 },
618
- { latitude: 48.86616998447825, longitude: 2.364890494038093 },
619
- { latitude: 48.86307619289049, longitude: 2.366747947246461 },
620
- { latitude: 48.855805185784135, longitude: 2.368490886682737 },
621
- { latitude: 48.8531662305869, longitude: 2.369123881441927 },
622
- { latitude: 48.853281766619105, longitude: 2.370227747469653 },
623
- { latitude: 48.85238009863526, longitude: 2.372011671463846 },
624
- { latitude: 48.85162652960869, longitude: 2.374776331060795 },
625
- { latitude: 48.85062452055112, longitude: 2.378895746743247 },
626
- { latitude: 48.85045546819052, longitude: 2.380114712394509 },
627
- { latitude: 48.850408294808794, longitude: 2.381426253806176 },
628
- { latitude: 48.85012714200549, longitude: 2.38445763880411 },
629
- { latitude: 48.84837805392065, longitude: 2.395957776088525 },
630
- { latitude: 48.848098095643415, longitude: 2.39912112864224 },
631
- ],
632
- },
633
- {
634
- name: '75012',
635
- coordinates: [
636
- { latitude: 48.82622604799885, longitude: 2.465730572119004 },
637
- { latitude: 48.82732797148774, longitude: 2.466178324692476 },
638
- { latitude: 48.82766730212963, longitude: 2.465232235297585 },
639
- { latitude: 48.82762337988094, longitude: 2.464661941154306 },
640
- { latitude: 48.82835613324069, longitude: 2.464610827079944 },
641
- { latitude: 48.82927659148371, longitude: 2.464702177139618 },
642
- { latitude: 48.83034998496964, longitude: 2.465004468244835 },
643
- { latitude: 48.83131958522624, longitude: 2.465426352616533 },
644
- { latitude: 48.83186996614593, longitude: 2.465822578289197 },
645
- { latitude: 48.83252083864333, longitude: 2.466569253346513 },
646
- { latitude: 48.83350697416217, longitude: 2.468485472111639 },
647
- { latitude: 48.83379747097, longitude: 2.46889120610101 },
648
- { latitude: 48.834471077175294, longitude: 2.469496032469829 },
649
- { latitude: 48.83519517404729, longitude: 2.469724350790882 },
650
- { latitude: 48.836399076703366, longitude: 2.469851066867315 },
651
- { latitude: 48.836787659545045, longitude: 2.469661828529988 },
652
- { latitude: 48.83909938928418, longitude: 2.467319402317012 },
653
- { latitude: 48.84042258650739, longitude: 2.466164109594404 },
654
- { latitude: 48.8411739993649, longitude: 2.465258517101661 },
655
- { latitude: 48.84202339316052, longitude: 2.463741475493356 },
656
- { latitude: 48.8427305321657, longitude: 2.461793922353881 },
657
- { latitude: 48.84318144622756, longitude: 2.459873497765623 },
658
- { latitude: 48.84354999194321, longitude: 2.457843527623448 },
659
- { latitude: 48.844863220184784, longitude: 2.447852827419991 },
660
- { latitude: 48.84496757662449, longitude: 2.446497282929875 },
661
- { latitude: 48.845801966191466, longitude: 2.446646486889991 },
662
- { latitude: 48.84596434934236, longitude: 2.44075815339398 },
663
- { latitude: 48.84443973103078, longitude: 2.440519707011924 },
664
- { latitude: 48.84466425490433, longitude: 2.437958319623623 },
665
- { latitude: 48.84089321785074, longitude: 2.437184204443509 },
666
- { latitude: 48.84119770137154, longitude: 2.433669709036991 },
667
- { latitude: 48.84104601732137, longitude: 2.433544643445916 },
668
- { latitude: 48.84157070580793, longitude: 2.427575156761255 },
669
- { latitude: 48.841807990854, longitude: 2.424919695918368 },
670
- { latitude: 48.84195003388114, longitude: 2.424347225006843 },
671
- { latitude: 48.8421963345545, longitude: 2.42394800402987 },
672
- { latitude: 48.84265550727825, longitude: 2.423491922523838 },
673
- { latitude: 48.844057902638696, longitude: 2.422435387811296 },
674
- { latitude: 48.84443729120398, longitude: 2.421847988927574 },
675
- { latitude: 48.84345636332361, longitude: 2.419859968239216 },
676
- { latitude: 48.84310196352897, longitude: 2.419848924917878 },
677
- { latitude: 48.84257721169392, longitude: 2.419390134732614 },
678
- { latitude: 48.84232163628023, longitude: 2.419357555615491 },
679
- { latitude: 48.84144924086321, longitude: 2.419538952900591 },
680
- { latitude: 48.84043980851661, longitude: 2.420393582068758 },
681
- { latitude: 48.839329002819575, longitude: 2.420930485621125 },
682
- { latitude: 48.83675640610723, longitude: 2.421585771008497 },
683
- { latitude: 48.835797660968844, longitude: 2.422138636243514 },
684
- { latitude: 48.834188794977145, longitude: 2.417337888379133 },
685
- { latitude: 48.833863740527136, longitude: 2.41596829499726 },
686
- { latitude: 48.83371162706515, longitude: 2.413921063446628 },
687
- { latitude: 48.83377882853411, longitude: 2.412586590425243 },
688
- { latitude: 48.83392893878659, longitude: 2.411471874927622 },
689
- { latitude: 48.83453891468698, longitude: 2.41224561256264 },
690
- { latitude: 48.83621650677132, longitude: 2.412852033331908 },
691
- { latitude: 48.84499632197146, longitude: 2.415663673457239 },
692
- { latitude: 48.84662295629071, longitude: 2.415971110769569 },
693
- { latitude: 48.848098095643415, longitude: 2.39912112864224 },
694
- { latitude: 48.84837805392065, longitude: 2.395957776088525 },
695
- { latitude: 48.85012714200549, longitude: 2.38445763880411 },
696
- { latitude: 48.850408294808794, longitude: 2.381426253806176 },
697
- { latitude: 48.85045546819052, longitude: 2.380114712394509 },
698
- { latitude: 48.85062452055112, longitude: 2.378895746743247 },
699
- { latitude: 48.85162652960869, longitude: 2.374776331060795 },
700
- { latitude: 48.85238009863526, longitude: 2.372011671463846 },
701
- { latitude: 48.853281766619105, longitude: 2.370227747469653 },
702
- { latitude: 48.8531662305869, longitude: 2.369123881441927 },
703
- { latitude: 48.847309858182896, longitude: 2.366443514943608 },
704
- { latitude: 48.846185908499045, longitude: 2.364455435684601 },
705
- { latitude: 48.84496784315353, longitude: 2.36608772597324 },
706
- { latitude: 48.83932858921922, longitude: 2.373550475260092 },
707
- { latitude: 48.83760837651768, longitude: 2.37532187433978 },
708
- { latitude: 48.83502323089691, longitude: 2.378358228919764 },
709
- { latitude: 48.830310724138876, longitude: 2.384304749063456 },
710
- { latitude: 48.82674382243462, longitude: 2.388512315585048 },
711
- { latitude: 48.8256923268334, longitude: 2.390072014511326 },
712
- { latitude: 48.8275388425964, longitude: 2.394339872457588 },
713
- { latitude: 48.82772742957781, longitude: 2.395706662977831 },
714
- { latitude: 48.828626438945314, longitude: 2.399205253246101 },
715
- { latitude: 48.82958956721988, longitude: 2.402237349716066 },
716
- { latitude: 48.82917522224744, longitude: 2.40355118197321 },
717
- { latitude: 48.82844370168757, longitude: 2.404928550228594 },
718
- { latitude: 48.82635026937979, longitude: 2.407706677790519 },
719
- { latitude: 48.82550223158657, longitude: 2.409175132460024 },
720
- { latitude: 48.82513447821524, longitude: 2.410104166452181 },
721
- { latitude: 48.824897649004626, longitude: 2.411139313730769 },
722
- { latitude: 48.82474925652957, longitude: 2.412419992792227 },
723
- { latitude: 48.82478587221802, longitude: 2.415303127328633 },
724
- { latitude: 48.82473602165926, longitude: 2.416513222032046 },
725
- { latitude: 48.82408007225992, longitude: 2.419962519541093 },
726
- { latitude: 48.82405851819188, longitude: 2.421826072954111 },
727
- { latitude: 48.824190872609314, longitude: 2.424653634008315 },
728
- { latitude: 48.82412830976086, longitude: 2.426232966554127 },
729
- { latitude: 48.82390004189599, longitude: 2.427958492642779 },
730
- { latitude: 48.82343246086885, longitude: 2.42986096397427 },
731
- { latitude: 48.82315731077904, longitude: 2.430628080921096 },
732
- { latitude: 48.822877281284185, longitude: 2.430370989413491 },
733
- { latitude: 48.821619639807835, longitude: 2.432194835497048 },
734
- { latitude: 48.82190053174164, longitude: 2.432634430984659 },
735
- { latitude: 48.82169308983704, longitude: 2.432890021773652 },
736
- { latitude: 48.82142583088721, longitude: 2.432480242297731 },
737
- { latitude: 48.820158185702816, longitude: 2.434287751289356 },
738
- { latitude: 48.819215861619355, longitude: 2.434144075250626 },
739
- { latitude: 48.819669132169594, longitude: 2.434901851098009 },
740
- { latitude: 48.81959260434536, longitude: 2.436027653556642 },
741
- { latitude: 48.81936479454812, longitude: 2.43692491658807 },
742
- { latitude: 48.81911090908929, longitude: 2.437442471570391 },
743
- { latitude: 48.81817682287283, longitude: 2.437328614686424 },
744
- { latitude: 48.8182912075758, longitude: 2.439853739221728 },
745
- { latitude: 48.817904339357014, longitude: 2.442325672531203 },
746
- { latitude: 48.81787520405805, longitude: 2.44418090156304 },
747
- { latitude: 48.817965657938686, longitude: 2.447786272701002 },
748
- { latitude: 48.81790844861154, longitude: 2.44942252921523 },
749
- { latitude: 48.81772864411715, longitude: 2.450806758669985 },
750
- { latitude: 48.817148977574625, longitude: 2.453452200812278 },
751
- { latitude: 48.81703442399674, longitude: 2.458717081488418 },
752
- { latitude: 48.816996671392914, longitude: 2.459119228635604 },
753
- { latitude: 48.81736539731129, longitude: 2.459115403967742 },
754
- { latitude: 48.818355149167424, longitude: 2.461205214252256 },
755
- { latitude: 48.81905977057768, longitude: 2.462696062752353 },
756
- { latitude: 48.82017755814534, longitude: 2.462867047647515 },
757
- { latitude: 48.82408428543058, longitude: 2.465044244672474 },
758
- { latitude: 48.82622604799885, longitude: 2.465730572119004 },
759
- ],
760
- },
761
- {
762
- name: '75013',
763
- coordinates: [
764
- { latitude: 48.8256923268334, longitude: 2.390072014511326 },
765
- { latitude: 48.82674382243462, longitude: 2.388512315585048 },
766
- { latitude: 48.830310724138876, longitude: 2.384304749063456 },
767
- { latitude: 48.83502323089691, longitude: 2.378358228919764 },
768
- { latitude: 48.83760837651768, longitude: 2.37532187433978 },
769
- { latitude: 48.83932858921922, longitude: 2.373550475260092 },
770
- { latitude: 48.84496784315353, longitude: 2.36608772597324 },
771
- { latitude: 48.84441324001663, longitude: 2.365127018289573 },
772
- { latitude: 48.83994070616588, longitude: 2.361745287380767 },
773
- { latitude: 48.83680458564547, longitude: 2.351870772035156 },
774
- { latitude: 48.8373159561145, longitude: 2.347007359776023 },
775
- { latitude: 48.83834304474304, longitude: 2.3420855672544 },
776
- { latitude: 48.831971728566735, longitude: 2.341072060968536 },
777
- { latitude: 48.83158867633762, longitude: 2.341249912243379 },
778
- { latitude: 48.829424470731965, longitude: 2.341356268572921 },
779
- { latitude: 48.82835285908605, longitude: 2.341600018072803 },
780
- { latitude: 48.8264902090798, longitude: 2.341592211729773 },
781
- { latitude: 48.826448159169985, longitude: 2.341795702304384 },
782
- { latitude: 48.82376077246724, longitude: 2.341460506665151 },
783
- { latitude: 48.82253047839436, longitude: 2.341797487786054 },
784
- { latitude: 48.8214693952813, longitude: 2.342485079713176 },
785
- { latitude: 48.8205031036122, longitude: 2.34372986496089 },
786
- { latitude: 48.819564378724635, longitude: 2.344591545649815 },
787
- { latitude: 48.817772072702724, longitude: 2.344129230885391 },
788
- { latitude: 48.81576700131055, longitude: 2.343902504744146 },
789
- { latitude: 48.81556223808136, longitude: 2.344448463099662 },
790
- { latitude: 48.816015918171495, longitude: 2.344355599882104 },
791
- { latitude: 48.81609244607704, longitude: 2.345190828033564 },
792
- { latitude: 48.815986514627156, longitude: 2.346541772031784 },
793
- { latitude: 48.816046794225414, longitude: 2.347039461823859 },
794
- { latitude: 48.81796203704577, longitude: 2.351253779116589 },
795
- { latitude: 48.818551005944926, longitude: 2.352391840207208 },
796
- { latitude: 48.815922815506724, longitude: 2.355852301315165 },
797
- { latitude: 48.8159428482679, longitude: 2.35623201503909 },
798
- { latitude: 48.816148134601306, longitude: 2.363328923996346 },
799
- { latitude: 48.81639832400939, longitude: 2.36420428117288 },
800
- { latitude: 48.82170074781111, longitude: 2.380767116748347 },
801
- { latitude: 48.82241067607562, longitude: 2.381524148119776 },
802
- { latitude: 48.82372935998316, longitude: 2.385225588159262 },
803
- { latitude: 48.82446306389831, longitude: 2.386941338175521 },
804
- { latitude: 48.825344669637964, longitude: 2.389445425188181 },
805
- { latitude: 48.8256923268334, longitude: 2.390072014511326 },
806
- ],
807
- },
808
- {
809
- name: '75014',
810
- coordinates: [
811
- { latitude: 48.81576700131055, longitude: 2.343902504744146 },
812
- { latitude: 48.817772072702724, longitude: 2.344129230885391 },
813
- { latitude: 48.819564378724635, longitude: 2.344591545649815 },
814
- { latitude: 48.8205031036122, longitude: 2.34372986496089 },
815
- { latitude: 48.8214693952813, longitude: 2.342485079713176 },
816
- { latitude: 48.82253047839436, longitude: 2.341797487786054 },
817
- { latitude: 48.82376077246724, longitude: 2.341460506665151 },
818
- { latitude: 48.826448159169985, longitude: 2.341795702304384 },
819
- { latitude: 48.8264902090798, longitude: 2.341592211729773 },
820
- { latitude: 48.82835285908605, longitude: 2.341600018072803 },
821
- { latitude: 48.829424470731965, longitude: 2.341356268572921 },
822
- { latitude: 48.83158867633762, longitude: 2.341249912243379 },
823
- { latitude: 48.831971728566735, longitude: 2.341072060968536 },
824
- { latitude: 48.83834304474304, longitude: 2.3420855672544 },
825
- { latitude: 48.838863210249016, longitude: 2.33969740550839 },
826
- { latitude: 48.83967110759586, longitude: 2.336656991547953 },
827
- { latitude: 48.84362134269369, longitude: 2.324641767064502 },
828
- { latitude: 48.841083720001784, longitude: 2.321531293255953 },
829
- { latitude: 48.84096466462326, longitude: 2.321471529354067 },
830
- { latitude: 48.840098848173, longitude: 2.321837052015564 },
831
- { latitude: 48.83977706203551, longitude: 2.321394340274795 },
832
- { latitude: 48.84053920528781, longitude: 2.319877474643327 },
833
- { latitude: 48.83630315390716, longitude: 2.31483053793085 },
834
- { latitude: 48.834024151743044, longitude: 2.311855157087501 },
835
- { latitude: 48.830178156237864, longitude: 2.307135337599138 },
836
- { latitude: 48.829822621456245, longitude: 2.306931640548025 },
837
- { latitude: 48.82512576085532, longitude: 2.301315418488453 },
838
- { latitude: 48.82229053545533, longitude: 2.314145699672971 },
839
- { latitude: 48.81824713009672, longitude: 2.332461042459755 },
840
- { latitude: 48.81701092965555, longitude: 2.331898060637625 },
841
- { latitude: 48.81677101758198, longitude: 2.333711090278114 },
842
- { latitude: 48.81633041156168, longitude: 2.341683722695743 },
843
- { latitude: 48.81608499759873, longitude: 2.343013285918382 },
844
- { latitude: 48.81576700131055, longitude: 2.343902504744146 },
845
- ],
846
- },
847
- {
848
- name: '75015',
849
- coordinates: [
850
- { latitude: 48.82833384159797, longitude: 2.289407656009722 },
851
- { latitude: 48.82714158494903, longitude: 2.292191836480193 },
852
- { latitude: 48.82512576085532, longitude: 2.301315418488453 },
853
- { latitude: 48.829822621456245, longitude: 2.306931640548025 },
854
- { latitude: 48.830178156237864, longitude: 2.307135337599138 },
855
- { latitude: 48.834024151743044, longitude: 2.311855157087501 },
856
- { latitude: 48.83630315390716, longitude: 2.31483053793085 },
857
- { latitude: 48.84053920528781, longitude: 2.319877474643327 },
858
- { latitude: 48.83977706203551, longitude: 2.321394340274795 },
859
- { latitude: 48.840098848173, longitude: 2.321837052015564 },
860
- { latitude: 48.84096466462326, longitude: 2.321471529354067 },
861
- { latitude: 48.841083720001784, longitude: 2.321531293255953 },
862
- { latitude: 48.84362134269369, longitude: 2.324641767064502 },
863
- { latitude: 48.84516563132351, longitude: 2.319893405967863 },
864
- { latitude: 48.84663569580366, longitude: 2.31698262350471 },
865
- { latitude: 48.8468634910953, longitude: 2.316712552321029 },
866
- { latitude: 48.84594337806365, longitude: 2.313715867497841 },
867
- { latitude: 48.84797630479076, longitude: 2.310494899377193 },
868
- { latitude: 48.847433437634464, longitude: 2.308218200598362 },
869
- { latitude: 48.84713344729916, longitude: 2.307354149221546 },
870
- { latitude: 48.8510622115364, longitude: 2.301227956943836 },
871
- { latitude: 48.85138469655275, longitude: 2.3005463196733 },
872
- { latitude: 48.857475043730936, longitude: 2.291053303527222 },
873
- { latitude: 48.85818288040792, longitude: 2.289695682973308 },
874
- { latitude: 48.85702108344801, longitude: 2.288513487011697 },
875
- { latitude: 48.85613429105026, longitude: 2.288206671073602 },
876
- { latitude: 48.85576425362537, longitude: 2.28783692345414 },
877
- { latitude: 48.84888826708062, longitude: 2.278021048066484 },
878
- { latitude: 48.84724764765358, longitude: 2.276056963888965 },
879
- { latitude: 48.8368383991733, longitude: 2.26603238468276 },
880
- { latitude: 48.83392337353757, longitude: 2.262791524526515 },
881
- { latitude: 48.834592508407525, longitude: 2.267475422198173 },
882
- { latitude: 48.83442815872476, longitude: 2.268101694609093 },
883
- { latitude: 48.83301112513089, longitude: 2.269930760703455 },
884
- { latitude: 48.831531984417225, longitude: 2.267338606820312 },
885
- { latitude: 48.82796859562667, longitude: 2.267625707632298 },
886
- { latitude: 48.827835816786674, longitude: 2.267826452957426 },
887
- { latitude: 48.82792008423927, longitude: 2.272793190186762 },
888
- { latitude: 48.82943549605779, longitude: 2.275304441773053 },
889
- { latitude: 48.832489952159186, longitude: 2.279051930653325 },
890
- { latitude: 48.83079578621541, longitude: 2.28358582721177 },
891
- { latitude: 48.82833384159797, longitude: 2.289407656009722 },
892
- ],
893
- },
894
- {
895
- name: '75016',
896
- coordinates: [
897
- { latitude: 48.859404562409956, longitude: 2.22567029225698 },
898
- { latitude: 48.85615417947494, longitude: 2.224407449942075 },
899
- { latitude: 48.853516917570474, longitude: 2.224219105880448 },
900
- { latitude: 48.8528118999558, longitude: 2.22659415034592 },
901
- { latitude: 48.85004249476624, longitude: 2.239179626559884 },
902
- { latitude: 48.84983219823168, longitude: 2.239770051491471 },
903
- { latitude: 48.84957131323047, longitude: 2.240184049668479 },
904
- { latitude: 48.84765777953375, longitude: 2.242362313011173 },
905
- { latitude: 48.84555514449767, longitude: 2.25051568878781 },
906
- { latitude: 48.845485576383105, longitude: 2.252477551164905 },
907
- { latitude: 48.84289019705539, longitude: 2.25121623048677 },
908
- { latitude: 48.83882181624815, longitude: 2.251709308946857 },
909
- { latitude: 48.83480954938314, longitude: 2.255144238417506 },
910
- { latitude: 48.83392337353757, longitude: 2.262791524526515 },
911
- { latitude: 48.8368383991733, longitude: 2.26603238468276 },
912
- { latitude: 48.84724764765358, longitude: 2.276056963888965 },
913
- { latitude: 48.84888826708062, longitude: 2.278021048066484 },
914
- { latitude: 48.85576425362537, longitude: 2.28783692345414 },
915
- { latitude: 48.85613429105026, longitude: 2.288206671073602 },
916
- { latitude: 48.85702108344801, longitude: 2.288513487011697 },
917
- { latitude: 48.85818288040792, longitude: 2.289695682973308 },
918
- { latitude: 48.860253620211, longitude: 2.292195882851742 },
919
- { latitude: 48.861246340432466, longitude: 2.293689941916094 },
920
- { latitude: 48.861875619399484, longitude: 2.294864562062728 },
921
- { latitude: 48.86261949443383, longitude: 2.296870514172013 },
922
- { latitude: 48.863144008401505, longitude: 2.298589132813498 },
923
- { latitude: 48.86328352059519, longitude: 2.299222465550165 },
924
- { latitude: 48.863496076964175, longitude: 2.301737287583634 },
925
- { latitude: 48.86449106268491, longitude: 2.301635346720621 },
926
- { latitude: 48.8650075721619, longitude: 2.300297979606478 },
927
- { latitude: 48.864986916136104, longitude: 2.299841599006072 },
928
- { latitude: 48.86553729851455, longitude: 2.29983829121079 },
929
- { latitude: 48.868644254049464, longitude: 2.298866790658252 },
930
- { latitude: 48.87093857212867, longitude: 2.297501223263733 },
931
- { latitude: 48.87330312962187, longitude: 2.295542880656993 },
932
- { latitude: 48.87377317675925, longitude: 2.295032069299387 },
933
- { latitude: 48.87857312399539, longitude: 2.279949332567545 },
934
- { latitude: 48.878531568022304, longitude: 2.279469949480847 },
935
- { latitude: 48.87796832086615, longitude: 2.277487029813821 },
936
- { latitude: 48.88038726309937, longitude: 2.258467171114177 },
937
- { latitude: 48.874263542689825, longitude: 2.255410336689475 },
938
- { latitude: 48.87408088138245, longitude: 2.254817140668558 },
939
- { latitude: 48.8761415911801, longitude: 2.24653328131267 },
940
- { latitude: 48.87645923248996, longitude: 2.245703788405577 },
941
- { latitude: 48.87378465913534, longitude: 2.243010273208006 },
942
- { latitude: 48.8729013887102, longitude: 2.241856061513683 },
943
- { latitude: 48.87234161752639, longitude: 2.240945304504729 },
944
- { latitude: 48.87157344357182, longitude: 2.239225056762461 },
945
- { latitude: 48.8705231346677, longitude: 2.235575811057111 },
946
- { latitude: 48.8698977965053, longitude: 2.233702274504687 },
947
- { latitude: 48.8690685816238, longitude: 2.23173635974686 },
948
- { latitude: 48.868079566940466, longitude: 2.230658982743393 },
949
- { latitude: 48.86538030260198, longitude: 2.228377351113232 },
950
- { latitude: 48.862384917783594, longitude: 2.227181294011469 },
951
- { latitude: 48.859404562409956, longitude: 2.22567029225698 },
952
- ],
953
- },
954
- {
955
- name: '75017',
956
- coordinates: [
957
- { latitude: 48.900459782103866, longitude: 2.319887174744136 },
958
- { latitude: 48.89963812815515, longitude: 2.318520205834404 },
959
- { latitude: 48.897782317992146, longitude: 2.312451445254303 },
960
- { latitude: 48.8960101863785, longitude: 2.307687317214232 },
961
- { latitude: 48.89415377896271, longitude: 2.303774362351613 },
962
- { latitude: 48.89171715165069, longitude: 2.298628375977243 },
963
- { latitude: 48.88987478127485, longitude: 2.295013183223064 },
964
- { latitude: 48.889455535247485, longitude: 2.291633908192159 },
965
- { latitude: 48.88930157078857, longitude: 2.291147763745907 },
966
- { latitude: 48.8865546635736, longitude: 2.28564161638002 },
967
- { latitude: 48.885639278215145, longitude: 2.284459571754662 },
968
- { latitude: 48.88557409668247, longitude: 2.284538198303594 },
969
- { latitude: 48.8829709900862, longitude: 2.28101351971156 },
970
- { latitude: 48.88279222371682, longitude: 2.280897352279333 },
971
- { latitude: 48.87857312399539, longitude: 2.279949332567545 },
972
- { latitude: 48.87377317675925, longitude: 2.295032069299387 },
973
- { latitude: 48.87807688568086, longitude: 2.29815486307795 },
974
- { latitude: 48.88043436140222, longitude: 2.308874779443685 },
975
- { latitude: 48.88134138388508, longitude: 2.316479725210514 },
976
- { latitude: 48.88345508679081, longitude: 2.327164725373034 },
977
- { latitude: 48.88350780062572, longitude: 2.327423135703935 },
978
- { latitude: 48.88750763509561, longitude: 2.325595877207139 },
979
- { latitude: 48.90104370553223, longitude: 2.330147116964155 },
980
- { latitude: 48.900775849620445, longitude: 2.320434138736962 },
981
- { latitude: 48.900459782103866, longitude: 2.319887174744136 },
982
- ],
983
- },
984
- {
985
- name: '75018',
986
- coordinates: [
987
- { latitude: 48.90104370553223, longitude: 2.330147116964155 },
988
- { latitude: 48.88750763509561, longitude: 2.325595877207139 },
989
- { latitude: 48.88350780062572, longitude: 2.327423135703935 },
990
- { latitude: 48.88370687653772, longitude: 2.328121477639862 },
991
- { latitude: 48.88458988070801, longitude: 2.329540571639999 },
992
- { latitude: 48.883825698481346, longitude: 2.332482251093436 },
993
- { latitude: 48.882386207496275, longitude: 2.337400148117986 },
994
- { latitude: 48.88202355548529, longitude: 2.33980196854301 },
995
- { latitude: 48.88341423078806, longitude: 2.346909326916857 },
996
- { latitude: 48.883724923006355, longitude: 2.34946498589375 },
997
- { latitude: 48.88440647786752, longitude: 2.358943445165456 },
998
- { latitude: 48.884366186588224, longitude: 2.364713572113417 },
999
- { latitude: 48.88664424349012, longitude: 2.366762718491148 },
1000
- { latitude: 48.88862427851229, longitude: 2.36756099045785 },
1001
- { latitude: 48.891028986832545, longitude: 2.368738771328434 },
1002
- { latitude: 48.89400536979352, longitude: 2.370035221900148 },
1003
- { latitude: 48.894703718756226, longitude: 2.370639174782484 },
1004
- { latitude: 48.89539325119283, longitude: 2.371791555807095 },
1005
- { latitude: 48.89579788926028, longitude: 2.371267006547412 },
1006
- { latitude: 48.89599436181304, longitude: 2.371175976445193 },
1007
- { latitude: 48.89665858510903, longitude: 2.370420494086907 },
1008
- { latitude: 48.89991143474197, longitude: 2.37025429708778 },
1009
- { latitude: 48.90094336965187, longitude: 2.370334571644305 },
1010
- { latitude: 48.90155583737034, longitude: 2.370170291188828 },
1011
- { latitude: 48.90184790618994, longitude: 2.370301804653317 },
1012
- { latitude: 48.90175754961884, longitude: 2.365619903608482 },
1013
- { latitude: 48.90148489872572, longitude: 2.35198353616043 },
1014
- { latitude: 48.90104370553223, longitude: 2.330147116964155 },
1015
- ],
1016
- },
1017
- {
1018
- name: '75019',
1019
- coordinates: [
1020
- { latitude: 48.901161349328916, longitude: 2.389332400904481 },
1021
- { latitude: 48.90214759336665, longitude: 2.384530045616338 },
1022
- { latitude: 48.90184790618994, longitude: 2.370301804653317 },
1023
- { latitude: 48.90155583737034, longitude: 2.370170291188828 },
1024
- { latitude: 48.90094336965187, longitude: 2.370334571644305 },
1025
- { latitude: 48.89991143474197, longitude: 2.37025429708778 },
1026
- { latitude: 48.89665858510903, longitude: 2.370420494086907 },
1027
- { latitude: 48.89599436181304, longitude: 2.371175976445193 },
1028
- { latitude: 48.89579788926028, longitude: 2.371267006547412 },
1029
- { latitude: 48.89539325119283, longitude: 2.371791555807095 },
1030
- { latitude: 48.894703718756226, longitude: 2.370639174782484 },
1031
- { latitude: 48.89400536979352, longitude: 2.370035221900148 },
1032
- { latitude: 48.891028986832545, longitude: 2.368738771328434 },
1033
- { latitude: 48.88862427851229, longitude: 2.36756099045785 },
1034
- { latitude: 48.88664424349012, longitude: 2.366762718491148 },
1035
- { latitude: 48.884366186588224, longitude: 2.364713572113417 },
1036
- { latitude: 48.88415593345443, longitude: 2.367977988946442 },
1037
- { latitude: 48.88406515070385, longitude: 2.368498640571453 },
1038
- { latitude: 48.883872634050874, longitude: 2.368828249426273 },
1039
- { latitude: 48.88331304763526, longitude: 2.369301392563939 },
1040
- { latitude: 48.88284025325768, longitude: 2.370032562091205 },
1041
- { latitude: 48.882467160769735, longitude: 2.37022798018227 },
1042
- { latitude: 48.87799062237773, longitude: 2.370290292159464 },
1043
- { latitude: 48.87204825945157, longitude: 2.376904765014237 },
1044
- { latitude: 48.87230118280218, longitude: 2.377636578896359 },
1045
- { latitude: 48.872855789129034, longitude: 2.37983449373543 },
1046
- { latitude: 48.87341004977963, longitude: 2.382670514713277 },
1047
- { latitude: 48.873755493311755, longitude: 2.384960981845434 },
1048
- { latitude: 48.87460137709541, longitude: 2.386813394433955 },
1049
- { latitude: 48.87476467291205, longitude: 2.388496636417808 },
1050
- { latitude: 48.87530293935915, longitude: 2.389645129763283 },
1051
- { latitude: 48.87543928049738, longitude: 2.39045749316421 },
1052
- { latitude: 48.87546284659465, longitude: 2.392262384706681 },
1053
- { latitude: 48.875247751886285, longitude: 2.395250770064706 },
1054
- { latitude: 48.8754912960971, longitude: 2.398965987022433 },
1055
- { latitude: 48.8759957893625, longitude: 2.402552808956574 },
1056
- { latitude: 48.877055178904335, longitude: 2.406163368113694 },
1057
- { latitude: 48.877182706305746, longitude: 2.406853189526919 },
1058
- { latitude: 48.878206930961, longitude: 2.409924373433166 },
1059
- { latitude: 48.87843617582368, longitude: 2.410820319151064 },
1060
- { latitude: 48.8802555133981, longitude: 2.409359835767223 },
1061
- { latitude: 48.88126873962876, longitude: 2.40457585141299 },
1062
- { latitude: 48.88263120606274, longitude: 2.401507160545184 },
1063
- { latitude: 48.88382119876317, longitude: 2.400106665255306 },
1064
- { latitude: 48.885361950398725, longitude: 2.399251617609397 },
1065
- { latitude: 48.888532380125696, longitude: 2.399135941386648 },
1066
- { latitude: 48.88953234877588, longitude: 2.398941654577955 },
1067
- { latitude: 48.89264044860453, longitude: 2.398236114786815 },
1068
- { latitude: 48.89460619615223, longitude: 2.397667826349163 },
1069
- { latitude: 48.898169708064955, longitude: 2.395610584956599 },
1070
- { latitude: 48.90090731297284, longitude: 2.390837239618765 },
1071
- { latitude: 48.901161349328916, longitude: 2.389332400904481 },
1072
- ],
1073
- },
1074
- {
1075
- name: '75020',
1076
- coordinates: [
1077
- { latitude: 48.85517782834211, longitude: 2.415286455935683 },
1078
- { latitude: 48.86064945777895, longitude: 2.414370428780847 },
1079
- { latitude: 48.864712425928325, longitude: 2.413951255837119 },
1080
- { latitude: 48.86954537097517, longitude: 2.413932326856992 },
1081
- { latitude: 48.872438026487984, longitude: 2.413646198880089 },
1082
- { latitude: 48.87314025051987, longitude: 2.413431063629795 },
1083
- { latitude: 48.87644319371046, longitude: 2.412453090020587 },
1084
- { latitude: 48.87843617582368, longitude: 2.410820319151064 },
1085
- { latitude: 48.878206930961, longitude: 2.409924373433166 },
1086
- { latitude: 48.877182706305746, longitude: 2.406853189526919 },
1087
- { latitude: 48.877055178904335, longitude: 2.406163368113694 },
1088
- { latitude: 48.8759957893625, longitude: 2.402552808956574 },
1089
- { latitude: 48.8754912960971, longitude: 2.398965987022433 },
1090
- { latitude: 48.875247751886285, longitude: 2.395250770064706 },
1091
- { latitude: 48.87546284659465, longitude: 2.392262384706681 },
1092
- { latitude: 48.87543928049738, longitude: 2.39045749316421 },
1093
- { latitude: 48.87530293935915, longitude: 2.389645129763283 },
1094
- { latitude: 48.87476467291205, longitude: 2.388496636417808 },
1095
- { latitude: 48.87460137709541, longitude: 2.386813394433955 },
1096
- { latitude: 48.873755493311755, longitude: 2.384960981845434 },
1097
- { latitude: 48.87341004977963, longitude: 2.382670514713277 },
1098
- { latitude: 48.872855789129034, longitude: 2.37983449373543 },
1099
- { latitude: 48.87230118280218, longitude: 2.377636578896359 },
1100
- { latitude: 48.87204825945157, longitude: 2.376904765014237 },
1101
- { latitude: 48.87077480734893, longitude: 2.378290113390532 },
1102
- { latitude: 48.86717829087716, longitude: 2.382970657129259 },
1103
- { latitude: 48.86626682231115, longitude: 2.383583978668194 },
1104
- { latitude: 48.862960316687904, longitude: 2.387334803982951 },
1105
- { latitude: 48.858488337142234, longitude: 2.38953680290813 },
1106
- { latitude: 48.85762982783316, longitude: 2.392259137884479 },
1107
- { latitude: 48.856519817264434, longitude: 2.394345091773725 },
1108
- { latitude: 48.85121814099133, longitude: 2.398443279692394 },
1109
- { latitude: 48.84887037371109, longitude: 2.399247133361469 },
1110
- { latitude: 48.848098095643415, longitude: 2.39912112864224 },
1111
- { latitude: 48.84662295629071, longitude: 2.415971110769569 },
1112
- { latitude: 48.848699611169536, longitude: 2.416349838517879 },
1113
- { latitude: 48.84923378356546, longitude: 2.416341130298895 },
1114
- { latitude: 48.85517782834211, longitude: 2.415286455935683 },
1115
- ],
1116
- },
1117
- ];
1118
-
1119
- const formatData = (geoResults) => {
1120
- const getOutline = (city, zipcode) => {
1121
- if (!geoResults || geoResults.length === 0)
275
+ if (typeof searchValue !== 'string') {
1122
276
  return [];
1123
- if (city === 'Paris') {
1124
- const outline = parisOutline.find(outline => outline.name === zipcode);
1125
- if (outline) {
1126
- return outline.coordinates;
1127
- }
1128
277
  }
1129
- return [];
1130
- };
1131
- return geoResults.map(result => {
1132
- const customOutline = getOutline(result.nom, result.codesPostaux[0]);
1133
- let outline = [];
1134
- if (customOutline.length > 0) {
1135
- outline = [customOutline];
1136
- }
1137
- else if (result.contour.type === 'Polygon') {
1138
- outline = [result.contour.coordinates[0].map(([longitude, latitude]) => ({ longitude, latitude }))];
278
+ if (isNaN(parseInt(searchValue)) && searchType.includes('city')) {
279
+ const result = yield searchByMunicipality(searchValue, options);
280
+ return result;
1139
281
  }
1140
- else if (result.contour.type === 'MultiPolygon') {
1141
- outline = result.contour.coordinates.map(([coordinates]) => coordinates.map(([longitude, latitude]) => ({ longitude, latitude })));
282
+ if (!isNaN(parseInt(searchValue)) && searchValue.length === 5 && searchType.includes('zipcode')) {
283
+ const result = yield searchByZipcode(searchValue, options);
284
+ return result;
1142
285
  }
1143
- return {
1144
- center: { latitude: result.centre.coordinates[1], longitude: result.centre.coordinates[0] },
1145
- city: result.nom,
1146
- code: result.code,
1147
- coordinates: result.centre.coordinates,
1148
- zipcode: result.codesPostaux[0],
1149
- outline,
1150
- };
1151
- });
1152
- };
1153
- const getData = (search, signal) => __awaiter(void 0, void 0, void 0, function* () {
1154
- try {
1155
- let geoResults = [];
1156
- const geoResponse = yield fetch(`https://geo.api.gouv.fr/communes?lat=${search.latitude}&lon=${search.longitude}&type=arrondissement-municipal&fields=departement,codesPostaux,centre,contour`, { signal });
1157
- if (!geoResponse.ok)
1158
- return Promise.reject(geoResponse);
1159
- geoResults = yield geoResponse.json();
1160
- if (geoResults.length === 0) {
1161
- const geoResponse = yield fetch(`https://geo.api.gouv.fr/communes?lat=${search.latitude}&lon=${search.longitude}&fields=departement,codesPostaux,centre,contour`, { signal });
1162
- if (!geoResponse.ok)
1163
- return Promise.reject(geoResponse);
1164
- geoResults = yield geoResponse.json();
1165
- }
1166
- return formatData(geoResults);
286
+ return [];
1167
287
  }
1168
288
  catch (error) {
1169
- if (typeof error === 'string')
1170
- throw new Error(error);
1171
- throw new Error(error instanceof Error && error.message ? error.message : 'An error occurred.');
289
+ console.log('An error occurred while searching for places');
290
+ console.log(error);
291
+ return [];
1172
292
  }
1173
293
  });
1174
- let getDelayedData;
1175
- const get = (search, debounceValue = 300, signal) => {
1176
- clearTimeout(getDelayedData);
1177
- return new Promise((resolve, reject) => {
1178
- getDelayedData = setTimeout(() => {
1179
- resolve(getData(search, signal));
1180
- }, debounceValue);
1181
- });
1182
- };
1183
-
1184
- var reverseGeolocSearch = /*#__PURE__*/Object.freeze({
1185
- __proto__: null,
1186
- get: get
1187
- });
294
+ const searchDepartment = (searchValue, options) => searchByDepartment(searchValue, options);
295
+ const searchAddress = (searchValue, options) => searchByAddress(searchValue, options);
296
+ /* Deprecated names */
297
+ /**
298
+ * @deprecated Use searchPlaces instead
299
+ */
300
+ const municipalitySearch = searchPlaces;
301
+ /**
302
+ * @deprecated Use searchPlaces instead
303
+ */
304
+ const geolocSearch = searchPlaces;
305
+ /**
306
+ * @deprecated Use searchByCoordinates instead
307
+ */
308
+ const reverseGeolocSearch = searchByCoordinates;
309
+ /**
310
+ * @deprecated Use searchAddress instead
311
+ */
312
+ const addressSearch = searchByAddress;
1188
313
 
1189
- export { addressSearch, countrySearch, geolocSearch, municipalitySearch, reverseGeolocSearch };
314
+ export { addressSearch, geolocSearch, municipalitySearch, reverseGeolocSearch, searchAddress, searchByCountry as searchCountry, searchDepartment, searchPlaces };