嵌入式Bing地图(JavaScript)可以将数据发送到C#UI吗?

发布于 2025-02-12 05:49:18 字数 176 浏览 2 评论 0原文

因此,我使用XAML的UI,我正在考虑拥有嵌入式bing地图,或者我不确定的Google Map。可以在UI上创建一个交互式映射,但是我需要单击Pushpins并检索没有JavaScript的数据似乎是不可能的,因此我想知道UI是否可以打开一个嵌入式地图,可以很容易具有PushPin事件(例如检测点击),然后将数据从该PIN发送回UI?

So I have a UI using XAML and I was thinking about having an embedded Bing Map, or maybe Google Map I'm not sure. It's possible to create an interactive map on the UI, but I need to be able to click pushpins and retrieve data which doesn't seem to be possible without Javascript, so I was wondering if the UI could open up an embedded map, which can easily have pushpin events(such as detecting clicks), and send the data from that pin back to the UI?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

邮友 2025-02-19 05:49:18

Bing Maps具有两个不同的地图控件,可用于本机.NET应用中。因此无需嵌入JavaScript图。

Windows UWP映射SDK可以在Windows应用程序中使用,以及通过XAML Island中的WPF应用中使用。这里有一些有用的资源:

  • ​标准-Control-with-XAML-ISLANDS“ rel =” nofollow noreferrer“> https://learn.microsoft.com/en-us/windows/windows/desktops/desktop/modernize/mmodernize/host-host-host-host-sandard-contard-conard-conard-conard-contard-contard-control-with-with-with-with-with-xaml-islands一下

还有一个较旧的WPF SDK,其功能少于UWP SDK。通常建议使用UWP地图控件,但是如果要使用此信息,请参见以下细节: https://learn.microsoft.com/en-us/previous-us/previous-vious-vious/previous/wpf-control/wpf-control/hh750210(v%3DMSDN.10 )

如果您真的想将JavaScript映射嵌入.NET应用程序中并能够在两者之间进行通信,则可以完成。为此,您需要将Web浏览器控件嵌入您的.NET应用程序,然后使用Interop函数来来回发送消息。这需要大量的工作才能变得良好。请注意,如果您使用内置的.NET浏览器,则无法在浏览器/地图上方浮动XAML元素(这是十多年来的问题)。如果您嵌入了Chrome浏览器,则可以对其进行修改,以便您可以在浏览器上浮动XAML元素,但这也使您的应用程序大大更大。

Bing Maps has two different map controls that can be used in native .NET applications. So no need to embed a JavaScript map.

There is the Windows UWP map SDK that can be used in Windows apps, and in WPF apps via a XAML island. Here are some useful resources:

There is also an older WPF SDK that has fewer capabilities than the UWP SDK. It is generally recommended to use the UWP map control, but if you want to use this, here are the details: https://learn.microsoft.com/en-us/previous-versions/bing/wpf-control/hh750210(v%3dmsdn.10)

If you really want to embed a JavaScript map into a .NET app and be able to communicate between the two, it can be done. To do that you need to embed a web browser control into your .NET app and then us interop functions to send messages back and forth. This takes a decent amount of work to get working well. Note that if you use the built in .NET browser you cannot float XAML elements above the browser/map (this has been an issue for over a decade). If you embed the chrome browser it is possible to modify it so you can float XAML elements over the browser, but this also makes your app significantly larger.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文