[UWP]地图缩放级别问题 [英] [UWP]Map Zoom-level issue

查看:65
本文介绍了[UWP]地图缩放级别问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天我发现UWP MapControl中的另一个问题是我无法设置
Zoomlevel 1和2
。它始终在ZoomLevel中显示2个以上  2D范围

Today I found another issue in UWP MapControl that I am not able to set Zoomlevel 1 and 2. It always display more then 2 in ZoomLevel in 2D range.

我还检查过MinZoomlevel自动设置为2+并且无法根据 

重置它 https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.maps.mapcontrol


  ZoomLevel  取决于
的地图视图类型:2D,3D或Streetside。

The maximum and minimum values of ZoomLevel depend on the type of map view: 2D, 3D, or Streetside.

请更新一下。 

please update about it.  

推荐答案

Hello Amit Tyagi,

Hello Amit Tyagi,

MinZoomLevel将根据当前的ZoomLevel动态更改。您可以查看以下代码示例:

The MinZoomLevel will be dynamically changed according to the current ZoomLevel. You could check my following code sample:

<Maps:MapControl x:Name="Map" 
			ZoomLevelChanged="Map_ZoomLevelChanged" 
                        ZoomLevel="6"
                        LandmarksVisible="True"
                        />


private void Map_ZoomLevelChanged(MapControl sender, object args)
        {
            System.Diagnostics.Debug.WriteLine("MinZoomLevel: "+Map.MinZoomLevel+" Current ZoomLevel: "+Map.ZoomLevel);
}

因此,如果要使MinZoomLevel为1,则需要设置适当的ZoomLevel值。例如,在我的代码示例中,我将ZoomLevel设置为6,然后MinZoomLevel自动更改为1.

As a result, if you want to make the MinZoomLevel is 1, you would need to set appropriate ZoomLevel value. For example, in my code sample, I set ZoomLevel to 6, then the MinZoomLevel automatically changed to 1.

但是如果将ZoomLevel设置为1,则可以检查输出数据visual studio,MapControl会自动将MinZoomLevel和ZoomLevel更改为适当的值。 MapControl将检测ZoomLevel是否合理。
如果没有,它会将它们更改为适当的值。

But if you set the ZoomLevel to 1, then you could check the output data in visual studio, the MapControl will automatically change the MinZoomLevel and ZoomLevel to the appropriate value. The MapControl will detect the ZoomLevel whether it’s reasonable. If not, it will change them to appropriate value.

<Maps:MapControl x:Name="Map"			ZoomLevelChanged="Map_ZoomLevelChanged"
                        ZoomLevel="1"
                        LandmarksVisible="True" />

最好的问候,

Xavier Eoro

Xavier Eoro


这篇关于[UWP]地图缩放级别问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