Exemple #1
0
        public IActionResult GetSatellite(float lat1, float lon1, float lat2, float lon2, int zoom = 9)
        {
            var request = new MapBBoxRequest()
            {
                Lon1    = lon1,
                Lon2    = lon2,
                Lat1    = lat1,
                Lat2    = lat2,
                MapName = "mapbox.satellite",
                Zoom    = zoom
            };
            var imageTask = MapDataService.GetBitmapForRegion(request);

            imageTask.Wait();
            return(File(BitmapHelperService.Bitmap2Bytes(imageTask.Result), "image/jpg"));
        }
Exemple #2
0
        public IActionResult GetHeightMap(float lat1, float lon1, float lat2, float lon2, int zoom = 9)
        {
            var request = new MapBBoxRequest()
            {
                Lon1    = lon1,
                Lon2    = lon2,
                Lat1    = lat1,
                Lat2    = lat2,
                MapName = "mapbox.terrain-rgb",
                Zoom    = zoom
            };
            var imageTask = MapDataService.GetBitmapForRegion(request);

            imageTask.Wait();

            var heightMap = ElevationTransformService.TransformElevationToHeightMap(imageTask.Result);

            return(File(BitmapHelperService.Bitmap2Bytes(heightMap), "image/jpg"));
        }
Exemple #3
0
        public IActionResult GetElevation(float lat1, float lon1, float lat2, float lon2, int zoom = 9)
        {
            var request = new MapBBoxRequest()
            {
                Lon1    = lon1,
                Lon2    = lon2,
                Lat1    = lat1,
                Lat2    = lat2,
                MapName = "mapbox.terrain-rgb",
                Zoom    = zoom
            };
            var imageTask = MapDataService.GetBitmapForRegion(request);

            imageTask.Wait();

            var image = imageTask.Result;

            return(File(BitmapHelperService.Bitmap2Bytes(image), "image/jpg"));

            // return $"data:image/png;base64,{SigBase64}";
            // return $"COORD1 {lat1}, {lon1}";
        }