Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. const mapHere = document.getElementById("map");
  2.  
  3. const marker0 = {
  4. lat: -38.414506,
  5. long: 144.851985
  6. };
  7.  
  8. const marker1 = {
  9. lat: -38.404351,
  10. long: 144.841955
  11. };
  12.  
  13. const line = [marker0, marker1];
  14.  
  15. if (mapHere) {
  16. const map = new google.maps.Map(mapHere, {
  17. zoom: 8,
  18. mapTypeId: google.maps.MapTypeId.HYBRID,
  19. center: marker0
  20. });
  21. const marker_0 = new google.maps.Marker({
  22. position: marker0,
  23. map: map,
  24. title: "marker 0"
  25. });
  26. const marker_1 = new google.maps.Marker({
  27. position: marker1,
  28. map: map,
  29. title: "marker 1"
  30. });
  31. const lineSymbol = {
  32. path: 'M 0,-1 0,1',
  33. strokeOpacity: 1,
  34. scale: 4
  35. };
  36.  
  37. var flightPath = new google.maps.Polyline({
  38. path: line,
  39. geodesic: true,
  40. strokeColor: '#f8fc09',
  41. strokeOpacity: 0,
  42. icons: [{
  43. icon: lineSymbol,
  44. offset: '0',
  45. repeat: '20px'
  46. }],
  47. strokeWeight: 2
  48. });
  49.  
  50. flightPath.setMap(map);
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement