1

私は Windows Phone 8 の開発が初めてで、MapLayer にボタンを追加するのに問題があります。地図上にボタンを表示したいので、次のように地図ウィジェットに描画します。

<Grid x:Name="MyMapGrid" Margin="10,-15,15,0"  VerticalAlignment="Top" Height="296" >
            <maps:Map x:Name="MyMapi" Center="31.765537,35.106812" ZoomLevel="7"  Margin="0,0,0,0" VerticalAlignment="Top" Height="296" Width="442" />
                <Button x:Name="myCustomButton" Visibility="Visible" Content="" HorizontalAlignment="Left" Margin="347,0,0,0" VerticalAlignment="Top" Width="84" Height="84" BorderThickness="0">
                    <Button.Background>
                        <ImageBrush ImageSource="/myZoom.png"/>
                    </Button.Background>
                </Button>
            </Grid>



After this action I need to put some icons on the map so I used MapOverlay and MapLayer like this:


Map MyMap = new Map();
MapOverlay overlay = new MapOverlay
            {
                GeoCoordinate = MyMap.Center,
                Content = new Image()
                {
                    Source = new BitmapImage(new Uri("customIcon.png", UriKind.Relative)),
                }
            };
MapLayer layer = new MapLayer();
layer.Add(overlay);
MyMap.Layers.Add(layer);
MyMapGrid.Children.Add(MyMap);



I also need my button (myCustomButton) will stay visible - but it disappear.

how can I still have some button over the map and also view some icons on it?
Thank you all! 
4

1 に答える 1