Advertisement
Guest User

Untitled

a guest
May 25th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
  5. <meta charset="utf-8">
  6. <title>Simple Polylines</title>
  7. <style>
  8. html, body {
  9. height: 100%;
  10. margin: 0;
  11. padding: 0;
  12. }
  13. #map {
  14. height: 100%;
  15. }
  16. </style>
  17. </head>
  18. <body>
  19. <div id="map"></div>
  20. <script>
  21.  
  22.  
  23. function initMap() {
  24. var map = new google.maps.Map(document.getElementById('map'), {
  25. zoom: 18,
  26. center: {lat: 37.772, lng: -122.214},
  27. mapTypeId: google.maps.MapTypeId.TERRAIN
  28. });
  29.  
  30. var flightPlanCoordinates = [
  31. {lat: 37.772, lng: -122.214},
  32. {lat: 37.771, lng: -122.215},
  33. {lat: 37.770, lng: -122.216},
  34. {lat: 37.760, lng: -122.218}
  35. ];
  36. var flightPath = new google.maps.Polyline({
  37. path: flightPlanCoordinates,
  38. geodesic: true,
  39. strokeColor: '#FF0000',
  40. strokeOpacity: 1.0,
  41. strokeWeight: 8
  42. });
  43.  
  44. flightPath.setMap(map);
  45. }
  46.  
  47. </script>
  48. <script async defer
  49. src="https://maps.googleapis.com/maps/api/js?callback=initMap"></script>
  50. </body>
  51. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement