Javascript 避免googleplacesapi扩展边界
我正在使用goole places javascript API搜索边界内的设施,有时GooglePlaces会扩大其搜索半径,我想避免这种行为,这可能吗 我的搜索查询有一个边界字段(一对纬度坐标),我希望google places只在该边界内搜索。。。是否有类似旗帜或其他东西来避免这种行为Javascript 避免googleplacesapi扩展边界,javascript,vue.js,Javascript,Vue.js,我正在使用goole places javascript API搜索边界内的设施,有时GooglePlaces会扩大其搜索半径,我想避免这种行为,这可能吗 我的搜索查询有一个边界字段(一对纬度坐标),我希望google places只在该边界内搜索。。。是否有类似旗帜或其他东西来避免这种行为 search() { const self = this; var bounds = new google.maps.LatLngBounds(
search()
{
const self = this;
var bounds = new google.maps.LatLngBounds(
new google.maps.LatLng(36.715289, -4.423523),
new google.maps.LatLng(36.717387, -4.422407)
);
self.placesService = new google.maps.places.PlacesService(self.map);
//var request = { placeId: 'ChIJN1t_tDeuEmsRUsoyG83frY4', fields: ['name', 'rating', 'formatted_phone_number', 'geometry']};
var request = { bounds: bounds, types: ['restaurant', 'bakery', 'cafe', 'food', 'meal_takeaway', 'bar', 'meal_delivery'] };
//const request = {query: "Restaurants in Malaga",fields: ["name", "geometry"]};
self.placesService.search(request, self.placesCallback);
//self.placesService.findPlaceFromQuery(request, self.placesCallback);
//places.getDetail
},