(very weak level in frontend)
I basically follow this tuto :
https://youtu.be/CdDXbvBFXLY
the coder uses a code slightly different that what we have now on Google Platform, instead of
<script async
src="https://maps.googleapis.com/maps/api/js?keyYOURKEY&callback=initMap">
</script>
she uses
<script
src="https://maps.googleapis.com/maps/api/js?key=YOURKEY&map_ids=YOURMAPID&callback=initMap&v=weekly"
defer
></script>
Anyway, doesn’t work for me.
Now on the Google documentation they mention Map Id’s feature only on the function Initmap.
https://developers.google.com/maps/documentation/get-map-id
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 8,
mapId: 'MAP_ID'
});
here is my test page. It actually doesn’t display my custom map, only the reel Google map, because of the coordinates I put in :
https://eostation.xyz/
<script> function initMap() {
map = new google.maps.Map(document.getElementById("map"), {
center: { lat: 69.4865, lng: 88.3972 },
zoom: 13,
mapID: '6c69da475e7f7301'
});
let marker = new google.maps.Marker({
position: talnakh,map: map});
}
I don’t really understand what is a InitMap
In other words, I need the correct syntaxe to call my custom map and not Google map.
When I say “custom map”, i don’t mean a map with markers, i don’t mean a trail of landmarks done on Google Map, I’m talking about a fictionnal map, for a game, using GoogleMap API.
Thank you