none
SearchManager and DirectionsManager. Some address streets are different. RRS feed

  • Question

  • I'm using SearchManager to search for place of interest or specific street. No problem there.

    The problem: Let's say I search for a place "pizza cottage inn near east lansing, mi" 

    One of the results is:
    303 S Washington Sq, Lansing, MI

    If I pass that street string to DirectionsManager as a waypoint, the directionsUpdated callback returns the specific waypoint with the address:

    303 Washington Sq S, Lansing, MI 48933

    Notice that it put "S" for "south" at the end of the street.

    I am surprised that the SearchManager street is sometimes different than what DirectionsManager expects as input.

    My solution is to put a hidden map div with DirectionsManager initialized hidden from the user. As the user search and selects for places, the hidden DirectionsManager would convert the address. Any other suggestions? Because this is really a "hack" and I rather use a cleaner solution.


    • Edited by dcombs08 Wednesday, March 4, 2015 6:34 PM elaboration.
    Monday, March 2, 2015 7:07 PM

Answers

  • Both versions of the address are correct. The difference is due to data coming from multiple data providers. POI data comes from a number of different sources such as Yelp, Yellow pages, and Nokia. Where as the routing in the US is done using just Nokia data.

    You shouldn't need to worry about a hack. You should just leave this as is as it shouldn't cause any issues.


    http://rbrundritt.wordpress.com

    Monday, March 2, 2015 10:48 PM

All replies

  • Both versions of the address are correct. The difference is due to data coming from multiple data providers. POI data comes from a number of different sources such as Yelp, Yellow pages, and Nokia. Where as the routing in the US is done using just Nokia data.

    You shouldn't need to worry about a hack. You should just leave this as is as it shouldn't cause any issues.


    http://rbrundritt.wordpress.com

    Monday, March 2, 2015 10:48 PM
  • First, I want to thank you for responding. The additional info about the different data sources is what I have suspected but your confirmation is something I can use to back up my statement.

    Just an additional information about the problem.

    My application uses the address line as a "special identifier". So with that restraint: here is what I am going with:

    I noticed SearchManager POI search results does not populate POSTAL CODE. But that's out of scope for this problem/solution.

    1. My users select a result or result(s) from SearchManager on Page A.
    2. They are forwarded to page B. Page B contains the DirectionsManager (point A to point B) functionality.
    3. Page B contains embedded address lines ("123 North Street") from page A as hidden inputs (generated from server side via JSP).

    My solution is to load the DirectionsManager on page A.

    As user selects the place of interest ("pizza hut") or a specific address from SearchManager...selected results of the address line gets generated as a new waypoint object. Then get added to DirectionsManager.

    When the user clicks the button to move to page B...the function will call DirectionsManager and get all the waypoints address line and swap that into the JSON I am submitting to the backend. For an example: { name: "pizza hut", address: "123" }

    IMPORTANT!!! Make sure to hide the DirectionsManager markers to invisible and route colors to be transparent. Otherwise the search results from SearchManager (markers of "pizza hut") will interfere with the DirectionsManager's waypoints ("A","B") .

    This way, DirectionsManager and SearchManager both uses the same map. While really one (SearchManager) should be visible to page A while needing to pass the exact address line to page B.



    • Edited by dcombs08 Wednesday, March 4, 2015 6:35 PM elaboration
    Tuesday, March 3, 2015 7:26 PM