// POST api/point public double[] Post(GeographicCoordinate position) { var engine = MapEngine.Engine.Instance; var point = engine.ResolvePoint(position); return new[] { point.Latitude, position.Longitude }; }
private static GeoCoordinate ToGeoCoordinate(GeographicCoordinate geographicCoordinate) { var position = new GeoCoordinate(geographicCoordinate.Latitude, geographicCoordinate.Longitude); return position; }
public GeographicCoordinate ResolvePoint(GeographicCoordinate coordinate) { var position = ToGeoCoordinate(coordinate); var resolved = router.Resolve(VehicleEnum.Car, position).Location; return new GeographicCoordinate { Latitude = resolved.Latitude, Longitude = resolved.Longitude }; }