Category : google-maps-api-3

"Map: Expected mapDiv of type Element but was passed null." -The height of the div is set in the css. Javascript: function initMap() { const sportHall2 = { lat: 51.18310959584043, lng: 4.38829092697164 }; const map2b = new google.maps.Map(document.getElementById("map-2b"), { zoom: 13, center: sportHall2, disableDefaultUI: true, zoomControl: true, fullscreenControl: true, streetViewControl: true, }); } HTML: <div ..

Read more

I am using auto complete in my app….when user enters page for the first time it triggers the autoComplete function, grabbing a prepopulated searchCity field, gets the city lat/lon and sends it back to my server. All works fine. User can type in a new city…and autocomplete shows suggestions and user taps a selection and ..

Read more

I have this javascript function for panning my map to the current location, but it is slightly more zoomed out than I prefer after panning. Does anyone know how to change the zoom level? Here is my javascript code let map, infoWindow; function initMap() { map = new google.maps.Map(document.getElementById("map"), { center: { lat: 55.68277194190388, lng: ..

Read more

So this is a little complicated. I’m doing a university assignment using Firebase Firestore. Basically I have a page that displays information that is filled in on a separate page each entry into my database has a latitude and longitude value and I want to have a map on each entry that is displayed, so ..

Read more