Extension, Fieldtype, Module, Plugin

Archived
Forum
(read-only)

Objective HTML does not actively monitor this forum
(but you can still get help from other EE users).

Google Maps for ExpressionEngine

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Objective HTML

     

You must be logged in to post.

Returning no results for zipcodes that exist

Support Request

doubleplusgood
doubleplusgood

Hi there,

We are using the add-on on a German site using the following code to fetch results within 50km of the town/city or postcode searched;

{exp:gmap:search
    cache_post
="false"
    
channel="salons_de"
    
latitude_field="cf_salons_de_latitude"
    
longitude_field="cf_salons_de_longitude"
    
distance_field="distance_max"
    
metric="kilometers"
}
    
<div class="txt"  style="float:left; margin-right:30px;">
        <
input type="text" name="location" value="{if post:location}{post:location}{/if}" placeholder="Stadt oder Postleitzahl eingeben" />
        <
input type="hidden" name="status" value="open" />
        <
input type="hidden" name="distance_max" value="50" />
    </
div>

    <
input class="viewbtn3" style="float:left;" value="Suchen" type="submit">
{/exp:gmap:search} 

However, it’s not returning results for ‘some’ zipcodes, even though I’m searching for the exact zipcode entered for an entry.

Please could you offer any advice to get this working? :)

UPDATE
——————
As per suggestion below, here’s my updated syntax that works in case anyone else faces a similar problem:

{exp:gmap:search
    cache_post
="false"
    
channel="salons_de"
    
geocode_field="location|country"
    
latitude_field="cf_salons_de_latitude"
    
longitude_field="cf_salons_de_longitude"
    
distance_field="distance_max"
    
metric="kilometers"
}
    
<div class="txt"  style="float:left; margin-right:30px;">
        <
input type="text" name="location" value="{if post:location}{post:location}{/if}" placeholder="Stadt oder Postleitzahl eingeben" />
        <
input type="hidden" name="status" value="open" />
        <
input type="hidden" name="country" value=", Germany" />
        <
input type="hidden" name="distance_max" value="50" />
    </
div>

    <
input class="viewbtn3" style="float:left;" value="Suchen" type="submit">
{/exp:gmap:search} 

Thanks.

Objective HTML
# 1
Developer
Objective HTML

I am away from my computer traveling to PeersConf this week. I will get back with in detail when I can but essentially you need to geocode two fields. 1) being the zip code 2) a hidden field with “, Germany” hardcodes. This will ensure all the geocoder requests are applicable to Germany.

doubleplusgood
# 2
doubleplusgood

Thank you. Working great now. :)