Skip to content

Instantly share code, notes, and snippets.

@seeingidog
Created December 1, 2011 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seeingidog/1420140 to your computer and use it in GitHub Desktop.
Save seeingidog/1420140 to your computer and use it in GitHub Desktop.
<head>
<meta content='initial-scale=1.0' name='viewport' user-scalable='no' />
<style type='text/css'>
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
<div id='map_canvas'>{ height: 100% }</div>
</style>
<script src='http://maps.googleapis.com/maps/api/js?key=AIzaSyDxmdqtZTyPfqktKg8aKsR-9PyVpK3YNXs&amp;sensor=false' type='text/javascript'></script>
<script type='text/javascript'>
flightPlanCoordinates = [];
function initialize() {
var myLatLng = new google.maps.LatLng(0, 0);
var myOptions = {zoom: 6, center: myLatLng, mapTypeId: google.maps.MapTypeId.TERRAIN};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var geocoder = new google.maps.Geocoder;
geocoder.geocode( { 'address': "45B PATRICK AVE EDISON, NJ, 08837 United States"}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({map: map,position: results[0].geometry.location, title: "BILLING INFORMATION RECEIVED"});
flightPlanCoordinates.push(results[0].geometry.location);
}
});
geocoder.geocode( { 'address': "EDISON, NJ United States"}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({map: map,position: results[0].geometry.location, title: "ORIGIN SCAN"});
flightPlanCoordinates.push(results[0].geometry.location);
}
});
geocoder.geocode( { 'address': "EDISON, NJ United States"}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({map: map,position: results[0].geometry.location, title: "DEPARTURE SCAN"});
flightPlanCoordinates.push(results[0].geometry.location);
}
});
geocoder.geocode( { 'address': "PARSIPPANY, NJ United States"}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({map: map,position: results[0].geometry.location, title: "ARRIVAL SCAN"});
flightPlanCoordinates.push(results[0].geometry.location);
}
});
geocoder.geocode( { 'address': "PARSIPPANY, NJ United States"}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({map: map,position: results[0].geometry.location, title: "DEPARTURE SCAN"});
flightPlanCoordinates.push(results[0].geometry.location);
}
});
geocoder.geocode( { 'address': "MAUMEE, OH United States"}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({map: map,position: results[0].geometry.location, title: "ARRIVAL SCAN"});
flightPlanCoordinates.push(results[0].geometry.location);
}
});
geocoder.geocode( { 'address': "MAUMEE, OH United States"}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({map: map,position: results[0].geometry.location, title: "LOCATION SCAN"});
flightPlanCoordinates.push(results[0].geometry.location);
}
});
geocoder.geocode( { 'address': "MAUMEE, OH United States"}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({map: map,position: results[0].geometry.location, title: "DEPARTURE SCAN"});
flightPlanCoordinates.push(results[0].geometry.location);
}
});
geocoder.geocode( { 'address': "LANSING, MI United States"}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({map: map,position: results[0].geometry.location, title: "ARRIVAL SCAN"});
flightPlanCoordinates.push(results[0].geometry.location);
}
});
geocoder.geocode( { 'address': "LANSING, MI United States"}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({map: map,position: results[0].geometry.location, title: "OUT FOR DELIVERY"});
flightPlanCoordinates.push(results[0].geometry.location);
}
});
geocoder.geocode( { 'address': "LANSING, MI, 48911 United States"}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({map: map,position: results[0].geometry.location, title: "DELIVERED"});
flightPlanCoordinates.push(results[0].geometry.location);
}
});
alert(flightPlanCoordinates);
var flightPath = new google.maps.Polyline({path: flightPlanCoordinates, strokeColor: "#FF0000", strokeOpacity: 1.0, strokeWeight: 2});
flightPath.setMap(map);
}
</script>
</head>
<body onload='initialize()'>
<div id='map_canvas' style='width:100%; height:100%'></div>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment