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