Google会自动填充 - 添加自定义结果作为最后的建议

时间:2017-01-19 05:35:22

标签: google-maps google-maps-api-3 google-places-api google-places

我使用Google地方自动填充功能为用户显示位置建议。我已使用以下代码向自动填充建议添加了自定义结果 -

$timeout(function(){
                    var el = angular.element('<div id="cantFind" class="pointer m-b-5">Can\'t find your location?</div>');
                    angular.element(".pac-container").append(el);
                    el.bind("mousedown", function() {
                        $scope.setEnterManualView(true);
                    });
                }, 2000);

这里的问题是&#34;无法找到您的位置?&#34;选项随机出现在建议中。我希望它最后只作为最后的建议而来。像这样的东西 -

enter image description here

1 个答案:

答案 0 :(得分:1)

经过大量搜索后,看起来没有这样直接的方式来做到这一点。我能做到这一点的唯一方法就是修改CSS,以便&#34;无法找到你的位置?&#34;在底部。这是我使用的CSS:

Posts