in src/AmplifyMapLibreGeocoder.ts [8:36]
forwardGeocode: async (config) => {
const features = [];
try {
const data = await Geo.searchByText(config.query, {
biasPosition: config.proximity,
searchAreaConstraints: config.bbox,
countries: config.countires,
maxResults: config.limit,
});
if (data) {
data.forEach((result) => {
const { geometry, ...otherResults } = result;
features.push({
type: "Feature",
geometry: { type: "Point", coordinates: geometry.point },
properties: { ...otherResults },
place_name: otherResults.label,
text: otherResults.label,
center: geometry.point,
});
});
}
} catch (e) {
console.error(`Failed to forwardGeocode with error: ${e}`);
}
return { features };
},