/// <summary>
        /// Method to set Map
        /// </summary>
        /// <param name="coordinateCollectionSub"></param>
        /// <param name="count"></param>
        private void SetMap(GPSurgeriesCollection coordinateCollectionSub, int count)
        {
            if (count == 0)
            {
                GPSurgeriesFeedData coordinate = coordinateCollectionSub.First();
                if (!IsFromSaved)
                {
                    MyMap.Center = new GeoCoordinate(Convert.ToDouble(coordinate.Latitude), Convert.ToDouble(coordinate.Longitude));

                }
                else
                {
                    MyMap.Center = App.LocalServiceCentreCoordinates;
                    MyMap.ZoomLevel = App.LocalServiceZoomLevel;
                    IsFromSaved = false;
                }

            }

            foreach (GPSurgeriesFeedData coordinate in coordinateCollectionSub)
            {
                IsPlotted = true;

                Pushpin pushpin = new Pushpin();

                pushpin.Content = " +";
                pushpin.Tap += new EventHandler<System.Windows.Input.GestureEventArgs>(PushpinTap);

                MapLayer layer = new MapLayer();
                MapOverlay overlay = new MapOverlay();

                pushpin.Tag = coordinate.Name + "_" + coordinate.PostCode + "_" + coordinate.Addressline1 + "_" + coordinate.Addressline2 + "_" + coordinate.Addressline3 + "_" + coordinate.Addressline4 + "_" + coordinate.Addressline5 + "_" + coordinate.Telephone + "_" + coordinate.Latitude + "_" + coordinate.Longitude;

                overlay.Content = pushpin;

                overlay.GeoCoordinate = new GeoCoordinate(Convert.ToDouble(coordinate.Latitude), Convert.ToDouble(coordinate.Longitude));
                overlay.PositionOrigin = new Point(0.0, 1.0);
                layer.Add(overlay);
                MyMap.Layers.Add(layer);
            }
        }
예제 #2
0
        /// <summary>
        /// Method to set Map
        /// </summary>
        /// <param name="coordinateCollectionSub"></param>
        /// <param name="count"></param>
        private void SetMap(GPSurgeriesCollection coordinateCollectionSub, int count)
        {
            if (count == 0)
            {
                GPSurgeriesFeedData coordinate = coordinateCollectionSub.First();
                if (!IsFromSaved)
                {
                    MyMap.Center = new GeoCoordinate(Convert.ToDouble(coordinate.Latitude), Convert.ToDouble(coordinate.Longitude));
                }
                else
                {
                    MyMap.Center    = App.LocalServiceCentreCoordinates;
                    MyMap.ZoomLevel = App.LocalServiceZoomLevel;
                    IsFromSaved     = false;
                }
            }

            foreach (GPSurgeriesFeedData coordinate in coordinateCollectionSub)
            {
                IsPlotted = true;

                Pushpin pushpin = new Pushpin();

                pushpin.Content = " +";
                pushpin.Tap    += new EventHandler <System.Windows.Input.GestureEventArgs>(PushpinTap);

                MapLayer   layer   = new MapLayer();
                MapOverlay overlay = new MapOverlay();

                pushpin.Tag = coordinate.Name + "_" + coordinate.PostCode + "_" + coordinate.Addressline1 + "_" + coordinate.Addressline2 + "_" + coordinate.Addressline3 + "_" + coordinate.Addressline4 + "_" + coordinate.Addressline5 + "_" + coordinate.Telephone + "_" + coordinate.Latitude + "_" + coordinate.Longitude;

                overlay.Content = pushpin;

                overlay.GeoCoordinate  = new GeoCoordinate(Convert.ToDouble(coordinate.Latitude), Convert.ToDouble(coordinate.Longitude));
                overlay.PositionOrigin = new Point(0.0, 1.0);
                layer.Add(overlay);
                MyMap.Layers.Add(layer);
            }
        }