WP7
WP7

Reputation: 165

Samples on Pushpin infobox in windows phone 7 bing maps?

How to show the info box when click on pushpins in windows phone 7?i.e when click on pushpin need to show some data and arrow button on the right side of data.please help me ...

Upvotes: 1

Views: 898

Answers (3)

There are alot of examples on the Bind sdk site: http://www.bingmapsportal.com/isdk/ajaxv7

Upvotes: 0

Mansinh Dodiya
Mansinh Dodiya

Reputation: 11

when you click on pushpin at that time you display message box. i.e In Your click event put message box.see bellow coding

                        pin[i] = new Pushpin();
                        pin[i].Location = new GeoCoordinate(Latitude, LongLatitude);

                        map1.Children.Add(pin[i]);
                        myCoorditeWatcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
                        myCoorditeWatcher.MovementThreshold = 20;

                        var gl = GestureService.GetGestureListener(pin[i]);
                        gl.Tap += new EventHandler<GestureEventArgs>(GestureListener_Stack_Tap);




 private void GestureListener_Stack_Tap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            for (int i = 0; i <= ClsGetDeviceMap.lstLongLatitude.Count - 1; i++)
            {
                if (sender.Equals(pin[i]))
                {
                    MessageBox.Show(ClsGetDeviceMap.lstLocationName.ElementAt<string>(i).Trim());
                                        MessageBox.Show(ClsGetDeviceMap.lstLatitude.ElementAt<string>(i).Trim());
                    MessageBox.Show(ClsGetDeviceMap.lstLongLatitude.ElementAt<string>(i).Trim());

                }
          }
        }

Upvotes: 1

Dargos
Dargos

Reputation: 229

You can customize your Pushpin

for example :

<my:Map Name="map1">

                <my:Map.Resources>
                    <DataTemplate x:Key="pushpinTpl">
                        <my:Pushpin PositionOrigin="{Binding position}">
                            <my:Pushpin.ContentTemplate>
                                <DataTemplate>
                                    <ToggleButton x:Name="togButt" >
                                        <Grid>
                                            <TextBlock Text="click" 
                                                       Visibility="{Binding ElementName=togButt,Path=IsChecked,Converter={StaticResource BoolConverter},ConverterParameter=!}"/>
                                            <TextBlock Text="alternative content" 
                                                       Visibility="{Binding ElementName=togButt,Path=IsChecked,Converter={StaticResource BoolConverter}}"/>
                                        </Grid>
                                    </ToggleButton>
                                </DataTemplate>
                            </my:Pushpin.ContentTemplate>
                        </my:Pushpin>
                    </DataTemplate>
                </my:Map.Resources>

                <my:MapItemsControl ItemsSource="{Binding items}" 
                                    ItemTemplate="{StaticResource pushpinTpl}"
                                    />
            </my:Map>

hope this help :)

Upvotes: 0

Related Questions