BrU32

JS Google Maps Random Geo Location Gen Updated Edititon SRC

Aug 6th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1.  
  2. <html>
  3. <head>
  4. <center>
  5. <script
  6. src="http://maps.googleapis.com/maps/api/js">
  7. </script>
  8.  
  9. <script>
  10. var intRnd=Math.floor(Math.random()*89.9999999);
  11. var inttRnd=Math.floor(Math.random()*119.9999999)-120;
  12. var myCenter=new google.maps.LatLng(intRnd,inttRnd);
  13. var marker;
  14.  
  15. function initialize()
  16. {
  17. var mapProp = {
  18. center:myCenter,
  19. zoom:5,
  20. mapTypeId:google.maps.MapTypeId.HYBRID
  21. };
  22.  
  23. var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);
  24.  
  25. var marker=new google.maps.Marker({
  26. position:myCenter,
  27. animation:google.maps.Animation.BOUNCE
  28. });
  29.  
  30. marker.setMap(map);
  31. }
  32.  
  33. google.maps.event.addDomListener(window, 'load', initialize);
  34. </script>
  35. </head>
  36.  
  37. <body>
  38. <div id="googleMap" style="width:500px;height:380px;"></div>
  39. <font color="red">
  40. <center>
  41. <h2>Refresh Browser For A Random Desination!!
  42. </center>
  43. </body>
  44. </html>
Add Comment
Please, Sign In to add comment