your personal website on atproto - mirror blento.app
26
fork

Configure Feed

Select the types of activity you want to include in your feed.

update nomatim search

Florian b86567fd 181e890d

+21 -2
+14
src/lib/cards/MapCard/CreateMapCardModal.svelte
··· 44 44 <Alert type="error" title="Failed to create map card"><span>{errorMessage}</span></Alert> 45 45 {/if} 46 46 47 + <p class="text-xs"> 48 + Geocoding by <a 49 + href="https://nominatim.openstreetmap.org/" 50 + class="text-accent-800 dark:text-accent-300" 51 + target="_blank">Nominatim</a 52 + > 53 + / © 54 + <a 55 + href="https://www.openstreetmap.org/copyright" 56 + class="text-accent-800 dark:text-accent-300" 57 + target="_blank">OpenStreetMap contributors</a 58 + > 59 + </p> 60 + 47 61 <div class="mt-4 flex justify-end gap-2"> 48 62 <Button onclick={oncancel} variant="ghost">Cancel</Button> 49 63 <Button
+7 -2
src/routes/api/geocoding/+server.ts
··· 1 + import { env } from '$env/dynamic/private'; 1 2 import { json } from '@sveltejs/kit'; 2 3 3 4 export async function GET({ url }) { ··· 8 9 9 10 const nomUrl = 10 11 'https://nominatim.openstreetmap.org/search?format=json&q=' + encodeURIComponent(q); 11 - console.log(url); 12 12 13 13 try { 14 - const data = await fetch(nomUrl); 14 + const data = await fetch(nomUrl, { 15 + headers: { 16 + 'User-Agent': 'blento.app/0.1 (contact: flobit.dev@gmail.com)', 17 + Referer: env.PUBLIC_DOMAIN || 'https://blento.app' 18 + } 19 + }); 15 20 console.error(data.status, data.statusText); 16 21 const location = await data.json(); 17 22