Welcome guest, please Login or Register

EEC.MS - ExpressionEngine add-ons

You are here: HomeForum Home → Fieldtypes → MX Google Map → Thread

   

Results default to USA, I need UK results only but ‘region=“uk”’ doesn’t work

Rank

Total Posts: 3

Joined 2011-09-22

PM

I have tried adding region=“uk” to the store locator form as a hidden field value, I have also tried adding a parameter to the form tag:
{exp:mx_google_map:form result_page = “./store-locations” log=”” lat=”” region=“uk” unit = “” backspace=“1”}

but neither have any effect so a search for ‘Lincoln’ for example brings back no results, but a search for ‘Lincoln uk’ brings back the correct results.

Is there a way to set the bias of google maps using your plugin?

For others, who have this issue, a quick fix is to add the required region code (found here: http://www.iana.org/assignments/language-subtag-registry) to the end of each search string:

$("#mx_locator").submit(function() {
   
var = $(this).find('#address').val();
   var 
found v.search(' uk');
   if (
found 1{
    
$(this).find('#address').val(' uk');
   
}
  }
); 

I would prefer a proper solution though.

Many thanks.

     
Rank

Total Posts: 2

Joined 2011-11-02

PM

Was there any resolution to this? I’m finding the geodata returned by Google to be very sketchy. There seems to be “holes” in the data (at least in the UK).

     
Rank

Total Posts: 3

Joined 2011-09-22

PM

No reply from the creator unfortunately, it’s obviously a fairly common problem as quite a few people have viewed the thread.

Is the jquery fix no good for you?

     
Rank

Total Posts: 2

Joined 2011-11-02

PM

It might be. Though I got around it by appending UK (or England) to the option values in a select element.

What’s more of a problem is that I’m trying to build that select box dynamically from entries. But some entries don’t return anything - or return incorrect info. I’ve found that you can drop a pin and not get anything from Google for, say, administrative_area_level_2 but move the pin 5m to the left or right and suddenly you’ll get all the geo info back. I’m just trying to work out a way to build what I need without having my admins placing a pin AND entering a manual address.

     
Rank

Total Posts: 3

Joined 2011-09-22

PM

The pin problem may be related to the Postoffice insisting that google couldn’t use the last 2 characters of postcodes, so the accuracy of the api isn’t great in the UK, I’m not sure if this is still true though.