JQuery provides a number of tools to load data from a remote origin.
It is highly recommended to use the JSON format for POI information. Requesting and parsing is done in a few lines of code.
Use e.g. 'AR.context.onLocationChanged = World.locationChanged;' to define the method invoked on location updates.
In this sample POI information is requested after the very first location update.
This sample uses a test-service of Wikitude which randomly delivers geo-location data around the passed latitude/longitude user location.
You have to update 'ServerInformation' data to use your own own server. Also ensure the JSON format is same as in previous sample's 'myJsonData.js'-file.
*/
// request POI data
requestDataFromServer: function requestDataFromServerFn(lat, lon) {
// set helper var to avoid requesting places while loading
World.isRequestingData = true;
World.updateStatusMessage('Requesting places from web-service');
Please ensure that the format of the JSON in the dummy service is same as in your own service and your service is setup properly (e.g. CORS settings). Also add logging informations to the experience and use remote webview debugging to figure out what the issue is. The reason of "Requesting places from web-service" being shown is most likely a syntax or runtime issue.
Best regards, Andreas
P
Pierre Addoum
said
almost 7 years ago
Hello,
There was indeed a syntax issue, sorry for distrurbing you with trivial bug.
Pierre Addoum