Logicify / jquery-locationpicker-plugin

JQuery Location Picker plugin
MIT License
389 stars 260 forks source link

componentRestrictions #75

Closed ajarti closed 8 years ago

ajarti commented 8 years ago

Hi all, Any way to easily add componentRestrictions to the geocode?

I need to restrict the lookup country.

Any help appreciated.

Sumragen commented 8 years ago

@ajarti hi! Now it simply, just write your preferences like that

$('#mapId').locationpicker({
   location: {
      latitude: 46.15242437752303,
      longitude: 2.7470703125
   },
   inputBinding: {
      locationNameInput: $('#nameInputId')
   },
   enableAutocomplete: true,
   autocompleteOptions: {
      types: ['(cities)'],
      componentRestrictions: {country: 'fr'}
   }
});

P.S. need to wait when my commit will be merged with master branch

ajarti commented 8 years ago

@Sumragen sorry for the late reply, many thanks for the feedback, much appreciated!