缩放时 WPF 地图位置的 GMap.Net 未更新

问题描述

我的 WPF 应用程序 UserControl 包含一个 GMap 控件。

    <UserControl x:Class="Test.test.Map"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:gmmapeprovider="clr-namespace:GMap.NET.MapProviders;assembly=GMap.NET.Core"
             xmlns:prism="http://prismlibrary.com/" 
             xmlns:windowspresentation="clr-namespace:GMap.NET.WindowsPresentation;assembly=GMap.NET.WindowsPresentation" prism:ViewModelLocator.AutoWireViewModel="True">
                <Grid >
                    <windowspresentation:GMapControl 
                    x:Name="mapView" MinZoom="1" 
                    Position="{Binding MapPosition}" 
                    MaxZoom="17" 
                    Zoom="{Binding MapZoom}" 
                    MouseWheelZoomEnabled="True"
                    MouseWheelZoomType ="MousePositionWithoutCenter" 
                    MapProvider="{x:Static gmmapeprovider:GoogleMapProvider.Instance}" 
                    CacheLoc="{Binding XmlFilePath}"
                    IgnoreMarkerOnMouseWheel="True"/>
                </Grid>
      </UserControl>

enter image description here

Map Position 绑定到 UserControl 的 ViewModel 中的 MapPosition 属性。每次我使用鼠标右键平移地图,单击并拖动功能时,MapPosition 的值都会更新。

这是我的担忧: 我的期望是,如果地图被缩放,而鼠标指针不在控件的中心,则 Position 的值也应该更新。显然,情况并非如此,Position 保持不变,除非再次平移地图。

我是否在这里遗漏了一些设置,或者是否有任何可能的解决方法来解决此问题?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)