/// <summary> /// Issue a directions search request. /// </summary> /// <param name="request"></param> /// <param name="callback"></param> public async Task <DirectionResponse> Route(DirectionsRequest request) { await _jsObjectRef.InvokeAsync( $"{jsObjectName}.route", request); return(null); }
/// <summary> /// Issue a directions search request. /// </summary> /// <param name="request"></param> /// <param name="callback"></param> public async Task <DirectionResponse> Route(DirectionsRequest request) { var json = await _jsObjectRef.InvokeAsync <string>( $"{jsObjectName}.route", request); var directionResponse = JsonConvert.DeserializeObject <DirectionResponse>(json); return(directionResponse); }
/// <summary> /// Issue a directions search request. /// </summary> /// <param name="request"></param> /// <param name="callback"></param> public async Task <DirectionResponse> Route(DirectionsRequest request) { var json = await _jsRuntime.InvokeWithDefinedGuidAsync <string>( $"{jsObjectName}.route", _guid.ToString(), request); var directionResponse = JsonConvert.DeserializeObject <DirectionResponse>(json); return(directionResponse); }
public async Task <DirectionsResult> Route(DirectionsRequest request) { var response = await _jsObjectRef.InvokeAsync <string>( "googleMapDirectionServiceFunctions.route", request); try { var DirResult = JsonConvert.DeserializeObject <DirectionsResult>(response); return(DirResult); } catch (Exception e) { Console.WriteLine("Error parsing DirectionsResult Object. Message: " + e.Message); return(null); } }