protected async Task DrawIsochrone()
 {
     if (selectedCalculationMode == CalculationModes.time)
     {
         Console.WriteLine("Calculating with a " + selectedTravelMode + " time of " + travelTime + " minutes.");
         await JSRuntime.InvokeAsync <Task>("GetIsochroneByTime", new double[] { 50.2, 6.1 }, selectedTravelMode.ToString(), travelTime);
     }
     else if (selectedCalculationMode == CalculationModes.distance)
     {
         Console.WriteLine("Calculating with a " + selectedTravelMode + " distance of " + travelDistance + " kilometres.");
         await JSRuntime.InvokeAsync <Task>("GetIsochroneByDistance", new double[] { 50.2, 6.1 }, selectedTravelMode.ToString(), travelTime);
     }
     else
     {
         Console.WriteLine("No calculation mode selected.");
     }
 }
예제 #2
0
        protected async Task DrawIsochroneAtAddress()
        {
            //await JSRuntime.InvokeAsync<Task>("DrawCircleAtAddressWithRadius", place, radius);
            //await JSRuntime.InvokeAsync<Task>("GetIsochroneByTime", MappingService.GetPDOKinfoFromAddress(place), "walking", radiusTime); //GetIsochroneByTime
            CheckBaseKey();

            if (selectedCalculationMode == CalculationModes.time)
            {
                Console.WriteLine("Calculating with a " + selectedTravelMode + " time of " + travelTime + " minutes.");
                await JSRuntime.InvokeAsync<Task>("GetIsochroneByTime", baseAddress.Value, selectedTravelMode.ToString(), travelTime);
            }
            else if (selectedCalculationMode == CalculationModes.distance)
            {
                Console.WriteLine("Calculating with a " + selectedTravelMode + " distance of " + travelDistance + " kilometres.");
                await JSRuntime.InvokeAsync<Task>("GetIsochroneByDistance", baseAddress.Value, selectedTravelMode.ToString(), travelDistance);
            }
            else Console.WriteLine("No calculation mode selected.");
        }