Skip to content

Instantly share code, notes, and snippets.

@seeingidog
Created December 1, 2011 21:38
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/1420076 to your computer and use it in GitHub Desktop.
Save seeingidog/1420076 to your computer and use it in GitHub Desktop.
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