Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
25
igCombo with googleapis
posted

Hi, I wounder if there is a way to get cities from googleapis.

$("#selectLocation").igCombo({
loadOnDemandSettings: {
enabled: true,
pageSize: 25
},
autoComplete: true,
requestType : "get",
filteringType: "remote",
responseDataKey: "predictions",
valueKey: "description",
textKey: "description",
itemTemplate: "${description}",
width: "100%",
height: "48px",
dataSource: 'https://maps.googleapis.com/maps/api/place/autocomplete/json?key=xxxxx&types=(cities)&language=sv&region=se&input=??????',
responseDataType: "json",
placeHolder: "City"

});

Google needs the "input" parameter to return search results

Example:

GetRequest: https://maps.googleapis.com/maps/api/place/autocomplete/json?key=XXXX&types=(cities)&language=sv&region=se&input=karl

Returns:

{
  "predictions": [
    {
      "description": "Karlskrona",
      "id": "df1ab6dd7852b9cef64ca81e91291e80b9d01840",

SO THE QUESTON:

How to add the input parameter in the  generated get request, or is there another way of getting cities into igCombo from google apis?

Br,

Peter