| 1 | //route from origin in conflict to destination in safety
|
| 2 | imagineRoute(
|
| 3 | 'كرم الطحان Syria', // كرم الميسر Karm al-Myassar
|
| 4 | 'السلامة Syria', // مخيم باب السلامة Azaz Camp
|
| 5 | directionsService,
|
| 6 | directionsDisplay);
|
| 7 | }
|
| 8 | |
| 9 | function imagineRoute(origin, destination, service, display) {
|
| 10 | service.route({
|
| 11 | origin: origin,
|
| 12 | destination: destination,
|
| 13 | |
| 14 | waypoints: [
|
| 15 | {location: 'جسر الصاخور Syria', stopover: false},
|
| 16 | //جسر الصاخور Alsakhur Bridge
|
| 17 | {location: 'حندرات Syria', stopover: false}
|
| 18 | // حندرات Handarat
|
| 19 | ],
|
| 20 | |
| 21 | travelMode: google.maps.TravelMode.WALKING,
|
| 22 | |
| 23 | avoidTolls: true
|
| 24 | |
| 25 | //avoidIsis: true
|
| 26 | |
| 27 | //avoidShellingSites: true
|
| 28 | |
| 29 | //avoidRubble: true
|
| 30 | |
| 31 | },
|
| 32 | }
|
| 33 | |
| 34 | //calculate distance of re-routed path
|
| 35 | |
| 36 | function computeTotalDistance(result) {
|
| 37 | var total = 0;
|
| 38 | var thisEscape = result.routes[0];
|
| 39 | for (var i = 0; i < thisEscape.legs.length; i++) {
|
| 40 | total += thisEscape.legs[i].distance.value; }
|
| 41 | |
| 42 | total = total / 1000;
|
| 43 | document.getElementById('total').innerHTML = total + ' km';
|
| 44 | }
|