Ejemplo n.º 1
0
        /// <summary>
        /// Get Reported Cruelty Spots with Google Place Ids
        /// ToDo: This method should accept a lat/lng so we don't retrieve more than we need
        /// </summary>
        /// <param name="callback"></param>
        private async void GetReportedCrueltySpotsAsync(Action<PlacesList> callback)
        {
            var crueltySpotsService = new CrueltySpotsService();

            var googleCrueltySpots = await crueltySpotsService.GetAllGooglePlacesAsync();
            _reportedGooglePlaces = new Dictionary<string, string>();
            foreach (var crueltySpot in googleCrueltySpots)
            {
                if (!_reportedGooglePlaces.ContainsKey(crueltySpot.GooglePlaceId))
                {
                    _reportedGooglePlaces.Add(crueltySpot.GooglePlaceId, crueltySpot.ObjectId);
                }
            }
            _reportedGooglePlacesRetrieved = true;
            SearchCompleted(callback);
        }