A Pen by Estevan B Saucedo

Thumbnail
This awesome code was written by stavinopolis, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright stavinopolis ©

Technologies

  • HTML
  • CSS
  • JavaScript
    <link rel="stylesheet" href="https://gitcdn.link/repo/angular/bower-material/master/angular-material.css">


<!-- Angular Material Dependencies -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-animate.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-aria.js"></script>

<!-- Angular Material Javascript using GitCDN to load directly from `bower-material/master` -->
<script src="https://gitcdn.link/repo/angular/bower-material/master/angular-material.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBPaI7iKs7BO8wtKZG_pkthhLhmdX1kXFI"></script>

<md-card ng-app="app">

  <md-card-content ng-controller="ctrl">

    <div id="directions"></div>


  </md-card-content>

</md-card>

/*Downloaded from https://www.codeseek.co/stavinopolis/a-pen-by-estevan-b-saucedo-reXreV */
    #directions {

  line-height: 25px;
  width: "200px";
}

.adp table,
{
  color: red;
  width: 100%;
}


/*Downloaded from https://www.codeseek.co/stavinopolis/a-pen-by-estevan-b-saucedo-reXreV */
    var directionsDisplay = new google.maps.DirectionsRenderer;
var directionsService = new google.maps.DirectionsService;
directionsDisplay.setPanel(document.getElementById('directions'));
var start = "917 S Clay St, Anaheim, CA";
var end = "Montclair, CA";

directionsService.route({
  origin: start,
  destination: end,
  travelMode: google.maps.TravelMode.DRIVING
}, function(response, status) {
  if (status === google.maps.DirectionsStatus.OK) {
    directionsDisplay.setDirections(response);
  } else {
    window.alert('Directions request failed due to ' + status);
  }
});



angular.module('app', ['ngMaterial'])
.controller('ctrl', [function(){
  
}])

;

Comments