var GOOGLE_DOMAIN = "https://maps.googleapis.com/maps/api/directions/json";
var SOURCE_ADDRESS = "?origin=";
var DESTINATION_ADDRESS = "&destination=";
var APT_KEY = "&key=AIzaSyCIh0NxZY_jfII0Jfjzgk98hbpte-5K6RM";
var DIR_MODE = "&mode=";
var WEATHER_DOMAIN_FRONT = 'http://api.wunderground.com/api/36b799dc821d5836/conditions/q/MO.json';
var JSON_EXT = '.json';
var directionsDisplay;
var directionsService = new google.maps.DirectionsService();
var weatherLayer = new google.maps.weather.WeatherLayer();
var map;
var onClick = function get_directions() {
initialize();
};
function initialize() {
//Get source address from html element
var s_address = document.getElementById("s_addr").value;
var d_address = document.getElementById("d_addr").value;
directionsDisplay = new google.maps.DirectionsRenderer();
var center = new google.maps.LatLng(0, 0);
var myOptions = {
zoom: 7,
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: center
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
weatherLayer.setMap(map);
directionsDisplay.setMap(map);
var start = s_address;
var end = d_address;
var request = {
origin: start,
destination: end,
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function (response, status) {
if (status === google.maps.DirectionsStatus.OK) //Check if request is successful.
{
directionsDisplay.setDirections(response); //Display the directions result
}
});
s_address = $('#s_addr').val();
d_address = $('#d_addr').val();
//Place city at end of URL
var s_url_req = 'http://api.wunderground.com/api/36b799dc821d5836/conditions/q//' + s_address + '.json';
var d_url_req = 'http://api.wunderground.com/api/36b799dc821d5836/conditions/q//' + d_address + '.json';
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.