Completed
Last Updated: 08 Mar 2018 09:08 by ADMIN
ADMIN
Petar Mladenov
Created on: 20 Jun 2017 11:22
Category: Map
Type: Bug Report
0
Map: BingRestMapProvider cannot search location with unstructured URL
BingRestMapProvider always search with Structured URL and that is why it fails to find locations via long query search strings like: 

"royalton rd & brecksville rd brecksville oh"

You can see the difference between Structured and Unstructured rest search URLs here:

https://msdn.microsoft.com/en-us/library/ff701711.aspx



As a workaround, users can override BingRestMapProvider like so:

 public class CustomBingRestProvider : BingRestMapProvider
    {    
        protected override Uri BuildSearchLocationRequestUri(BingRestSearchLocationRequest request)
        {
            Uri baseUri = base.BuildSearchLocationRequestUri(request);

            string newPath = baseUri.AbsoluteUri.Replace("Locations/", "Locations/?q=");

            return new Uri(newPath); ;
        }



1 comment
ADMIN
Yoan
Posted on: 08 Mar 2018 09:08
With R1 2018 SP2 Release we had added the UseUnstructuredQuery option of BingRestSearchLocationOptions. It allows searching location with BING REST Location API unstructured URLs.