Bing地图(Silverlight)地图 - 通过XAML将画布指定为前景 [英] Bing Maps (Silverlight) maps - specifying canvas to be at foreground through XAML

查看:179
本文介绍了Bing地图(Silverlight)地图 - 通过XAML将画布指定为前景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是XAML代码,用于Bing Maps Silverlight天气相关实现。



以下是我正在尝试执行的操作:


  1. 在鼠标悬停上有几个(超过100个)图钉的bing地图 - 在下面显示一个contentpopup(canvas = myPopup)。很简单。

  2. 一切正常 - 但是,当mypopup显示在鼠标悬停上时,它不在前台(其他针脚出现在contentpopup顶部) - 因此使其不易读取。

问题:

如何指定myPopup画布下面的XAML总是出现在前台,即当用户在mouseover上查看它时,最上面的Bing Maps silverlight控件。



谢谢!






 < Grid x:Name =LayoutRootBackground =White> 

< Canvas x:Name =myPopupVisibility =CollapsedOpacity =1>
Width =100RadiusX = 15RadiusY =15/>
< StackPanel Canvas.Left =8Canvas.Top =8>
< TextBlock x:Name =myPopupTextsFontSize =5Width =100>
< / TextBlock>

< / StackPanel>
< / Canvas>
< / m:MapLayer>
< / m:地图>
< / Grid>


解决方案

尝试添加 Canvas.ZIndex 添加到 MapLayer 元素,给它一个很大的值,比如200,或者将你的图钉添加到另一个MapLayer(而不是直接添加到地图上)以文档顺序显示弹出层。


Below is the XAML code i have for a Bing Maps Silverlight weather related implementation.

Here is what i am trying to do:

  1. Have a bing maps with several (over 100) pushpins- on mouseover - show a contentpopup (canvas=myPopup) below. Simple enough.
  2. Everything works fine - however, when mypopup displays on mouseover, it is not on the foreground (the other pins appear on top of the contentpopup) - hence making it not very readable.

Question:

How do i specifiy the myPopup canvas specified in XAML below to always appear in the foreground, i.e. top most of the Bing Maps silverlight control when a user views it on mouseover.

Thanks!


<Grid x:Name="LayoutRoot" Background="White">
    <m:Map x:Name="GlobalMap" Mode="Road"  Center="15,7" ZoomLevel="2" CredentialsProvider="{StaticResource MyCredentials}" Margin="-70,-40,-100,-72">

        <m:MapLayer x:Name="myLayer">
            <Canvas x:Name="myPopup" Visibility="Collapsed" Opacity="1">
                <Rectangle x:Name="myPopupRectangle" Fill="White" Canvas.Left="0" Canvas.Top="0" Height="100" 
                           Width="100" RadiusX="15" RadiusY="15"/>
                <StackPanel Canvas.Left="8" Canvas.Top="8">
                    <TextBlock x:Name="myPopupTexts" FontSize="5" Width="100">
                    </TextBlock>

                </StackPanel>
            </Canvas>
        </m:MapLayer>
    </m:Map>
</Grid>

解决方案

Try adding Canvas.ZIndex to the MapLayer element, give it a large value like 200 or add your push pins to another MapLayer (rather than adding the pins directly to the map) that appears ahead of this popup layer in document order.

这篇关于Bing地图(Silverlight)地图 - 通过XAML将画布指定为前景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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