Skip to:
Content
Pages
Categories
Search
Top
Bottom

Way to not show if results are not right or null?

  • I have some members entering things like: near houston, texas

    and then I get a pop-up error window stating something about:

    Geocode was not successful for the following reason: ZERO_RESULTS

    Is there a way to avoid this by just not showing if the results are wrong?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of Hugo
    Hugo
    Moderator

    @hnla

    @frizzo firstly sorry about the slow response, when using this site it’s best to always use the @mention function as the site otherwise doesn’t really have any normal means of tracking threads or groups.

    Sadly the input does need to be data google can actually geo encode so stating ‘near’ is going to be utterly meaningless to google, however google will return quite fine results so why dont your users state something more specific, I can map myself to my garden square using postcode (zipcode) .

    I’m not sure it’s possible to filter out user entries to prevent google throwing an error as it won’t be possible to know what one is meant to filter, it may be possible to control the callback error that google generates either modifying it or simply preventing any further execution – which I have to admit I thought was the behavior .

    I think that the best that can be done for the moment is to issue more explicit instruction on the input field, using the field description box to explain by example a suitable format for entering a location.

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    @frizzo Actually I’ve just checked on one of my tset sites and entering ‘near houston, texas’ as per you post does not throw an error google locates the center of Houston just fine which is the best it can do given the data. So your users must actually be doing something else to upset things or there is a JS conflict at work.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.