@pretto/places 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +10 -3
- package/dist/module.js +10 -3
- package/dist/reverseGeolocSearch.d.ts +1 -1
- package/dist/reverseGeolocSearch.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1125,9 +1125,16 @@ const formatData = (geoResults, addressResults) => {
|
|
|
1125
1125
|
};
|
|
1126
1126
|
return geoResults.map(result => {
|
|
1127
1127
|
const customOutline = getOutline(result.nom, postcode);
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1128
|
+
let outline = [];
|
|
1129
|
+
if (customOutline.length > 0) {
|
|
1130
|
+
outline = [customOutline];
|
|
1131
|
+
}
|
|
1132
|
+
else if (result.contour.type === 'Polygon') {
|
|
1133
|
+
outline = [result.contour.coordinates[0].map(([longitude, latitude]) => ({ longitude, latitude }))];
|
|
1134
|
+
}
|
|
1135
|
+
else if (result.contour.type === 'MultiPolygon') {
|
|
1136
|
+
outline = result.contour.coordinates.map(([coordinates]) => coordinates.map(([longitude, latitude]) => ({ longitude, latitude })));
|
|
1137
|
+
}
|
|
1131
1138
|
return {
|
|
1132
1139
|
center: { latitude: result.centre.coordinates[1], longitude: result.centre.coordinates[0] },
|
|
1133
1140
|
city: result.nom,
|
package/dist/module.js
CHANGED
|
@@ -1115,9 +1115,16 @@ const formatData = (geoResults, addressResults) => {
|
|
|
1115
1115
|
};
|
|
1116
1116
|
return geoResults.map(result => {
|
|
1117
1117
|
const customOutline = getOutline(result.nom, postcode);
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1118
|
+
let outline = [];
|
|
1119
|
+
if (customOutline.length > 0) {
|
|
1120
|
+
outline = [customOutline];
|
|
1121
|
+
}
|
|
1122
|
+
else if (result.contour.type === 'Polygon') {
|
|
1123
|
+
outline = [result.contour.coordinates[0].map(([longitude, latitude]) => ({ longitude, latitude }))];
|
|
1124
|
+
}
|
|
1125
|
+
else if (result.contour.type === 'MultiPolygon') {
|
|
1126
|
+
outline = result.contour.coordinates.map(([coordinates]) => coordinates.map(([longitude, latitude]) => ({ longitude, latitude })));
|
|
1127
|
+
}
|
|
1121
1128
|
return {
|
|
1122
1129
|
center: { latitude: result.centre.coordinates[1], longitude: result.centre.coordinates[0] },
|
|
1123
1130
|
city: result.nom,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reverseGeolocSearch.d.ts","sourceRoot":"","sources":["../src/reverseGeolocSearch.ts"],"names":[],"mappings":"AAEA,oBAAY,yBAAyB,GAAG;IACtC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/C,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,OAAO,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"reverseGeolocSearch.d.ts","sourceRoot":"","sources":["../src/reverseGeolocSearch.ts"],"names":[],"mappings":"AAEA,oBAAY,yBAAyB,GAAG;IACtC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/C,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,OAAO,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAA;IACzD,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB,CAAA;AA4GD,eAAO,MAAM,GAAG,WACN;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,kBAChC,MAAM,uCAEpB,QAAQ,yBAAyB,EAAE,CAQrC,CAAA"}
|