Created
December 1, 2011 21:38
-
-
Save seeingidog/1420076 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment