Ejemplo n.º 1
0
        public void GetSeachFuzzyBatch()
        {
            var am = new AzureMapsToolkit.AzureMapsServices(_KEY);

            var q1 = new SearchFuzzyRequest
            {
                Query  = "atm",
                Lon    = 47.639769,
                Lat    = -122.128362,
                Radius = 5000,
                Limit  = 5
            };

            var q2 = new SearchFuzzyRequest
            {
                Query = "Statue Of Liberty",
                Limit = 2
            };

            var q3 = new SearchFuzzyRequest
            {
                Query  = "Starbucks",
                Lat    = 47.639769,
                Lon    = -122.128362,
                Radius = 5000
            };

            var req = new SearchFuzzyRequest[] { q1, q2, q3 };
            var res = am.GetSearchFuzzy(req).Result;

            Assert.Null(res.ex);

            Assert.NotNull(res.ResultUrl);
        }
Ejemplo n.º 2
0
        public void GetSearchFuzzy()
        {
            var am  = new AzureMapsToolkit.AzureMapsServices(_KEY);
            var req = new SearchFuzzyRequest
            {
                Query = "seattle"
            };
            var res = am.GetSearchFuzzy(req).Result;

            Assert.Null(res.Error);

            Assert.Equal(1, res.Result.Summary.FuzzyLevel);
        }
Ejemplo n.º 3
0
        public void GetSearchFuzzy()
        {
            var am  = new AzureMapsToolkit.AzureMapsServices(_KEY);
            var req = new SearchFuzzyRequest
            {
                CountrySet = "US",
                Query      = "seattle",
                IdxSet     = new string[] { "Geo", "POI" }
            };
            var res = am.GetSearchFuzzy(req).Result;

            Assert.Null(res.Error);

            Assert.Equal(1, res.Result.Summary.FuzzyLevel);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// The basic default API is Free Form Search which handles the most fuzzy of inputs handling any combination of address or POI tokens. This search API is the canonical 'single line search'. The Free Form Search API is a seamless combination of POI search and geocoding. The API can also be weighted with a contextual position (lat./lon. pair), or fully constrained by a coordinate and radius, or it can be executed more generally without any geo biasing anchor point.
        /// We strongly advise you to use the 'countrySet' parameter to specify only the countries for which your application needs coverage, as the default behavior will be to search the entire world, potentially returning unnecessary results.
        /// Most Search queries default to maxFuzzyLevel=2 to gain performance and also reduce unusual results. This new default can be overridden as needed per request by passing in the query param maxFuzzyLevel=3 or 4.
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public virtual async Task <Response <SearchFuzzyResponse> > GetSearchFuzzy(SearchFuzzyRequest req)
        {
            var res = await ExecuteRequest <SearchFuzzyResponse, SearchFuzzyRequest>("https://atlas.microsoft.com/search/fuzzy/json", req);

            return(res);
        }