Suggestions in the Locator Service

1231
2
Jump to solution
09-13-2016 07:07 AM
RafaelFernandez1
New Contributor III

Hi there,

I am trying to implement a ServiceLocator using QML (AppStudio). It works great in a general sense as you can see below:

ServiceLocator working with a local service

However I miss the suggestion property I used to have when I worked with the javascript API. I was having a look at the QML API but I am not able to see any word about suggestions.

Any clue?

Thanks,

Rafael Fernandez

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
nakulmanocha
Esri Regular Contributor

This is being implemented in the next major release "Quartz"

SuggestListModel QML Type | ArcGISQtQML Quartz 

Until then, the only option you have is to make a NetworkRequest to get the suggestions from the World geocoding service.

 property url serverURL: "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest?f=json&text=3&maxSuggest..."
    NetworkRequest { id: networkRequest
        url: serverURL
        responseType: "json"
        onReadyStateChanged: { if ( readyState === NetworkRequest.DONE ) { jsonText.text = JSON.stringify(response, undefined, 2); } else { jsonText.text = readyState; } }
          }

I haven't tried yet but you can make a new request onTextChanged signal 

View solution in original post

2 Replies
nakulmanocha
Esri Regular Contributor

This is being implemented in the next major release "Quartz"

SuggestListModel QML Type | ArcGISQtQML Quartz 

Until then, the only option you have is to make a NetworkRequest to get the suggestions from the World geocoding service.

 property url serverURL: "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest?f=json&text=3&maxSuggest..."
    NetworkRequest { id: networkRequest
        url: serverURL
        responseType: "json"
        onReadyStateChanged: { if ( readyState === NetworkRequest.DONE ) { jsonText.text = JSON.stringify(response, undefined, 2); } else { jsonText.text = readyState; } }
          }

I haven't tried yet but you can make a new request onTextChanged signal 
nakulmanocha
Esri Regular Contributor

Hi Rafael,

I have found a sample which demonstrates the custom implementation of  world geocoding suggestions request as I talked before.

I hope this helps.

Nakul

0 Kudos