Restrict OSM address auto complete to one country

This topic contains 2 replies, has 2 voices, and was last updated by  Ian 5 years, 5 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #454753

    Ian
    Expired Member
    Post count: 144

    Hi there.

    Just wondering how to restrict OSM address auto complete to one country/ default country?

    At present when say using ‘add listing’, when you start typing an address it shows random addresses from all around the world? How can i restrict this to just my country (New Zealand)

    I have tried adding the custom script into the footer as per a previous similar question on the forum but its not working …assume its for Google maps only ?

    <script>
    jQuery(function() {
    if(typeof autocomplete != “undefined”){
    autocomplete.setComponentRestrictions({‘country’: ‘uk’});
    }
    });
    </script>

    Thanks and look forward to hearing from you.

    Ian

    #454759

    Guust
    Moderator
    Post count: 29970

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #454879

    Ian
    Expired Member
    Post count: 144

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

Viewing 3 posts - 1 through 3 (of 3 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket