Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/429.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 避免googleplacesapi扩展边界_Javascript_Vue.js - Fatal编程技术网

Javascript 避免googleplacesapi扩展边界

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(

我正在使用goole places javascript API搜索边界内的设施,有时GooglePlaces会扩大其搜索半径,我想避免这种行为,这可能吗

我的搜索查询有一个边界字段(一对纬度坐标),我希望google places只在该边界内搜索。。。是否有类似旗帜或其他东西来避免这种行为

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
        
    },