Hello,
I guess this is related to the user's location. Please have a look at the related SDK Samples and ensure that you generate the POIs after the first user location fires, and ensure to not load them on each location update by adding a variable like "latestPoiReloadLocation", or similar.
Also check the AR.context.cullingDistance. POIs that are too far away aren't rendered by default.
Some more hints around GEO AR experiences in the following:
* Visually indicate: fetching user location state and the fetching of POI data for the current position
* Indicate number of loaded POIs and consider use of the "indicator" drawable, so user can easily find out where to point the device at
* Use location.distanceToUser() to calculate the very latest distance and show it as part of the Marker info.
* Implement a "reload" mechanism, which allows the user to update the content on demand (e.g. after moving 100+ meters)
* Indicate when you see the need for a reload (delta to initial loading of POIs exceeds a predefined threshold, e.g. 100 meters)
* Consider the consumption POI data from an online source so you can maintain content without the need of an app-update. Either host a service which retrieves user's location as param or (depending on the # of POIs) store all POIs in a single JSON and filter them client side .
Hope this helps.
Best regards,
Andreas Fötschl
I do not understand why World.loadPoisFromJsonData after architectView.callJavascript call keeps complaining my latitude is not within -90, 90. I have checked it is confirmed within -90, 90.
2021-06-29 16:13:04.167 14080-14080/com.wikitude.sdksamples D/SimpleGeoArActivity: location.hasAltitude() 1
2021-06-29 16:13:04.168 14080-14080/com.wikitude.sdksamples D/SimpleGeoArActivity: JS Long = 103.XXXXXX lat = 1.XXXXXX ALT = 37.0
2021-06-29 16:13:04.185 14080-14080/com.wikitude.sdksamples D/Msg_box: onStop
2021-06-29 16:13:04.185 14080-14080/com.wikitude.sdksamples D/Msg_box: onDestroy
2021-06-29 16:13:04.209 14080-14080/com.wikitude.sdksamples I/Toast: Show toast from OpPackageName:com.wikitude.sdksamples, PackageName:com.wikitude.sdksamples
2021-06-29 16:13:04.238 14080-14080/com.wikitude.sdksamples I/chromium: [INFO:CONSOLE(1)] "Uncaught ARchitect Error: latitude is not in the valid range [-90, 90]<br /> at Object.create (https://www.wikitude.com/libs/architect.js:1:6989)<br /> at c.validateLatitude (https://www.wikitude.com/libs/architect.js:1:80516)<br /> at c.init (https://www.wikitude.com/libs/architect.js:1:78480)<br /> at c.<computed> [as init] (https://www.wikitude.com/libs/architect.js:1:4803)<br /> at new c (https://www.wikitude.com/libs/architect.js:1:4666)<br /> at Object.loadPoisFromJsonDataFn [as loadPoisFromJsonData] (file:///android_asset/samples/08_PointOfInterest_1_PoiAtLocation/js/poiatlocation.js:50:30)<br />", source: https://www.wikitude.com/libs/architect.js (1)
saveCoordinates: function saveCoordinatesFn(poiData)
{
var singlePoi = {
"id": poiData.id,
"longitude": parseFloat(poiData.longitude),
"latitude": parseFloat(poiData.latitude),
"altitude": parseFloat(poiData.altitude),
"description": poiData.description,
"title": poiData.name
};
World.loadPoisFromJsonData(singlePoi);
}
I am following this example and PoiDataFromApplicationModelExtension.java
I do not understand why the data is NaN following the examples mentioned above. JSON data is healthy.
2021-06-30 11:29:09.942 3873-3873/com.wikitude.sdksamples D/SimpleGeoArActivity: JS string info = [{"altitude":"37.0","latitude":"1.XXXXXX","name":"LOCATION#1","description":"Description for LOCATION#1","id":"1","longitude":"103.XXXXXX"}]
alert('ALT = ' + singlePoi.altitude + ' LAT = ' + singlePoi.latitude + ' LONG = ' + singlePoi.longitude);
World.loadPoisFromJsonData(singlePoi);
final JSONArray jsonArray = generatePoiInformation(loc);
architectView.callJavascript("World.saveCoordinates(" + jsonArray.toString() + ")");
Log.d(TAG, "JS string info = " + jsonArray.toString());
the document did not mention much to get it working, and there is no such example (SampleCamContentFromNativeActivity.java) to follow.
Hi Jay,
Could you please first answer the following questions:
Thanks,
Eva
Which version of the SDK are you using?
Jai>> 9.8.0, i mentioned.
What device does this happen with (model details and OS version)?
Jai>> Android 11, Xiaomi Mi 11.
Is this happening with the sample app or in your own app? If it happens with your own app, does the sample app work on your device?
Jai>> in my own app, the sample app got no such example.
I like to know can I change the following code?
architectView.callJavascript("World.loadPoisFromJsonData(" + jsonArray.toString() + ")");
to
architectView.callJavascript("World.Jaisenddata(" + jsonArray.toString() + ")");
Ghassen Abbes
Hello,
I'm working with Poi scripts in Android. I use a .setLocation() and it works fine but when i use .callJavascript() to calll the function loadfromjson, it runs and notices me "1 place loaded" but no marker displayed.
I really need help.
This is my codes :
architectView.setLocation(mLocation.latitude, mLocation.longitude, mLocation.accuracy.toDouble())
1 person has this problem