Subversion Repositories SmartDukaan

Rev

Rev 27369 | Go to most recent revision | Details | 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
	  });
37
	  const coordinates = [
38
	  ]
39
	#foreach($location in $locations)
40
	coordinates.push({$location.getLat(), $location.getLng()});
41
	#end
42
	  const flightPath = new google.maps.Polyline({
43
	    path: coordinates,
44
	    geodesic: true,
45
	    strokeColor: "#FF0000",
46
	    strokeOpacity: 1.0,
47
	    strokeWeight: 2,
48
	  });
49
	  flightPath.setMap(map);
50
 
51
	}
52
</script>
53
</html>