BrU32

JS Maps Random Location Source UPDATED With More Places

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