Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Yannick Smits 321 posts 718 karma points
    Sep 18, 2013 @ 17:52
    Yannick Smits
    0

    getting strange behavior for "harlem"

    When I search for "harlem" the map shows Haarlem, The Netherlands, but the results lists shows stores in New York, USA (harlem area...).

    Any ideas?

  • Alex Skrypnyk 5908 posts 22603 karma points MVP 4x admin c-trib
    Sep 18, 2013 @ 18:15
    Alex Skrypnyk
    0

    Hi Yannick,

    What map do you use ?

  • Yannick Smits 321 posts 718 karma points
    Sep 18, 2013 @ 18:25
    Yannick Smits
    0

    google maps embedded into http://our.umbraco.org/projects/developer-tools/seek-and-destroy (the sub-forum we're in.... :))

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Sep 18, 2013 @ 18:31
    Tim Geyssens
    0

    Haarlem works fine but harlem shows harlem manhatten

    So they'll just have to add the country if you get the wrong results...

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Sep 18, 2013 @ 18:37
    Tim Geyssens
    0

    So yeah it's kinda what you would expect when searching for harlem, don't see any mixed results...

  • Yannick Smits 321 posts 718 karma points
    Sep 18, 2013 @ 18:41
    Yannick Smits
    0

    wouldn't it be more logical if the map an the list both showed harlem? Instead of the map showing haarlem and the list showing harlem?

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Sep 18, 2013 @ 18:47
    Tim Geyssens
    0

    Yeah don't see mixed results when I search harlem it shows harlem manhatten

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Sep 18, 2013 @ 18:48
    Tim Geyssens
    0

    Look :) enter image description here

  • Yannick Smits 321 posts 718 karma points
    Sep 18, 2013 @ 18:52
    Yannick Smits
    0

    Strange Look:

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Sep 18, 2013 @ 19:04
    Tim Geyssens
    0

    Hmm strange indeed, will check if I can spot something in the code

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Sep 18, 2013 @ 19:06
    Tim Geyssens
    0

    Yeah it's indeed 2 different blocks of code that do the lookup so maybe change the locator controller so it takes in the coordinates of the search location instead of the address again, make sense?

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Sep 18, 2013 @ 19:09
    Tim Geyssens
    0

    So if you take a look at

    https://github.com/TimGeyssens/LocatorRazorStyle/blob/master/TestSite/Views/MacroPartials/SeekAndDestroy.cshtml

    you see that the map lat long is available at line 170

    So just send that the the controller line 219 instead of the address

    and then you don't need the lookup in the controller but can just use the coordinates and it won't show different results...

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Sep 18, 2013 @ 19:11
    Tim Geyssens
    100

    So in the controller

    https://github.com/TimGeyssens/LocatorRazorStyle/blob/master/GeoCodingTest/Umbraco/LocatorApiController.cs

    you won't need

    var r = GoogleGeoCoder.CallGeoWS(address);
    

    but can then just create the searchLocation from the passed in coordinates

    searchLocation = new Location(lat, lng);
    
  • Yannick Smits 321 posts 718 karma points
    Sep 18, 2013 @ 23:22
    Yannick Smits
    0

    works wonderfully! and speeds up the code even making it more efficient. Great find.

  • Yannick Smits 321 posts 718 karma points
    Sep 18, 2013 @ 23:25
    Yannick Smits
    0

    although I also like the old version of Locator where you could select from a list when there was ambiguity. But maybe this makes the UI simpler.

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Sep 19, 2013 @ 10:26
    Tim Geyssens
    0

    Great, glad it's working :)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies