The Mapbox Directions API will show you how to get
       where you're going.

       mapbox directions "[0, 0]" "[1, 1]"

       An access token is required.  See "mapbox --help".
517746
def directions(ctx, features, profile, alternatives, 
               geometries, overview, steps, continue_straight, 
               waypoint_snapping, annotations, language, output):
    

    access_token = (ctx.obj and ctx.obj.get("access_token")) or None

    service = mapbox.Directions(access_token=access_token)

    # The Directions SDK expects False to be
    # a bool, not a str.

    if overview == "False":
        overview = False

    # When using waypoint snapping, the 
    # Directions SDK expects features to be 
    # a list, not a generator.

    if waypoint_snapping is not None:
        features = list(features)

    if annotations:
        annotations = annotations.split(",")

    stdout = click.open_file(output, "w")

    try:
        res = service.directions(
            features,
            profile=profile,
            alternatives=alternatives,
            geometries=geometries,
            overview=overview,
            steps=steps,
            continue_straight=continue_straight,
            waypoint_snapping=waypoint_snapping,
            annotations=annotations,
            language=language
        )
    except mapbox.errors.ValidationError as exc:
        raise click.BadParameter(str(exc))

    if res.status_code == 200:
        if geometries == "geojson":
            click.echo(json.dumps(res.geojson()), file=stdout)
        else:
            click.echo(res.text, file=stdout)
    else:
        raise MapboxCLIException(res.text.strip())
167018
def direction(self):
        
        libfn = utils.get_lib_fn('getDirection%s'%self._libsuffix)
        return libfn(self.pointer)
648267
def complete(self, GET):
        
        if 'error' in GET:
            raise OAuthError(
                _("Received error while obtaining access token from %s: %s") % (
                    self.access_token_url, GET['error']))
        return self.get_access_token(code=GET.get('code'))
459201
function(left, right) {
                const leftIndex = entryPoints.indexOf(left.names[0]);
                const rightIndex = entryPoints.indexOf(right.names[0]);
                let direction = 0;

                if (leftIndex > rightIndex) {
                    direction = 1;
                } else if (leftIndex < rightIndex) {
                    direction = -1;
                }

                return direction;
            }
271127
def get_paths(self, user_ids=None, startup_ids=None, direction=None):
    
    if user_ids is None and startup_ids is None and direction is None:
      raise Exception('At least one input argument should be different than None')
    if isinstance(user_ids, list):
      user_ids = ','.join(list(map(lambda k: str(k), user_ids)))
    if isinstance(startup_ids, list):
      startup_ids = ','.join(list(map(lambda k: str(k), startup_ids)))

    paths_url = _PATHS.format(c_api=_C_API_BEGINNING,
                                      api=_API_VERSION,
                                      at=self.access_token)
    if not user_ids is None:
      paths_url += '&' + _USER_IDS_SUFFIX.format(user_ids=user_ids)
    if not startup_ids is None:
      paths_url += '&' + _STARTUP_IDS_SUFFIX.format(
                                                    startup_ids=startup_ids)
    if not direction is None:
      paths_url += '&' + _DIRECTION_SUFFIX.format(direction=direction)
    return _get_request(paths_url)
1179874
def get_access_token(self, request, callback=None):
        """"""
        callback = request.build_absolute_uri(callback or request.path)
        if not self.check_application_state(request):
            logger.error('Application state check failed.')
            return None
        if 'code' in request.GET:
            args = {
                'client_id': self.consumer_key,
                'redirect_uri': callback,
                'client_secret': self.consumer_secret,
                'code': request.GET['code'],
                'grant_type': 'authorization_code',
            }
        else:
            logger.error('No code returned by the provider')
            return None
        try:
            response = self.request('post', self.access_token_url, data=args)
            response.raise_for_status()
        except RequestException as e:
            logger.error('Unable to fetch access token: {0}'.format(e))
            return None
        else:
            return response.text
