I have been working on a WIKITUDE-Phonegap app. The application is a location based AR app that shows the markers on the camera view when tilting the phone arounnd (Displaying POI label) The license I have is Educational license so that the app I am developing doesn't have unlicensed watermark on it.
The problem I am having now is that I want to use my own latitudes & longitudes and description of places instead of the random ones that app generates. I did everything following the Documentation about retrieving the data from JSON file. However, when I built it to the device, the markers won't appear.
I am developing it on iOS 8.3 - Object-C based and test on iPhone 5. Anyone has the same problem? How to solve this?
Any answers will be appreciated. PS. excuse my English if you don't quite get what I tried to explain.
Thank you, Scott
1 person likes this
S
Simon 248601
said
over 8 years ago
Hi Scott,
could you please post your JSON file/data and the part where you load it.
Thank you and best regards, Simon
PS. Your english sounds just fine to me! :-)
S
Scott Intajak
said
over 8 years ago
Hi Simon,
Thank you for your quick reply :)
Here is my JSON file format look like.
var myJsonData = ;
Here is fromlocalresource.js code where I call the JSON data
// request POI data requestDataFromLocal: function requestDataFromLocalFn(lat, lon) { //var poisNearby = Helper.bringPlacesToUser(myJsonData, lat, lon); //World.loadPoisFromJsonData(poisNearby); /* For demo purpose they are relocated randomly around the user using a 'Helper'-function. Comment out previous 2 lines and use the following line > instead < to use static values 1:1. */ World.loadPoisFromJsonData(myJsonData); } };
/*var Helper = {
For demo purpose only, this method takes poi data and a center point (latitude, longitude) to relocate the given places randomly around the user
bringPlacesToUser: function bringPlacesToUserFn(poiData, latitude, longitude) { for (var i = 0; i < poiData.length; i++) { poiData.latitude = latitude + (Math.random() / 5 - 0.1); poiData.longitude = longitude + (Math.random() / 5 - 0.1); /*
Note: setting altitude to '0' will cause places being shown below / above user, depending on the user 's GPS signal altitude. Using this contant will ignore any altitude information and always show the places on user-level altitude
I have completely connected both files in index.html (in the ARChitect World subfolder called "5_ObtainPoiData_2_FromLocalResource") I hope this is enough for the diagnosis.
Thank you in advance, Scott
S
Simon 248601
said
over 8 years ago
Hi Scott,
ok I understand your problem better now. I tried your JSON Data with the same example you did, using the Helper function. All POIs did load just fine.
Do you also see the POIs if you use the helper function? Could it be that you are just not close enough to the locations if you do not use the helper function?
Best regards, Simon
1 person likes this
S
Scott Intajak
said
over 8 years ago
Hi Simon,
It works! OMG! You have no idea how many weeks I have been trying to fix this. You have just saved my life.
Thank you so much!
Anyway, there are 2 questions I would like to ask
1.) How can I integrate JSON data into the "Presenting Details" POI and Add the radar? 2.) can I change the Label to be HTML? I mean I read the documentation but I didn't quite get it.
Thank you so much for your precious answers! I do appreciate them.
Cheers,
Scott
O
One Day
said
almost 6 years ago
when I find the question,I am very happy,because I do same modify as your code.Today, I use the helper function after seeing the answer,but it also doesn't work,I donn't what's wrong with the code.
Hi scott and simon, I faced same problem as scott that POIs not displayed as per my json file. can you please tell me how you solve that problem? Share your file if possible.
Scott Intajak