コード例 #1
0
        public async Task <IActionResult> Index()
        {
            var atms = await _atmRepository.getATMs();

            var data = await _mapService.GetAtmLocations(atms);

            var minLat  = double.MaxValue;
            var maxLat  = double.MinValue;
            var minLong = double.MaxValue;
            var maxLong = double.MinValue;

            foreach (var mapData in data)
            {
                if (mapData.Location is null)
                {
                    continue;
                }
                minLat  = Math.Min(minLat, mapData.Location.Latitude);
                maxLat  = Math.Max(maxLat, mapData.Location.Latitude);
                minLong = Math.Min(minLong, mapData.Location.Longitude);
                maxLong = Math.Max(maxLong, mapData.Location.Longitude);
            }

            var ret = new MapViewDto()
            {
                Data        = data,
                InitialZoom = 10,
                CenterPoint = new MapLocation()
                {
                    Longitude = (maxLong + minLong) / 2,
                    Latitude  = (maxLat + maxLat) / 2
                }
            };

            return(View(ret));
        }
コード例 #2
0
        public async Task <IActionResult> ProblemForm()
        {
            var atm = await repoATM.getATMs();

            return(View(atm));
        }
コード例 #3
0
ファイル: ATMController.cs プロジェクト: KarolisBreidokas/BVS
        public async Task <IActionResult> ViewATMs()
        {
            var atms = await repo.getATMs();

            return(View(atms));
        }