locality and establishment not working in google map -
i have options autocomplete google map search when added locality , types wont work.
var options = { types:['school'], componentrestrictions: { locality:'caloocan', country: 'ph'} };
based documentation, componentrestrictions can used restrict results specific groups. currently, can use componentrestrictions filter country. country must passed as two-character, iso 3166-1 alpha-2 compatible country code.
here example documentation
var input = document.getelementbyid('searchtextfield'); var options = { types: ['(cities)'], componentrestrictions: {country: 'fr'} }; autocomplete = new google.maps.places.autocomplete(input, options);
i think locality part of code made errors. because stated in documentation "in general single type allowed".
and (cities) type collection instructs places service return results match either locality or administrative_area3
try check parameter can use code.
Comments
Post a Comment