Skip to content

Commit 6ca81ca

Browse files
authored
Minor comments and test layout improvement for map (#634)
1 parent e4fcd64 commit 6ca81ca

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

packages/blocks/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ You can now use the components in your app:
3232

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

35+
## Environment Variables
36+
37+
Google maps requires an API key `VITE_GOOGLE_MAPS_API_KEY` to be defined in .env
38+
We support Google Maps for rendering maps. If no API key is provided, we fall back to OpenStreet even if Google Maps is selected
39+
3540
## Playground
3641

3742
The playground can be used during development but is not used outside of the package.

packages/blocks/src/lib/maplibre/style.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const getGoogleMapsStyle = (
1313
[MapProviders.googleMaps]: {
1414
type: 'raster',
1515
tiles: [
16+
// The apiKey is not actually needed here for some reason. TODO: Update to use the google maps tile api ASAP.
1617
`https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}&key=${apiKey}`,
1718
],
1819
tileSize,
@@ -22,6 +23,7 @@ const getGoogleMapsStyle = (
2223
satellite: {
2324
type: 'raster',
2425
tiles: [
26+
// The apiKey is not actually needed here for some reason. TODO: Update to use the google maps tile api ASAP.
2527
`https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}&key=${apiKey}`,
2628
],
2729
tileSize: 256,

packages/blocks/src/routes/+page.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,12 @@ const path = () =>
6464
mapProvider="google-maps"
6565
mapProviderKey={import.meta.env.VITE_GOOGLE_MAPS_API_KEY}
6666
>
67-
<NavigationControls />
68-
<SatelliteControls />
67+
<div class="absolute right-12 top-2.5 z-10 flex items-center gap-2">
68+
<NavigationControls />
69+
<SatelliteControls />
70+
</div>
6971
</MapLibre>
7072
</div>
7173
</div>
72-
7374
<FollowingMarker />
7475
</div>

0 commit comments

Comments
 (0)