Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
- <meta charset="utf-8">
- <title>Simple Polylines</title>
- <style>
- html, body {
- height: 100%;
- margin: 0;
- padding: 0;
- }
- #map {
- height: 100%;
- }
- </style>
- </head>
- <body>
- <div id="map"></div>
- <script>
- function initMap() {
- var map = new google.maps.Map(document.getElementById('map'), {
- zoom: 18,
- center: {lat: 37.772, lng: -122.214},
- mapTypeId: google.maps.MapTypeId.TERRAIN
- });
- var flightPlanCoordinates = [
- {lat: 37.772, lng: -122.214},
- {lat: 37.771, lng: -122.215},
- {lat: 37.770, lng: -122.216},
- {lat: 37.760, lng: -122.218}
- ];
- var flightPath = new google.maps.Polyline({
- path: flightPlanCoordinates,
- geodesic: true,
- strokeColor: '#FF0000',
- strokeOpacity: 1.0,
- strokeWeight: 8
- });
- flightPath.setMap(map);
- }
- </script>
- <script async defer
- src="https://maps.googleapis.com/maps/api/js?callback=initMap"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement