Ejemplo n.º 1
0
        public void clicked(NSNumber lat, NSNumber lng)
        {
            var location = new Location(lat.DoubleValue, lng.DoubleValue);
            var message = string.Format("Looking up {0}...", location.ToDms()).Replace("\"", "\\\"");
            MapWebView.InvokeMapScript("setPopup([{0}, {1}], \"{2}\")", lat, lng, message);

            MapController.NameFromLocation(
                location,
                Location.PlaceNameFilter.Minimal,
                (s) =>
            {
                BeginInvokeOnMainThread(delegate
                {
                    MapWebView.InvokeMapScript("setPopup([{0}, {1}], \"{2}\")", lat, lng, s);
                });
            });
        }
Ejemplo n.º 2
0
 public void UpdateLocation(Location newLocation)
 {
     Location = newLocation;
     _gpsCoordinates = Location == null ? "" : Location.ToDms();
 }
Ejemplo n.º 3
0
        private void UpdateFileLocations(IList<string> pathList, double latitude, double longitude, bool updateStatusText = true)
        {
            if (pathList.Count < 1)
                return;

            var location = new Location(latitude, longitude);
            if (updateStatusText)
                SetStatusText("Updating {0} file(s) to {1}", pathList.Count, location.ToDms());

            var imagePathList = new List<string>();
            var videoPathList = new List<string>();
            SeparateVideoList(pathList, imagePathList, videoPathList);

            Task.Run( () => GeoUpdater.UpdateFiles(
                imagePathList,
                videoPathList,
                latitude,
                longitude,
                () => BeginInvokeOnMainThread( delegate
                {
                    foreach (var f in pathList)
                    {
                        var imageItem = ImageItemFromPath(f);
                        if (imageItem != null)
                        {
                            imageItem.UpdateLocation(location);
                        }
                    }

                    if (updateStatusText)
                    {
                        SetStatusText("Finished updating {0} files to {1}", pathList.Count, location.ToDms());
                    }
                    imageView.ReloadData();
                })));
        }