Component live demo
You can extend this HTML element with generic attributes like
aria-label
…
Embed an interactive map in your webpage. Using Leaflet.js under the hood.
You can extend this HTML element with generic attributes like
aria-label
…
Embed interactive geographical maps in your webpage.
Using Leaflet.js under the hood.
pnpm i astro-geo-map
# Optional
pnpm i -D @types/leaflet
---
import { GeoMap } from 'astro-geo-map';
// ...
---
<!-- ... -->
<body>
<!-- Place component inside `BODY` tag -->
<GeoMap
x={43.389636 /* Required */}
y={5.3964332 /* Required */}
z={11}
height={'25rem' /* Required */}
width={'25rem'}
attribution={true}
/>
<!-- ... -->
</body>
You might want to add this to your astro.config
:
export default defineConfig({
/* ... */
vite: { optimizeDeps: { include: ['leaflet'] } },
});
So client-side, third-party JS will be loaded properly, instead of getting this error:
SyntaxError: Importing binding name 'default' cannot be resolved by star
If dependency issues persists, try installing leaflet@1.9.0
.
Extends: MapOptions
All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.
Note: Version bump only for package astro-geo-map
Note: Version bump only for package astro-geo-map
Note: Version bump only for package @julian_cataldo/astro-media-map
Note: Version bump only for package @julian_cataldo/astro-media-map
Note: Version bump only for package @julian_cataldo/astro-media-map
Note: Version bump only for package @julian_cataldo/astro-media-map
define:vars
breaking render (c57e799)Note: Version bump only for package @julian_cataldo/astro-media-map
Note: Version bump only for package @julian_cataldo/astro-media-map
Note: Version bump only for package @julian_cataldo/astro-media-map
Note: Version bump only for package @julian_cataldo/astro-media-map
Note: Version bump only for package @julian_cataldo/astro-media-map
Note: Version bump only for package @julian_cataldo/astro-media-map
Note: Version bump only for package @julian_cataldo/astro-media-map
Note: Version bump only for package @julian_cataldo/astro-media-map
Note: Version bump only for package @julian_cataldo/astro-media-map