Skip to content

Instantly share code, notes, and snippets.

View crstn's full-sized avatar
💭
🤓

Carsten Keßler crstn

💭
🤓
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var map; // introduce the map variable first, otherwise it only shows up inside the initialize() function and is unknown outside of it.
// funcion that creates the map
function initialize() {
// this code here are the functions that make the directions api work
var directionsRenderer = new google.maps.DirectionsRenderer();
var directionsService = new google.maps.DirectionsService();
map = new google.maps.Map(document.getElementById("map"), {
zoom: 1,
center: { lat: 122.15674, lng: 10.21076 }
function calculateAndDisplayRoute1(directionsService, directionsRenderer1) {
var mode = document.getElementById("mode").value;
var start = document.getElementById("ac1").value;
var end = document.getElementById("ac4").value;
directionsService.route({
origin: start,
destination: end,
travelMode: google.maps.TravelMode[mode]
},
var map, directionsrenderer1, directionsrenderer2, directionsRenderer3; // introduce the map variable first, otherwise it only shows up inside the initialize() function and is unknown outside of it.
// funcion that creates the map
function initialize() {
// this code here are the functions that make the directions api work
var directionsRenderer1 = new google.maps.DirectionsRenderer();
var directionsRenderer2 = new google.maps.DirectionsRenderer();
var directionsRenderer3 = new google.maps.DirectionsRenderer();
var directionsService = new google.maps.DirectionsService();
map = new google.maps.Map(document.getElementById("map"), {