public ActionResult GoogleMap(Position center) { GoogleMapUco uco = new GoogleMapUco(); GoogleMapDto dto = uco.GetViewModel(center); GoogleMapViewModel vm = ConvertToViewModel(dto); return View("GoogleMap", vm); }
public ActionResult BingMap(Position center) { BingMapUco uco = new BingMapUco(); BingMapDto dto = uco.GetViewModel(center); var vm = ConvertToViewModel(dto); return View("BingMap", vm); }
private static List<Position> Generator(decimal lat, decimal lng, int count) { List<Position> positions = new List<Position>() { new Position {Id = 1 , Name = "中心座標" , Lat =lat , Lng= lng } }; Random random = new Random(); for (int i = 2; i < count; i++) { decimal x = (decimal)((float)random.Next(1, 10) / 1000); decimal y = (decimal)((float)random.Next(1, 10) / 1000); Position position = new Position { Id = i, Name = $"周圍座標 {i}", Lat = lat + x, Lng = lng + y }; positions.Add(position); } return positions; }