Subversion Repositories SmartDukaan

Rev

Rev 27369 | Rev 27371 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
27366 amit.gupta 1
<!DOCTYPE html>
2
<html>
3
  <head>
4
    <title>Simple Map</title>
5
    <script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
6
    <script
7
      src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAfPuYFmniE30x275HAAtqz21WkaaGa2bc&callback=initMap&libraries=&v=weekly"
8
      defer
9
    ></script>
10
<style>
11
#map {
12
  height: 100%;
13
}
14
 
15
/* Optional: Makes the sample page fill the window. */
16
html,
17
body {
18
  height: 100%;
19
  margin: 0;
20
  padding: 0;
21
}
22
</style>
23
    <!-- jsFiddle will insert css and js -->
24
  </head>
25
  <body>
26
    <div id="map"></div>
27
  </body>
28
<script type="text/javascript">
29
	let map;
30
 
31
	function initMap() {
32
	  map = new google.maps.Map(document.getElementById("map"), {
33
	    center: { lat: 28.644800
34
, lng: 78.9629 },
35
	    zoom: 8,
36
	  });
27369 amit.gupta 37
	  const coordinates = [];
27366 amit.gupta 38
	#foreach($location in $locations)
27369 amit.gupta 39
	coordinates.push({lat: $location.getLat(), lng: $location.getLng()});
27366 amit.gupta 40
	#end
41
	  const flightPath = new google.maps.Polyline({
42
	    path: coordinates,
43
	    geodesic: true,
44
	    strokeColor: "#FF0000",
45
	    strokeOpacity: 1.0,
27370 amit.gupta 46
	    strokeWeight: 2
27366 amit.gupta 47
	  });
48
	  flightPath.setMap(map);
49
 
50
	}
51
</script>
52
</html>