Google Maps api

Developer
Size
2,795 Kb
Views
24,288

How do I make an google maps api?

What is a google maps api? How do you make a google maps api? This script and codes were developed by Kevin on 13 October 2022, Thursday.

Google Maps api Previews

Google Maps api - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Google Maps api</title> <link rel='stylesheet prefetch' href='http://cdnjs.cloudflare.com/ajax/libs/flexboxgrid/6.3.1/flexboxgrid.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <section id="location"> <div class="content"> <h1 class="wow fadeInDown titles" data-wow-delay="0.2s">Location</h1> <div class="row center-sm middle-sm"> <div class="col-xs-12 col-sm-6"> <div class="row center-sm" id="panel"> <div class="col-xs-12 col-sm-8 form-control"> <h2 class="wow fadeInDown" data-wow-delay="0.2s">Address</h2> <p> Grand Hall at Pabst Best Place 901 W. Juneau Ave Milwaukee, WI 53233</p> </div> <div class="col-xs-12 col-sm-8 form-control"> <form> <h2 class="wow fadeInDown" data-wow-delay="0.2s">Get Directions</h2> <div class="col-xs-12"> <label>Your Address: </label> <input id="start" placeholder="Home" value="1410 Museum Campus Dr, Chicago, IL 60605" type="text"> </div> <div class="col-xs-12 col-sm-offset-4 col-sm-4"> <input type="button" class="btn btn-map" value="Update" onclick="calcRoute();"> </div> </form> </div> </div> </div> <div class=" col-xs-12 col-sm-6"> <div id="map-canvas"></div> </div> </div> </section> <script src='https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false'></script> <script src="js/index.js"></script>
</body>
</html>

Google Maps api - Script Codes CSS Codes

h2{ color:$salmon;
}
#map-canvas{ overflow:hidden; padding-bottom:56.25%; position:relative; height:0;
}
#map-canvas iframe{ left:0; top:0; height:100%; width:100%; position:absolute;
}
#panel { top: 10px; z-index: 5; padding-bottom:10px; font-weight:300; text-align:center; margin:0 auto; input{ width:100%; text-align:center; border: 1px solid #e3e3e3; } label{ font-size:1.5em; } .panel-inputs{ justify-content:center; align-items:center; }
}

Google Maps api - Script Codes JS Codes

var directionsDisplay;
var directionsService = new google.maps.DirectionsService();
var map;
var initMap = function() { var myLatlng = new google.maps.LatLng(43.045466, -87.923418); directionsDisplay = new google.maps.DirectionsRenderer(); var mapOptions = { zoom: 18, center: myLatlng } var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); directionsDisplay.setMap(map); var marker = new google.maps.Marker({ position: myLatlng, map: map, title: 'Morales Wedding' });
}
var calcRoute = function() { var start = document.getElementById('start').value; var end = 'Grand Hall at Pabst Best Place 901 W Juneau Ave Milwaukee, WI 53233'; var request = { origin: start, destination: end, travelMode: google.maps.TravelMode.DRIVING }; directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); } else { alert("Sorry, no driving route can be found between these locations"); } });
}
google.maps.event.addDomListener(window, 'load', initMap);
Google Maps api - Script Codes
Google Maps api - Script Codes
Home Page Home
Developer Kevin
Username gnarfugh
Uploaded October 13, 2022
Rating 3
Size 2,795 Kb
Views 24,288
Do you need developer help for Google Maps api?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Kevin (gnarfugh) Script Codes
Create amazing art & images with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!