【问题标题】:Using Google Places API in Kendo UI Autocomplete在 Kendo UI 自动完成中使用 Google Places API
【发布时间】:2014-05-29 02:06:47
【问题描述】:

我试图在我的移动网络应用程序的Kendo UI Autocomplete 中使用Google Places API (Places Autocomplete),但我很难找到有关如何执行此操作的教程。

现在这就是我所做的......

        requestUrl = "https://maps.googleapis.com/maps/api/place/autocomplete/json";

        var dsLocations = {
            serverFiltering: true,
            type: "odata",
            transport:
            {
                read: {
                    url: requestUrl,
                    dataType: "json",
                    contentType: "application/json",

                },
                parameterMap: function (options, operation) {
                    var paramMap = kendo.data.transports.odata.parameterMap(options);
                    delete paramMap.$inlinecount; 
                    delete paramMap.$format; 
                    return paramMap;
                }
            },
            schema: {
                data: function (data) {
                    return data;
                },
                total: function (data) {
                    return data.length;
                },

            },
        };

        $("#autocomplete-locations").kendoAutoComplete({
            dataSource: dsLocations,
            minLength: 3,
            filter: "contains",
            dataTextField: "TextForSearch",
            dataValueField: "TextForSearch"
        });

【问题讨论】:

  • 我看到了代码,但没有看到问题。有什么问题?
  • 不行! :) --- 我的问题是如何在 Kendo Autocomplete 中使用 Google Places。我所做的是如何使用自定义 web api 做到这一点。

标签: javascript ajax web kendo-ui google-places-api


【解决方案1】:
猜你喜欢
  • 2014-05-01
  • 2013-10-10
  • 1970-01-01
  • 2015-06-05
  • 1970-01-01
  • 2017-10-02
  • 1970-01-01
  • 2022-06-19
  • 1970-01-01
相关资源
最近更新 更多