【问题标题】:Google places autocomplete - adding custom result as last suggestion谷歌放置自动完成 - 添加自定义结果作为最后的建议
【发布时间】:2017-06-03 17:16:30
【问题描述】:

我正在使用 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);

这里的问题是“找不到您的位置?”选项在建议中随机排列。我希望它仅作为最后的建议出现在最后。像这样 -

【问题讨论】:

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


    【解决方案1】:

    经过大量搜索,似乎没有直接的方法可以做到这一点。我能做到这一点的唯一方法是修改 CSS 以便“找不到您的位置?”位于底部。这是我使用的 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;
        }
      }
    }
    

    【讨论】:

      猜你喜欢
      • 2017-02-21
      • 1970-01-01
      • 2017-09-05
      • 1970-01-01
      • 1970-01-01
      • 2018-09-15
      • 1970-01-01
      • 1970-01-01
      • 2017-02-01
      相关资源
      最近更新 更多