0

非常に多くのmaplayerが存在するBingMapControllがあります

このように画鋲クリックイベントにポップアップを表示したい

Bing Mapsは、画鋲、ポップアップ、トランジットの新しい外観を取得します-詳細については、http://wmpoweruser.com/bing-maps-gets-new-look-for-pushpins-popups-and-transit/#sthash.ApL3q6bAを参照してください。 dpuf

どうすればこれができますか。

bing map controllでポップアップを開発するためのアドバイスを教えてください。はい、このポップアップに緯度、経度、住所を表示したいと思います。

Muプッシュインコード

 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