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.

Dutch zipcode with or without spaces

Support Request

MH Webdesign
MH Webdesign

I am encountering a problem with a store locator like functionality on a client’s website, which I can’t seem to get around. Dutch zipcodes consist out of a four digit string, followed by two letters and a space between them. When I enter something like ‘1234 AB’, the store finder returns valid results. When I enter ‘1234AB’ (note the lack of a space in between), no valid results are found.

Is there anything I can do to make this work? Although ‘1234 AB’ is the valid format, I can imagine there are quite some users that leave out the space. Here’s my code.

{exp:gmap:search
                  channel
="vestiging"
                  
latitude_field="vestiging_google_maps_latitude"
                  
longitude_field="vestiging_google_maps_longitude"
                  
geocode_field="postcode|land"
                  
metric="kilometers"
                  
distance_field="distance_max"
                  
cache_post="false"
                  
return="./#map"
                  
class="form"
                    
}
                    
                        
<input type="hidden" name="status" value="open" />
                        <
input type="hidden" name="land" value=", Nederland" />
                        <
input type="hidden" name="distance_max" value="25" />
                        <
input type="hidden" name="categories[]" value="8" />
                    
                        <
div class="form-group">
                            <
input class="form-control input-lg" name="postcode" id="form-postcode" value="{if post:postcode}{post:postcode}{/if}" placeholder="{home_map_placeholder}" />
                        </
div>
                        
                        <
div class="buttons-set">
                            <
button class="btn btn-lg btn-default">
                                <
span>{home_map_button_label}</span>
                            </
button>
                        </
div>
                        
                    
{/exp:gmap:search} 

And here’s my result tags:

{exp:gmap:init
    key
="{googlemaps_api_key}"
    
id="home_map_google_map" 
    
class="googlemap" 
    
style="width:100%;height:700px" 
    
disableDefaultUI="true"
    
scrollwheel="false"
    
center="The Netherlands"
    
zoom="8"
    
styles="/assets/js/gm-styles/homepagina-styles.js"
}

{exp
:gmap:results 
    cache_post
="false"
    
parse="inward"
    
match_categories_exact="true"
}

    {if has_searched}

        {results}
        
            {exp
:gmap:marker 
                id
="home_map_google_map" 
                
latitude="{vestiging_google_maps_latitude}"
                
longitude="{vestiging_google_maps_longitude}" 
                
icon="/assets/img/pin-googlemaps-54x66.png"
                
show_one_window="true"
            
}
                
<strong><a href="{structure:page_url_for:{entry_id}}">Vestiging {title}</a></strong>
                
{vestiging_google_maps_adres}
                
                
<class="directions"><a href="https://maps.google.com?daddr={vestiging_google_maps_latitude},{vestiging_google_maps_longitude}" target="_blank">Klik hier voor de route</a></p>
                
            
{/exp:gmap:marker}
        
        {
/results}
    
    {if
:else}
        
        {exp
:channel:entries
            channel
="vestiging"
            
category="8"
            
dynamic="no"
            
limit="100"
            
disable="categories|category_fields|pagination|member_data|trackbacks"
        
}
            
            {exp
:gmap:marker 
                id
="home_map_google_map" 
                
latitude="{vestiging_google_maps_latitude}"
                
longitude="{vestiging_google_maps_longitude}" 
                
geocode="false"
                
icon="/assets/img/pin-googlemaps-54x66.png"
                
show_one_window="true"
            
}
                
<strong><a href="{structure:page_url_for:{entry_id}}">Vestiging {title}</a></strong>
                
{vestiging_google_maps_adres}
                
                
<class="directions"><a href="https://maps.google.com?daddr={vestiging_google_maps_latitude},{vestiging_google_maps_longitude}" target="_blank">Klik hier voor de route</a></p>
                
            
{/exp:gmap:marker}
            
        {
/exp:channel:entries}    
        
    {
/if}

{
/exp:gmap:results} 
MH Webdesign
# 1
MH Webdesign

There doesn’t seem to be a whole lot of support for this one here. Unfortunate.. I can’t keep my client waiting for an answer.