scaleControl不是在.NET正确显示是在、正确、scaleControl、NET

由网友(久醉绕心弦)分享简介:我想包括在谷歌地图一个scaleControl在WPF WebBrowser控件运行。I am trying to include a scaleControl on a Google Map running in a WebBrowser control in WPF.一切工作正常,除了当我尝试启用scaleCo...

我想包括在谷歌地图一个scaleControl在WPF WebBrowser控件运行。

I am trying to include a scaleControl on a Google Map running in a WebBrowser control in WPF.

一切工作正常,除了当我尝试启用scaleControl。它显示为白色框。 (见下文)

Everything works fine, except when I try to enable the scaleControl. It displays as a white box. (see below)

我初始化图如下:

var myOptions =
        {
            zoom: 2,
            center: latlng,
            mapTypeId: google.maps.MapTypeId.ROADMAP,
            scaleControl: true
        };
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

如果您单击的白色矩形,它改变大小(如更换设备时预期)。矩形的屏幕截图如下。

If you click the white rectangle, it changes size (as expected when changing units). A screenshot of the rectangle is below.

我相信这个问题可能与我使用的地图在WPF WebBrowser控件元素的事实。正如我所看到的这个问题在其他地方,而且还使用WPF。

I believe this issue might be related to the fact I am using the map in a WPF WebBrowser element. As I have seen this issue somewhere else and that was also using WPF.

如何正确显示此scaleControl任何想法?

Any ideas on how to correctly display this scaleControl?

更新:

从DormantOden的回答,我已成功地解决我的问题,并得到ScaleControl工作。

From DormantOden's answer, I have managed to fix my issue and get the ScaleControl to work.

我进入注册表,并添加以下值:

I went into the registry and added the following values:

HKEY_LOCAL_MACHINE SOFTWARE 微软的Internet Explorer MAIN FeatureControl FEATURE_BROWSER_EMULATION 我的应用程序的名称的.exe

HKEY_LOCAL_MACHINESOFTWAREMicrosoftInternet ExplorerMAINFeatureControlFEATURE_BROWSER_EMULATION"MY APP NAME".exe

&安培;

HKEY_LOCAL_MACHINE SOFTWARE Wow6432Node 微软的Internet Explorer MAIN FeatureControl FEATURE_BROWSER_EMULATION 我的应用程序的名称的.exe

HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMAINFeatureControlFEATURE_BROWSER_EMULATION"MY APP NAME".exe

我该值设置为0x2AF7,根据的 DormantOden的链接,使WebBrowser控件作为IE10,而不是IE7运行。

I set the value to 0x2AF7, which according to DormantOden's link, causes the WebBrowser control to run as IE10 instead of IE7.

该scaleControl现在呈现正确

The scaleControl now renders correctly

推荐答案

我怀疑这是由于WPF WebBrowser控件元素默认与旧版本的IE浏览器的渲染。

I suspect this is due to the WPF WebBrowser element defaulting to rendering with old versions of IE.

请参阅这里的如何指定使用的IE浏览器版本。它可能会解决您的问题。

See here on how to specify the IE version used. It will likely fix your issue.

阅读全文

相关推荐

最新文章