예제 #1
0
        /// <inheritdoc/>
        public virtual async Task <IList <SearchResult> > SearchAsync(SearchSuggestion suggestion, CancellationToken cancellationToken = default)
        {
            await _loadTask;

            cancellationToken.ThrowIfCancellationRequested();

            var results = await Locator.GeocodeAsync(suggestion.UnderlyingObject as SuggestResult, cancellationToken);

            cancellationToken.ThrowIfCancellationRequested();

            return(ResultToSearchResult(results));
        }
예제 #2
0
        /// <inheritdoc />
        public override async Task <IList <SearchResult> > SearchAsync(SearchSuggestion suggestion, CancellationToken cancellationToken = default)
        {
            await _additionalLoadTask;

            cancellationToken.ThrowIfCancellationRequested();

            var tempParams = new GeocodeParameters();

            foreach (var attribute in GeocodeParameters.ResultAttributeNames)
            {
                tempParams.ResultAttributeNames.Add(attribute);
            }

            var results = await Locator.GeocodeAsync(suggestion.UnderlyingObject as SuggestResult, tempParams, cancellationToken);

            cancellationToken.ThrowIfCancellationRequested();

            return(await ResultToSearchResult(results));
        }