@pretto/places 0.26.0 → 0.30.0

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