Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/blocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ You can now use the components in your app:

[sveltekit]: https://kit.svelte.dev/

## Environment Variables

Google maps requires an API key `VITE_GOOGLE_MAPS_API_KEY` to be defined in .env
We support Google Maps for rendering maps. If no API key is provided, we fall back to OpenStreet even if Google Maps is selected

## Playground

The playground can be used during development but is not used outside of the package.
Expand Down
2 changes: 2 additions & 0 deletions packages/blocks/src/lib/maplibre/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const getGoogleMapsStyle = (
[MapProviders.googleMaps]: {
type: 'raster',
tiles: [
// The apiKey is not actually needed here for some reason. TODO: Update to use the google maps tile api ASAP.
`https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}&key=${apiKey}`,
],
tileSize,
Expand All @@ -22,6 +23,7 @@ const getGoogleMapsStyle = (
satellite: {
type: 'raster',
tiles: [
// The apiKey is not actually needed here for some reason. TODO: Update to use the google maps tile api ASAP.
`https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}&key=${apiKey}`,
],
tileSize: 256,
Expand Down
7 changes: 4 additions & 3 deletions packages/blocks/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ const path = () =>
mapProvider="google-maps"
mapProviderKey={import.meta.env.VITE_GOOGLE_MAPS_API_KEY}
>
<NavigationControls />
<SatelliteControls />
<div class="absolute right-12 top-2.5 z-10 flex items-center gap-2">
<NavigationControls />
<SatelliteControls />
</div>
</MapLibre>
</div>
</div>

<FollowingMarker />
</div>