1298506
function getAddDirectionsJS(){
		$_output = ""; 
		 
		foreach($this->_directions as $directions){
			$dom_id = $directions["dom_id"];			
			$travelModeParams = array();
			$directionsParams = "";         
			if($this->walking_directions==TRUE)
				$directionsParams .= ", \n travelMode:google.maps.DirectionsTravelMode.WALKING";
			else if($this->biking_directions==TRUE)
				$directionsParams .= ", \n travelMode:google.maps.DirectionsTravelMode.BICYCLING";
			else
				$directionsParams .= ", \n travelMode:google.maps.DirectionsTravelMode.DRIVING";
		   
			if($this->avoid_highways==TRUE)
			   $directionsParams .= ", \n avoidHighways: true";
			if($this->avoid_tollways==TRUE)
			   $directionsParams .= ", \n avoidTolls: true";

			if($this->directions_unit_system!=''){
			    if($this->directions_unit_system == 'METRIC'){
			        $directionsParams .= ", \n unitSystem: google.maps.DirectionsUnitSystem.METRIC";
			    }else{
			        $directionsParams .= ", \n unitSystem: google.maps.DirectionsUnitSystem.IMPERIAL";
			    }
			}
			
			$_output .= "
			    directions".$this->map_id."['$dom_id'] = {
					displayRenderer:new google.maps.DirectionsRenderer(),
					directionService:new google.maps.DirectionsService(),
					request:{
            					waypoints: [{$this->_waypoints_string}],
						origin: '".$directions["start"]."',
						destination: '".$directions["dest"]."'
						$directionsParams
					}
					".(($this->elevation_directions)?",		
					   selector: '".$directions["elevation_dom_id"]."',
					   chart: new google.visualization.ColumnChart(document.getElementById('".$directions["elevation_dom_id"]."')),
					   service: new google.maps.ElevationService(),
					   width:".$directions["width"].",
					   height:".$directions["height"].",
					   focusColor:'#00FF00',
					   marker:null
				   ":"")."
				};
				directions".$this->map_id."['$dom_id'].displayRenderer.setMap(map".$this->map_id.");
				directions".$this->map_id."['$dom_id'].displayRenderer.setPanel(document.getElementById('$dom_id'));
				directions".$this->map_id."['$dom_id'].directionService.route(directions".$this->map_id."['$dom_id'].request, function(response, status) {
					if (status == google.maps.DirectionsStatus.OK) {
					   directions".$this->map_id."['$dom_id'].displayRenderer.setDirections(response);
					   ".(($this->elevation_directions)?"
						   directions".$this->map_id."['$dom_id'].service.getElevationAlongPath({
							   path: response.routes[0].overview_path,
							   samples: ".$directions["elevation_samples"]."
						   }, function(results,status){plotElevation(results,status, directions".$this->map_id."['$dom_id'], map".$this->map_id.", elevationCharts".$this->map_id.");});
					   ":"")."
					}
				});
			 ";
		 }
		 
		 return $_output;
	 }
362103
function(options){
    if (options.enableEventLogging === false) return false;
    if (options.origin && options.origin.indexOf('api.mapbox.com') == -1) return false;
    // hard to make sense of events when a local instance is suplementing results from origin
    if (options.localGeocoder) return false;
    // hard to make sense of events when a custom filter is in use
    if (options.filter) return false;
    return true;
  }
637414
function getVisUrl(url) {
    var match = /https?:\/\/(\S+)\.cartodb\.com\/viz\/(\S+)\/(?:public_)?map/.exec(url);
    if (match) {
        var user = match[1],
            mapId = match[2];
        return 'https://' + user + '.cartodb.com/api/v2/viz/' + mapId + '/viz.json';
    }
}
1270718
public static String accessToken(String key) {
		if (isKeyParam(key)) {
			String[] keys = key.split(KEY_JOIN);
			if (keys.length == 2) {
				return apiHandler.accessToken(keys[0], keys[1]);
			} else if (keys.length == 1) {
				return apiHandler.accessToken(keys[0]);
			}
		}
		return key;
	}
1210385
def get_direction(self, direction, rev=False):
        
        if (direction < 90.0) or (direction >= 270.0):
            if not rev:
                return 'up'
            else:
                return 'down'
        elif (90.0 <= direction < 270.0):
            if not rev:
                return 'down'
            else:
                return 'up'
        else:
            return 'none'
