JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<div id="map_canvas" style="float:left;width:70%;height:400px;"></div>
<ul></ul>
<p id="pMsg"></p>
JavaScript
var directions = {};
var bounds = new google.maps.LatLngBounds();
google.maps.event.addDomListener(window,'load',ginit);
function ginit() {
var opts = {
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: new google.maps.LatLng(52.524268, 13.406290000000013)
}
map = new google.maps.Map(document.getElementById("map_canvas"), opts);
var routes = [{
label: 'Erkner',
request: {
origin: new google.maps.LatLng(52.524268, 13.406290000000013),
destination: new google.maps.LatLng(52.4244119, 13.749783200000024),
travelMode: google.maps.DirectionsTravelMode.DRIVING
},
rendering: {
marker: {
icon: 'http://labs.google.com/ridefinder/images/mm_20_blue.png'
},
draggable: true
}
}/*,
{ label:'Potsdam',
request:{
origin: new google.maps.LatLng(52.524268, 13.406290000000013),
destination: new google.maps.LatLng(52.3941887, 13.072690999999963),
travelMode: google.maps.DirectionsTravelMode.DRIVING},
rendering:{marker:{icon: 'http://labs.google.com/ridefinder/images/mm_20_red.png'},draggable:true}
},
{ label:'Bernau',
request:{
origin: new google.maps.LatLng(52.524268, 13.406290000000013),
destination: new google.maps.LatLng(52.683483, 13.587553999999955),
travelMode: google.maps.DirectionsTravelMode.DRIVING},
rendering:{marker:{icon: 'http://labs.google.com/ridefinder/images/mm_20_yellow.png'},draggable:true}
}*/
];
var dists = [10000, 5000, 3000, 1000];
var selects = document.createElement('select');
list = document.getElementsByTagName('ul')[0];
for (var d = 0; d < dists.length; ++d) {
selects.options[selects.options.length] = new...