var maxDistanceMeters = World.markerList.distanceToUser;
// return maximum distance times some factor >1.0 so ther is some room left and small movements of user don't cause places far away to disappear
return maxDistanceMeters * 1.1;
},
// request POI data
requestDataFromLocal: function requestDataFromLocalFn(lat, lon) {
// comment out these 2 lines and use 'World.loadPoisFromJsonData(myJsonData);' instead to use static values 1:1. For demo purpose they are relocated around the user
// var poisNearby = Helper.bringPlacesToUser(myJsonData, lat, lon);
World.loadPoisFromJsonData(myJsonData);
}
};
var Helper = {
bringPlacesToUser: function bringPlacesToUserFn(poiData, latitude, longitude) {
for (var i = 0; i < poiData.length; i++) {
poiData.latitude = latitude + (Math.random() / 5 - 0.1);
but when i debug, there's no marker POI come up, just camera live preview and the message tell me "trying to find out where you are"
of course i've turn on my GPS.
please advice
M
Martin Lechner
said
over 9 years ago
Hi Lilis,
In case you see that message over and over again, can you make sure you actually get a position (through GPS or network assisted)?
It is also possible that the script you've added (myJsonData.js) contains errors that causes the JavaScript execution to stop. Please try running your example in the ADE (see the documentation for details) and debug your code to understand if the objects are being generated successfully.
Best,
Martin
L
Lilis Sulistiyani
said
over 9 years ago
Hi Martin, thanks for your quick respone
When i run other samples, everything is going fine. Like 'from local source' I add new poi on myJsonData.js, and it can work perfectly
and when I add the myJsonData.js on 'presenting details' it's not work
i've try run ADE from my desktop browser, but actually i don't understand it, just show me trees of context and radar
So what I miss ?
Note: sorry I only understand a little English
M
Martin Lechner
said
over 9 years ago
Hi,
The ADE allows you to debug your code and check if you have JavaScript errors in it. In the right panel of the ADE, you can simulate locations (just enter the latitude and longitude and click "Apply"). You should see objects being created in the tree (the tree shows you what objects are in the scene). If not, you have an error in the JavaScript code.
You can open the developer console of the browser to check whether the JavaScript executes correctly. That depends of course on the browser you are using.
Best,
Martin
L
Lilis Sulistiyani
said
over 9 years ago
Hi Martin,
I got it
I've forgot to change requestDataFromServer to requestDataFromLocal
Steven Yeager