滚动查看器内的 bing 地图问题
我有一个 bing 地图,它位于滚动查看器内以及一个列表框。
现在的问题是,当滚动查看器的内容向下滚动时,“Bing 地图呈现在位于滚动查看器上方(滚动查看器边界之外)的其他元素之上”
<TextBlock Text="some text" />
<ScrollViewer>
<map:Map ... />
<ListBox ... />
</ScrollViewer>
出了什么问题?这是一个已知的错误吗? 我试图在我的搜索结果列表框中包含一个小地图(与 Windows Phone bing 结果页面“本地”数据透视项相同)
一些观察: (1) 仅 bing 地图图块图像渲染在顶部(甚至图钉也不渲染) (2) 位于滚动查看器下方的元素(在 xaml 中)正确呈现在地图顶部!
谢谢
I have a bing map which is located inside a scrollviewer along with a listbox.
Now the problem is when the content of the scrollviewer is scrolled down, "Bing map is rendered on top of other elements which are located above scrollviewer (outside the boundary of scrollviewer)"
<TextBlock Text="some text" />
<ScrollViewer>
<map:Map ... />
<ListBox ... />
</ScrollViewer>
What is wrong? Is it a known bug?
I'm trying to include a small map in my search result list box (the same as windows phone bing result page 'local' pivot item does)
Some observations:
(1) only bing map tile images are rendered on top (not even pushpins)
(2) the elements that are located beneath the scrollviewer (in xaml) are correctly rendered on top of the map!
thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
只是不要将地图放在滚动查看器中。
这也将防止应用程序内滚动出现问题。
Just don't put the Map in the scrollviewer.
This will also prevent issues with scrolling within the app.
好吧,我终于找到了一个很好的解决方法,使它看起来很棒。
诀窍如下:
一。我们通过将以下行添加到页面/用户控件的构造函数来禁用 bing 地图图块图像:
二。在地图控件之前,我们添加一个与地图控件具有相同宽度和高度的元素:
三。现在我们为“Bing 静态地图 API”中的 Image 元素构建一个 BitmapImage:
http://msdn.microsoft.com/en-us/library/ff701724.aspx
这样:
OK, I finally found a good workaround for it which make's it look awesome.
Here is the trick:
ONE. we disable the bing map tile images by adding the following line to the constructor of the page/usercontrol:
TWO. Right before the map control we add a element with the same width and height as map control:
THREE. now we build up a BitmapImage for the Image element from "Bing static map API":
http://msdn.microsoft.com/en-us/library/ff701724.aspx
This way:
我使用
JeffWilcox.Maps
组件来实现类似的目的。这个静态地图在 ScrollViewer 中工作得很好。I use
JeffWilcox.Maps
component to similar purposes. This static maps works fine inside ScrollViewer.