none
Which Bing map services to use in a store locator solution? RRS feed

  • Question

  • Hi there, 

    We have started to build a new store locator and come to the decision that we go with Microsoft and Bing Maps as map provider. Our store locator solution will span about 20 countries worldwide and must include basic map features like route planning and display of search results.

    Looking at the API and the range of services offered by Bing Maps we are trying to settle for the best combination of service to use and would like some input on our considerations. We have already looked at the answer from tanoshimi in this thread "Store locator advice" - http://social.msdn.microsoft.com/Forums/en-US/vemapcontroldev/thread/a83752db-db9e-452d-adb7-a93c0eeb820b but still have some questions though we found it very useful. 

    First of all we will need to host our own data (store address + long/lat in our own database) so therefore we need to initially bulk geo-tag our own data. For this purpose we have considered using the Bing Spatial Data Service and the Dataflow API hence we can upload large amount of addresses and poll the server until the answer is ready and then receive geo-tagged data in XML. We feel pretty confident about this solution.

    The next natural step in the store locator process is to get the position of where the end-user is starting his search based on a query submitted by the end-user. This is currently the functionality that troubles us the most:

    • Initially we started with the Bing Maps Ajax control v6.3 using the Find method on the VEMap class but soon found that we was not able to control the format of the address string returned by the function (we do not want the countryRegion part of the address included) and generally it does not seem like the control is build for this purpose.  
    • Secondly we evaluated the REST services using the Locations service but then found that we could only receive up to 5 results using this method and often the address we had intentions to find was not among these 5 returned results. Furthermore we found that the input parameters and options used to control the output from the service was rather limited. 
    • Finally we have considered the SOAP Services which gives us the flexibility in terms of options and control of results but calling SOAP services client side does not seem ideal.

    Does anybody have any experiences implementing functionality like this? What services have you used and why? We are guessing that this must be one of the most common scenarios in a store locator design. Patterns or recommendations/solution guidance for creating such functionality using Bing Maps would be most appreciated.

    Finally I should mention that we plan to create our own search logic for finding store in our database and use the AJAX Map control for displaying stores and offering route planning etc. 

     

    Thanks for your input.

    Best regards

    Morten 

     

    • Moved by Ricky_Brundritt Friday, March 9, 2012 5:31 PM (From:Bing Maps: Map Control and Web services Development)
    Thursday, May 5, 2011 9:24 PM

