在剑道UI自动完成中使用Google Places API
Using Google Places API in Kendo UI Autocomplete
我试图在我的移动web应用程序中使用Google Places API (Places Autocomplete)在我的Kendo UI 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"
});
明白了!你甚至不需要剑道。
https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform相关文章:
- 在Chrome扩展内部输出Google API调用
- AngularJS&Google可视化-使用状态更改处理程序(Google API)在HTML页面上查看$sco
- 内容安全策略:无法在Chrome扩展中加载Google API
- Google API 的客户端库不会执行回调
- 在Cordova/Phonegap中使用Google API javascript
- 我应该在Google Api javascript中进行什么更改,以便它只能显示印度城市,而不能落后于州和印度
- 如何使用google-api-javascript-client或“Contacts API版本3.0”从gmail导入
- $http.获取和$http.JSONP未能获得Google API响应
- 从本地HTML / JavaScript(没有Web服务器)访问Google API
- 将PHP集成到Javascript中,使用Google API显示地图标记
- Access Control Allow Origin阻止我访问google api,尽管使用了dataType:
- 如何在js文件中使用Google API
- 使用JavaScript的Google API授权
- php中的google API javascript代码
- 是否可以调用Google API获取地图图像并将图像保存在某个位置
- 我可以将Google API的XML以字符串形式存储在Javascript中吗
- WinRT Javascript 应用程序中的 Google API OAuth 2.0
- 无法让 Google API 映射出现在 Javascript 中
- Google Api - Seperate Object - JavaScript
- Chrome Extension - Javascript Origins for Google API