Can't zoom out on raster layer

04-28-2021 05:09 AM
New Contributor

Dear Gurus!

I would like to implement zoom out on map which contains raster layer.
I created simple program to check this option, but can't understand how to do it.

So, here is my code:




public partial class MainWindow : Window
        MapView _mapView = null;
        public MainWindow()

            _mapView = MyMapView;            
                #region Raster
                string qwe4 = Path.GetFullPath(@"D:\to_check_img\12_daniel_can_bc-207.jpg");
                RasterLayer myRasterLayer4 = new RasterLayer(qwe4);
                //myRasterLayer.MinScale = 450000;
                //myRasterLayer.MaxScale = 1000000;

                Map map = new Map();               
                MyMapView.Map = map;
            catch (Exception ex)


        private async void LoadRaster(RasterLayer myRasterLayer)
            await myRasterLayer.LoadAsync();            
            ///not working
            //await _mapView.SetViewpointScaleAsync(50000);
            //await _mapView.SetViewpointCenterAsync(new MapPoint(myRasterLayer.FullExtent.XMin, myRasterLayer.FullExtent.YMin), 50000);                        






After it, I see an image on map with current scale. For it I added 




        <quartz:MapView x:Name="MyMapView" Margin="-21,-26,21,26" />
        <TextBlock Margin="469,10,50,380">
                    <!--  A run is used to format the label.  -->
                    <Run Text="Current map scale: " />
                    <Run Text="1:" />
                    <Run Text="{Binding ElementName=MyMapView, Path=MapScale, Mode=OneWay, StringFormat=n0}" />




When I run an application I see image with current scale:


But I don't have a possibility to zoom out from this scale. 

I really need to know if there is any possibility to zoom out when we have a nongeoreferenced map and image layer on it.

As you  see I tried to use MinScale, MaxScale, SetViewpointScaleAsync, but it didn't work.

Thanks in advance!


0 Kudos
0 Replies