Google 个位置自动完成 - 添加自定义结果作为最后建议
Google places autocomplete - adding custom result as last suggestion
我正在使用 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);
这里的问题是 "Can't find your location?" 选项在建议中随机出现。我希望它只作为最后的建议出现在最后。像这样 -
查了很多,好像没有这么直接的方法。我能做到这一点的唯一方法是修改 CSS,使 "Can't find your location?" 位于底部。这是我使用的CSS:
.location-autocomplete-container{
&:after{
padding-top:47px;
}
.cant-find-location{
font-size: 13px;
position:absolute;
width: 100%;
bottom:16px;
left:0;
i{
font-size: 1.2em;
margin-right: 5px;
}
}
}
我正在使用 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);
这里的问题是 "Can't find your location?" 选项在建议中随机出现。我希望它只作为最后的建议出现在最后。像这样 -
查了很多,好像没有这么直接的方法。我能做到这一点的唯一方法是修改 CSS,使 "Can't find your location?" 位于底部。这是我使用的CSS:
.location-autocomplete-container{
&:after{
padding-top:47px;
}
.cant-find-location{
font-size: 13px;
position:absolute;
width: 100%;
bottom:16px;
left:0;
i{
font-size: 1.2em;
margin-right: 5px;
}
}
}