Skip to content

Commit 19b87d8

Browse files
committed
feat: enhance map rendering with 3D view and dark color map
1 parent 0585d27 commit 19b87d8

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

src/pages/index.astro

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ import Layout from '../layouts/Layout.astro';
3434
<script is:inline>
3535
(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({
3636
key: "AIzaSyD4YVEYyDMupCWQG_uzbgE81KrvMRuLYLY",
37-
v: "weekly",
38-
internalUsageAttributionIds: "gmp_mcp_codeassist_v0.1_github"
37+
v: "weekly"
3938
});
4039

4140
// URLs des datasets IDFM
@@ -64,22 +63,28 @@ import Layout from '../layouts/Layout.astro';
6463
// Charger les bibliothèques Maps et Marker
6564
const { Map } = await google.maps.importLibrary("maps");
6665
const { AdvancedMarkerElement, PinElement } = await google.maps.importLibrary("marker");
66+
const {ColorScheme} = await google.maps.importLibrary("core");
6767

6868

69-
// Créer la carte
69+
// Créer la carte en 3D
7070
map = new Map(document.getElementById("map"), {
71-
zoom: 11,
71+
zoom: 17,
7272
center: position,
7373
mapId: "768ca61f157a15a0673bb1ed",
74+
mapTypeId: 'terrain',
75+
renderingType: 'VECTOR',
7476
disableDefaultUI: true,
7577
zoomControl: true,
78+
gestureHandling: 'greedy',
7679
streetViewControl: true,
7780
fullscreenControl: true,
7881
mapTypeControl: true,
82+
tiltInteractionEnabled: true,
83+
colorScheme: ColorScheme.DARK,
7984
mapTypeControlOptions: {
8085
position: google.maps.ControlPosition.TOP_RIGHT,
81-
mapTypeIds: ['roadmap', 'satellite']
82-
}
86+
mapTypeIds: ['terrain', 'satellite']
87+
},
8388
});
8489

8590
// Stocker les classes pour utilisation ultérieure

0 commit comments

Comments
 (0)