1229952
@Override
  public void onMapReady(final MapboxMap mapboxMap) {
    mapboxMap.setStyle(ThemeSwitcher.retrieveMapStyle(getContext()), new Style.OnStyleLoaded() {
      @Override
      public void onStyleLoaded(@NonNull Style style) {
        initializeNavigationMap(mapView, mapboxMap);
        initializeWayNameListener();
        onNavigationReadyCallback.onNavigationReady(navigationViewModel.isRunning());
        isMapInitialized = true;
      }
    });
  }
542949
function() {
			this.writeDebug('defaultLocation');
			var _this = this,
				distance = null,
				$distanceInput = $('#' + this.settings.maxDistanceID),
				originAddress;

			// Query string parameters
			if (this.settings.querystringParams === true) {
				// Check for distance query string parameters
				if (this.getQueryString(this.settings.maxDistanceID)){
					distance = this.getQueryString(this.settings.maxDistanceID);

					if ($distanceInput.val() !== '') {
						distance = $distanceInput.val();
					}
				}
				else {
					// Get the distance if set
					if (this.settings.maxDistance === true) {
						distance = $distanceInput.val() || '';
					}
				}
			}
			else {
				// Get the distance if set
				if (this.settings.maxDistance === true) {
					distance = $distanceInput.val() || '';
				}
			}

			// The address needs to be determined for the directions link
			var r = new this.reverseGoogleGeocode(this);
			var latlng = new google.maps.LatLng(this.settings.defaultLat, this.settings.defaultLng);
			r.geocode({'latLng': latlng}, function (data) {
				if (data !== null) {
					originAddress = addressInput = data.address;
					olat = mappingObj.lat = _this.settings.defaultLat;
					olng = mappingObj.lng = _this.settings.defaultLng;
					mappingObj.distance = distance;
					mappingObj.origin = originAddress;
					_this.mapping(mappingObj);
				} else {
					// Unable to geocode
					_this.notify(_this.settings.addressErrorAlert);
				}
			});
		}
972116
function(){
            var startDir = this.currentDirection,
                currentDir = this.currentDirection;

            var i = 0;
            while(i < 6){
                i++;
                var currentDirAdjustCoords = this.directionToAdjustCoord(currentDir),
                    targetX = this.x + currentDirAdjustCoords.x,
                    targetY = this.y + currentDirAdjustCoords.y;

                if(this.canMoveTo(targetX, targetY)){
                    this.currentDirection = currentDir;
                    this.moveTo(targetX, targetY);
                    return;
                }
                currentDir = this.getNextDirection(currentDir);
                // give up if all directions attempted
                if(currentDir === startDir){
                    return false;
                }
            }
        }
989207
def avail_locations(call=None):
    '''
    
    '''
    creds = get_creds()
    clc.v1.SetCredentials(creds["token"], creds["token_pass"])
    locations = clc.v1.Account.GetLocations()
    return locations
1351958
function(course) {

      // 0° = N
      // 90° = E
      // 180° = S
      // 270° = W

      var s = this['SCALE'];
      var k = DIRECTIONS.length;

      // floor((2ck + s) / (2s)) = round((c / s) * k)
      var dir = Math.round(course / s * k);

      return DIRECTIONS[mod(dir, k)];
    }
687773
function ( ) {
			if ( ! options.exist ) {
				// http request to Nominatim to performs the Geocoding of the pin.
				// To avoid to much call to Nominatim with the same position,
				// the call is only performed when it's a new pin
				var NominatimUrl = 
					'http://nominatim.openstreetmap.org/reverse?format=json&lat=' +
					latlng.lat +
					'&lon=' +
					latlng.lng +
					'&zoom=' +
					Map.getZoom ( ) +
					'&addressdetails=1&accept-language=' +
					_Translator.UserLanguage +
					'&osm_type=W';
				var XmlHttpRequest = new XMLHttpRequest ( );
				XmlHttpRequest.onreadystatechange = function ( ) { 
					if ( XmlHttpRequest.readyState == 4 && XmlHttpRequest.status == 200 ) {
						_NominatimCallback ( XmlHttpRequest.responseText );
					}
				};  
				XmlHttpRequest.open ( "GET", NominatimUrl, true );
				XmlHttpRequest.send ( null );
			}
		}