0

我有 bing 地图控件,其中有很多地图播放器

我想在我的图钉点击事件中显示弹出窗口,就像这样

Bing Maps 为图钉、弹出窗口和 Transit 带来新外观 - 更多信息请访问:http://wmpoweruser.com/bing-maps-gets-new-look-for-pushpins-popups-and-transit/#sthash.ApL3q6bA。 dpuf

我怎么能做到这一点。

给我一些关于在 bing 地图控件中开发弹出窗口的建议,是的,我想在这个弹出窗口中显示纬度、经纬度和地址

穆推码

 void _ClsGetDeviceMap_WorkFinished(bool success)
        {
            try
            {
                if (ClsGetDeviceMap.lstresponsecode.ElementAt<string>(0).Trim() == "1")
                {
                    MessageBox.Show(ClsGetDeviceMap.lstresponsemsg.ElementAt<string>(0));

                    for (int i = 0; i <= ClsGetDeviceMap.lstLongLatitude.Count - 1; i++)
                    {
                        string lat, lon;
                        lat = ClsGetDeviceMap.lstLatitude.ElementAt<string>(i).Trim();
                        lon = ClsGetDeviceMap.lstLongLatitude.ElementAt<string>(i).Trim();
                        Latitude = Convert.ToDouble(lat);
                        LongLatitude = Convert.ToDouble(lon);
                        GpsSpeed = 44.21811;

                        map1.Center = new GeoCoordinate(Latitude, LongLatitude, GpsSpeed);
                        map1.ZoomLevel = 17;
                        map1.ZoomBarVisibility = Visibility.Visible;


                        imglayer[i] = new MapLayer();
                        Image img = new Image();
                        img.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri("/ReachMe;component/Images/mappinicn.png", UriKind.Relative));
                        img.Opacity = 0.8;
                        img.Stretch = System.Windows.Media.Stretch.None;
                        GeoCoordinate location = new GeoCoordinate() { Latitude = Latitude, Longitude = LongLatitude };
                        PositionOrigin position = PositionOrigin.Center;                        
                        imglayer[i].AddChild(img, location, position);

                        Pushpin pin = new Pushpin();

                        ToolTipService.SetToolTip(pin, "Pushpin 1\r\nThis is the first pushpin infobox.");
                        imglayer[i].Children.Add(pin);

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

                        var g1 = GestureService.GetGestureListener(imglayer[i]);
                        g1.Tap += new EventHandler<GestureEventArgs>(g1_Tap);

                    }

                }
                else// if error
                {
                    MessageBox.Show("No Data Between This data");
                   // NavigationService.Navigate(new Uri("/ReachMeView/Login.xaml", UriKind.RelativeOrAbsolute));
                }
            }
            catch (Exception ex)
            {
                Error.WriteErrorLog(ex.ToString(), "MainPage.xaml", "Data_WorkFinished");
            }
        }

        void g1_Tap(object sender, GestureEventArgs e)
        {
            for (int i = 0; i <= ClsGetDeviceMap.lstLongLatitude.Count - 1; i++)
            {
                if (sender.Equals(imglayer[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());
                    MessageBox.Show(ClsGetDeviceMap.lstDate.ElementAt<string>(i).Trim());                   
                }
            }
        }
4

0 回答 0