JordanMcAlister
6 years agoQrew Captain
Embed Google Maps in Form
Does anyone know how to do this?
I can do a static image using:
but I was trying to do this with a interactive map box or something using this from Google's site:
I tried putting this in a code page and calling to it using the iol method, but it doesn't show anything. Anyone have any ideas?
I can do a static image using:
"<img src= " &
"https://maps.googleapis.com/maps/api/staticmap?"
& "center=" & URLEncode([Address) & "&zoom=" & [zoom] & "&size=" & [width] & "x" & [height] & "&maptype=" & [type] & "&format=" & [format] & "&markers=color:" &[pin color] & "%7Clabel:" & [pin label] & "%7C" & URLEncode([Address]) & "&key=APIKEY" & ">"
but I was trying to do this with a interactive map box or something using this from Google's site:
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 8
});
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"
async defer></script>
</body> </html>
I tried putting this in a code page and calling to it using the iol method, but it doesn't show anything. Anyone have any ideas?