Answers

  • Both REST and SOAP services are capable of doing what you want, so it really depends on the architecture of your application and personal preference as to which you choose.  (There are some feature differences between the two services but, in this case, I believe either will suffice). For me personally, I find the REST service more lightweight and easier to use, but it's up to you.

    In terms of allowing your users "flexibility", the key word to look for here is that you want to provide an unstructured query - i.e. a single string containing the full address to be geocoded. A structured query is one where you provide the elements of the address, postcode, country, region, street, etc. separately.

    For the REST service, you can perform an unstructured query by calling a URL as follows (from http://msdn.microsoft.com/en-us/library/ff701711.aspx):

    http://dev.virtualearth.net/REST/v1/Locations?q=1 Microsoft Way Redmond WA 98052?o=xml&key=BingMapsKey

    For the SOAP service, you should use the query property of the GeocodeRequest class (not the Address property, which is for structured addresses) From http://msdn.microsoft.com/en-us/library/cc981130.aspx:

    geocodeRequest.query = "1 Microsoft Way Redmond WA 98052";

    If more than one matching result is found for the given query, both services will return a result set, which you can iterate through to provide your disambiguation dialogue - "did you mean xxx?"


    twitter: @alastaira blog: http://alastaira.wordpress.com/
    Monday, May 9, 2011 7:17 AM
    Moderator

All replies

  • Hi there, 

    We have started to build a new store locator and come to the decision that we go with Microsoft and Bing Maps as map provider. Our store locator solution will span about 20 countries worldwide and must include basic map features like route planning and display of search results.

    Looking at the API and the range of services offered by Bing Maps we are trying to settle for the best combination of service to use and would like some input on our considerations. We have already looked at the answer from tanoshimi in this thread "Store locator advice" - http://social.msdn.microsoft.com/Forums/en-US/vemapcontroldev/thread/a83752db-db9e-452d-adb7-a93c0eeb820b but still have some questions though we found it very useful. 

    First of all we will need to host our own data (store address + long/lat in our own database) so therefore we need to initially bulk geo-tag our own data. For this purpose we have considered using the Bing Spatial Data Service and the Dataflow API hence we can upload large amount of addresses and poll the server until the answer is ready and then receive geo-tagged data in XML. We feel pretty confident about this solution.

    The next natural step in the store locator process is to get the position of where the end-user is starting his search based on a query submitted by the end-user. This is currently the functionality that troubles us the most:

    • Initially we started with the Bing Maps Ajax control v6.3 using the Find method on the VEMap class but soon found that we was not able to control the format of the address string returned by the function (we do not want the countryRegion part of the address included) and generally it does not seem like the control is build for this purpose.  
    • Secondly we evaluated the REST services using the Locations service but then found that we could only receive up to 5 results using this method and often the address we had intentions to find was not among these 5 returned results. Furthermore we found that the input parameters and options used to control the output from the service was rather limited. 
    • Finally we have considered the SOAP Services which gives us the flexibility in terms of options and control of results but calling SOAP services client side does not seem ideal.

    Does anybody have any experiences implementing functionality like this? What services have you used and why? We are guessing that this must be one of the most common scenarios in a store locator design. Patterns or recommendations/solution guidance for creating such functionality using Bing Maps would be most appreciated.

    Finally I should mention that we plan to create our own search logic for finding store in our database and use the AJAX Map control for displaying stores and offering route planning etc. 

     

    Thanks for your input.

    Best regards

    Morten 

     


    Hi -

    Have you tried bing search api http://msdn.microsoft.com/en-us/library/dd251030.aspx, if that works for you, you can use it with mapcontrol v7 http://msdn.microsoft.com/en-us/library/gg427610.aspx. It is latest & provides rich set of features including Birdseye.

    Thanks. 

    Saturday, May 7, 2011 3:39 AM
  • Hi Morten, I'm glad you found my previous post helpful ;)

    @hemant - If I understand correctly, Morten has his own local data that he wishes to query and display on the map. The Bing Search API is for querying data held on Bing's servers, so this isn't going to be helpful.

    @Morten - I slightly lost you... the whole point of geocoding your existing address data (using the Spatial Data Services for this is a good idea) is that you then have all your data in terms of latitude/longitude coordinates. And that's what you use in your database layer to determine the stores in a given radius from a point, distance between stores, etc. etc. So when you are trying to get "position of where the end-user is starting his search" you also want to define this in terms of latitude/longitude - not a street address. You can, for example, let the user click directly on a Bing Map and use the tryPixelToLatLong() method to get the Lat/Long where they clicked and pass it straight back to the DB function - I'm not sure why it matters to you what format the address returned by the REST/SOAP service is?


    twitter: @alastaira blog: http://alastaira.wordpress.com/
    Saturday, May 7, 2011 7:59 AM
    Moderator
  • @tanoshimi - my recommendation was based on user using Find/REST/Soap services provided by us. So i recommended the better search service. Yes, I too was confused whether user wants there data ingestion & show it or want 3rd party API to find it. let wait for the response.
    HemantGoyal
    Saturday, May 7, 2011 8:09 AM
  •  

     

     

     

    Hi and thanks for your answers – I’m sorry about the unclear question, I’ll try to describe the problem by taking another approach!

    As I see it I can split my geocoding related functionality into a back-end and front-end part:

    Back-end

    A back-end functionality where I maintain my store data and store these in my database. For the purpose of bulk encoding I believe (and tanoshimi confirms) that using the Spatial Data Services is suitable. Besides maintaining my address data I also want to expose these to my web front-end by building my own web service (or DB function as tanoshimi suggests) that the web front-end calls. Input parameters to the web service I build would be:

     a longitude

     a latitude 

     a search radius

    And as result the web service would return all the store addresses in my database that matches the search defined by the 3 parameters.

    Front-end

    The front-end allows the end-user to enter an address or location where he is interested in searching for stores. The address should be geo-coded by use of a Bing Maps service into a latitude/longitude that can be used as a parameter when subsequently calling the web service exposed from the back-end and thereby getting a list of stores to display.

    My question is: what Bing Maps service would be best for this purpose of encoding the address entered by the end-user in the front-end? 

    The problem is that since I want to give the end-user as much flexibility (flexibility = not having to specify all address fields but only parts of it) as possible when entering the address I also introduce the possibility of an ambiguous address to search for and thereby multiple addresses will match the end-users query. Therefore I need to provide some kind of “did you mean….” - functionality.

    In order to create this “did you mean” – functionality I need to show all the addresses matching the query and not only the top 5. Furthermore I need a nice formatted address to show in this “did you mean” dialog and that’s why I raised the question in my initial post. I’ve found that I can use the FormattedAddress property and do some string formatting in order to remove the country part so please just ignore my question regarding control of the address string format…

    I hope I've managed to express my problem a bit more clear and it’s more obvious what I want to do :)

    Thanks

    Morten

     

     

     

     


    Morten Decker, Denmark
    • Edited by Morten Decker Sunday, May 8, 2011 5:46 PM spell errors
    Sunday, May 8, 2011 5:41 PM
  • There are two options for you:

    REST Service : http://msdn.microsoft.com/en-us/library/ff701715.aspx : There are variants of service depending on requirements.  

    SOAP Service : http://msdn.microsoft.com/en-us/library/cc966793.aspx : You can alter number of results by giving count in geocode options


    HemantGoyal
    Monday, May 9, 2011 2:10 AM
  • Both REST and SOAP services are capable of doing what you want, so it really depends on the architecture of your application and personal preference as to which you choose.  (There are some feature differences between the two services but, in this case, I believe either will suffice). For me personally, I find the REST service more lightweight and easier to use, but it's up to you.

    In terms of allowing your users "flexibility", the key word to look for here is that you want to provide an unstructured query - i.e. a single string containing the full address to be geocoded. A structured query is one where you provide the elements of the address, postcode, country, region, street, etc. separately.

    For the REST service, you can perform an unstructured query by calling a URL as follows (from http://msdn.microsoft.com/en-us/library/ff701711.aspx):

    http://dev.virtualearth.net/REST/v1/Locations?q=1 Microsoft Way Redmond WA 98052?o=xml&key=BingMapsKey

    For the SOAP service, you should use the query property of the GeocodeRequest class (not the Address property, which is for structured addresses) From http://msdn.microsoft.com/en-us/library/cc981130.aspx:

    geocodeRequest.query = "1 Microsoft Way Redmond WA 98052";

    If more than one matching result is found for the given query, both services will return a result set, which you can iterate through to provide your disambiguation dialogue - "did you mean xxx?"


    twitter: @alastaira blog: http://alastaira.wordpress.com/
    Monday, May 9, 2011 7:17 AM
    Moderator
  • Thanks guys... I'll have a deeper look at the REST and the SOAP services..

     

    /Morten


    Morten Decker, Denmark
    Monday, May 9, 2011 5:27 PM