internal static async Task <ReportItem> CreateReportItemAsync(string title, string description,
                                                                      IMappablePoint point, IStorageFile image)
        {
            var item = new ReportItem()
            {
                Title       = title,
                Description = description,
                NativeId    = Guid.NewGuid().ToString(),
                Status      = ReportItemStatus.New
            };

            item.SetLocation(point);

            // save...
            var conn = StreetFooRuntime.GetUserDatabase();
            await conn.InsertAsync(item);

            // stage the image...
            if (image != null)
            {
                // new path...
                var manager = new ReportImageCacheManager();
                var folder  = await manager.GetCacheFolderAsync();

                // create...
                await image.CopyAsync(folder, item.NativeId + ".jpg");
            }

            // return...
            return(item);
        }
예제 #2
0
        internal void SetLocation(IMappablePoint point)
        {
            this.InnerItem.SetLocation(point);

            // update...
            this.OnPropertyChanged("LocationNarrative");
        }
예제 #3
0
        private void SetPushpinPoint(IMappablePoint point)
        {
            // set...
            this.ClearPushpins();

            // set...
            if (point != null)
                this.AddPushpinAndCenterAndZoom(point, false);
        }
        private void SetPushpinPoint(IMappablePoint point)
        {
            // set...
            this.ClearPushpins();

            // set...
            if (point != null)
            {
                this.AddPushpinAndCenterAndZoom(point, false);
            }
        }
예제 #5
0
        public void AddPushpinAndCenterAndZoom(IMappablePoint point, bool animate = true)
        {
            var pin = this.AddPushpin(point);

            // show...
            var duration = MapAnimationDuration.Default;
            if (!(animate))
                duration = MapAnimationDuration.None;

            // show...
            this.InnerMap.SetView(point.ToLocation(), StandardZoom, duration);
        }
예제 #6
0
        public Pushpin AddPushpin(IMappablePoint point)
        {
            // create a pin and set it's position...
            var pin = new Pushpin();
            pin.Text = point.Name;
            MapLayer.SetPosition(pin, point.ToLocation());

            // ...then add it...
            this.InnerMap.Children.Add(pin);

            // return...
            return pin;
        }
        internal static async Task OpenMapsAppAsync(IMappablePoint point, bool showTraffic = true)
        {
            string trafficFlag = "0";
            if(showTraffic)
                trafficFlag = "1";

            // create the uri...
            var uri = string.Format("bingmaps://open/?cp={0:n5}~{1:n5}&lvl=15&trfc={2}", point.Latitude, point.Longitude, trafficFlag);
            Debug.WriteLine("Navigating: {0}", uri);

            // open...
            await Launcher.LaunchUriAsync(new Uri(uri));
        }
        public Pushpin AddPushpin(IMappablePoint point)
        {
            // create a pin and set it's position...
            var pin = new Pushpin();

            pin.Text = point.Name;
            MapLayer.SetPosition(pin, point.ToLocation());

            // ...then add it...
            this.InnerMap.Children.Add(pin);

            // return...
            return(pin);
        }
        internal static async Task OpenMapsAppAsync(IMappablePoint from, IMappablePoint to, bool showTraffic = true)
        {
            string trafficFlag = "0";
            if (showTraffic)
                trafficFlag = "1";

            // create the uri...
            var uri = string.Format("bingmaps://open/?rtp=pos.{0:n5}_{1:n5}~pos.{2:n5}_{3:n5}&trfc={4}", from.Latitude, from.Longitude, 
                to.Latitude, to.Longitude, trafficFlag);
            Debug.WriteLine("Navigating: {0}", uri);

            // open...
            await Launcher.LaunchUriAsync(new Uri(uri));
        }
        public void AddPushpinAndCenterAndZoom(IMappablePoint point, bool animate = true)
        {
            var pin = this.AddPushpin(point);

            // show...
            var duration = MapAnimationDuration.Default;

            if (!(animate))
            {
                duration = MapAnimationDuration.None;
            }

            // show...
            this.InnerMap.SetView(point.ToLocation(), StandardZoom, duration);
        }
        internal static async Task OpenMapsAppAsync(IMappablePoint point, bool showTraffic = true)
        {
            string trafficFlag = "0";

            if (showTraffic)
            {
                trafficFlag = "1";
            }

            // create the uri...
            var uri = string.Format("bingmaps://open/?cp={0:n5}~{1:n5}&lvl=15&trfc={2}", point.Latitude, point.Longitude, trafficFlag);

            Debug.WriteLine("Navigating: {0}", uri);

            // open...
            await Launcher.LaunchUriAsync(new Uri(uri));
        }
        internal static async Task OpenMapsAppAsync(IMappablePoint from, IMappablePoint to, bool showTraffic = true)
        {
            string trafficFlag = "0";

            if (showTraffic)
            {
                trafficFlag = "1";
            }

            // create the uri...
            var uri = string.Format("bingmaps://open/?rtp=pos.{0:n5}_{1:n5}~pos.{2:n5}_{3:n5}&trfc={4}", from.Latitude, from.Longitude,
                                    to.Latitude, to.Longitude, trafficFlag);

            Debug.WriteLine("Navigating: {0}", uri);

            // open...
            await Launcher.LaunchUriAsync(new Uri(uri));
        }
        internal static async Task<ReportItem> CreateReportItemAsync(string title, string description, 
            IMappablePoint point, IStorageFile image)
        {
            var item = new ReportItem()
            {
                Title = title,
                Description = description,
                NativeId = Guid.NewGuid().ToString(),
                Status = ReportItemStatus.New
            };
            item.SetLocation(point);

            // save...
            var conn = StreetFooRuntime.GetUserDatabase();
            await conn.InsertAsync(item);

            // stage the image...
            if (image != null)
            {
                // new path...
                var manager = new ReportImageCacheManager();
                var folder = await manager.GetCacheFolderAsync();

                // create...
                await image.CopyAsync(folder, item.NativeId + ".jpg");
            }

            // return...
            return item;
        }
 internal void SetLocation(IMappablePoint point)
 {
     this.Latitude = point.Latitude;
     this.Longitude = point.Longitude;
 }
        internal static async Task<ReportItem> CreateReportItemAsync(string title, string description, 
            IMappablePoint point, IStorageFile image)
        {
            var item = new ReportItem()
            {
                Title = title,
                Description = description,
                NativeId = Guid.NewGuid().ToString(),
                Status = ReportItemStatus.New
            };
            item.SetLocation(point);

            // save...
            var conn = StreetFooRuntime.GetUserDatabase();
            await conn.InsertAsync(item);

            // stage the image...
            if (image != null)
                await item.StageImageAsync(image);

            // return...
            return item;
        }
 public AdHocMappablePoint(IMappablePoint point)
     : this(point.Latitude, point.Longitude, point.Name)
 {
 }
예제 #17
0
 public static Location ToLocation(this IMappablePoint point)
 {
     return(new Location((double)point.Latitude, (double)point.Longitude));
 }
예제 #18
0
 internal void SetLocation(IMappablePoint point)
 {
     this.InnerItem.SetLocation(point);
 }
 internal void SetLocation(IMappablePoint point)
 {
     this.Latitude  = point.Latitude;
     this.Longitude = point.Longitude;
 }
예제 #20
0
 public AdHocMappablePoint(IMappablePoint point)
     : this(point.Latitude, point.Longitude, point.Name)
 {
 }