Locations added
This commit is contained in:
11
frontend/lib/osmEmbed.ts
Normal file
11
frontend/lib/osmEmbed.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
// Construct OSM embed URL
|
||||
const getOsmEmbedUrl = (lat: number, lon: number) => {
|
||||
const delta = 0.005; // Adjust zoom level
|
||||
const minLon = lon - delta;
|
||||
const minLat = lat - delta;
|
||||
const maxLon = lon + delta;
|
||||
const maxLat = lat + delta;
|
||||
return `https://www.openstreetmap.org/export/embed.html?bbox=${minLon},${minLat},${maxLon},${maxLat}&marker=${lat},${lon}&layer=mapnik`;
|
||||
};
|
||||
|
||||
export default getOsmEmbedUrl;
|
||||
Reference in New Issue
Block a user