예제 #1
0
        public IActionResult GetGoogleSimpleRoute([FromBody] Marker[] markers_)
        {
            if (markers_.Count() > 1)
            {
                var markers = markerService.MarkersBeforeRouteWork(markers_).ToArray();
                markerService.UpdateMarkers(markers);

                var responce = routeLegService.GetRouteLegs(markers);

                return(Json(new { success = true, legs = responce.Legs, markers, responce.LegsFromDbCount }));
            }
            return(Json(new
            {
                success = false,
                msg = "To build a route must be at least 2 points"
            }));
        }