Hello, I am developing a website in which I have a form and ask for details of the address. I want to implement that API as a reference and the problem comes from implementing google maps. How do I capture the long. and lat. put the user and then save the url of google maps. The code I have is the following, I hope you can help me.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Marker Animations</title>
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
// The following example creates a marker in Stockholm, Sweden using a DROP
// animation. Clicking on the marker will toggle the animation between a BOUNCE
// animation and no animation.
var marker;
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 13,
center: {lat: 19.4667, lng: -99.15}
});
marker = new google.maps.Marker({
map: map,
draggable: true,
animation: google.maps.Animation.DROP,
position: {lat: 19.4667, lng: -99.15}
});
marker.addListener('click', toggleBounce);
}
function toggleBounce() {
if (marker.getAnimation() !== null) {
marker.setAnimation(null);
} else {
marker.setAnimation(google.maps.Animation.BOUNCE);
}
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDAxQokwn4C1YdSmS2lTsPqd2zIeZdQXTk&signed_in=true&callback=initMap"></script>
</body>
</html>
and the link where the long should go. and alt. It's the next one.
https://maps.googleapis.com/maps/api/staticmap?size=512x512&maptype=roadmap
&markers=size:mid|color:red|San+Jose,CA&key=AIzaSyBHtODrlxSMspVWqW2oGMKzbAiJnAjPPXk