Permalink
Browse files

Fire nuke at Washington DC from Moscow

  • Loading branch information...
hnrysmth committed Jul 11, 2014
1 parent 1aa5514 commit fc0f2c46220ad4a7ae8f4066a832b4127e12a757
Showing with 32 additions and 3 deletions.
  1. +1 −1 index.html
  2. +31 −2 src/index.js
View
@@ -8,7 +8,7 @@
<script
type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDqRRPaAp8g_m5aOVqJpwMkrU7wV3yyhR0">
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDqRRPaAp8g_m5aOVqJpwMkrU7wV3yyhR0&libraries=geometry">
</script>
<script
View
@@ -1,6 +1,6 @@
document.addEventListener('DOMContentLoaded', function() {
var mapOptions = {
center: new google.maps.LatLng(0, 0),
center: new google.maps.LatLng(55.3617609, -3.4433238),
disableDefaultUI: true,
disableDoubleClickZoom: true,
draggable: false,
@@ -13,5 +13,34 @@ document.addEventListener('DOMContentLoaded', function() {
new google.maps.LatLng(0, 110)
);
var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);
map.fitBounds(worldBounds);
//map.fitBounds(worldBounds);
var dept_lat = 55.749792;
var dept_lng = 37.632495;
var arr_lat = 38.8935965;
var arr_lng = -77.014576;
var departure = new google.maps.LatLng(dept_lat, dept_lng); //Set to whatever lat/lng you need for your departure location
var arrival = new google.maps.LatLng(arr_lat, arr_lng); //Set to whatever lat/lng you need for your arrival location
var line = new google.maps.Polyline({
path: [departure, departure],
strokeColor: "#FF0000",
strokeOpacity: 1,
strokeWeight: 1,
geodesic: true, //set to false if you want straight line instead of arc
map: map,
});
var step = 0;
var numSteps = 250; //Change this to set animation resolution
var timePerStep = 5; //Change this to alter animation speed
var interval = setInterval(function() {
step += 1;
if (step > numSteps) {
clearInterval(interval);
} else {
var are_we_there_yet = google.maps.geometry.spherical.interpolate(departure,arrival,step/numSteps);
line.setPath([departure, are_we_there_yet]);
}
}, timePerStep);
});

3 comments on commit fc0f2c4

@buley

This comment has been minimized.

Show comment
Hide comment
@buley

buley replied Aug 15, 2014

🙈

@zlassiter

This comment has been minimized.

Show comment
Hide comment
@zlassiter

zlassiter Aug 15, 2014

would you like to play a game?

zlassiter replied Aug 15, 2014

would you like to play a game?

@lapthorn

This comment has been minimized.

Show comment
Hide comment
@lapthorn

lapthorn replied Aug 16, 2014

towtwintp

Please sign in to comment.