繁体   English   中英

谷歌地图放置API->区域类型不起作用

[英]google map places api -> the region types not working

Google Map Places API无法与区域一起使用

    // Define options
    $scope.autocompleteOptions = {
    types: ['regions'],
    componentRestrictions: {country:'aus'}
    };

但是api使用地址... 我不明白我在想什么?

 $scope.autocompleteOptions = {
        types: ['address'],
        componentRestrictions: {country:'aus'}
        };

您必须包括括号:

$scope.autocompleteOptions = {
types: ['(regions)'],
componentRestrictions: {country:'aus'}
};

'(cities)'也是如此

https://developers.google.com/places/supported_types#table3

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM