Start a new topic

Geolocation GPS position not working

Hi, 


I'm having an issue with the one of the sample wikitude projects "07_3dModels_6_3dModelAtGeoLocation". I manged to get the original project to run as it was using AR.RelativeLocation but when I changed it to use AR.Geolocation as the code below the 3d object doesn't show. My co-ordinates are correct and I've tried going outside to make sure nothing is blocking the signal but I can't get the object to show. I'm also using the free trial licences.


My code is below


Thanks

var World = {
loaded: false,
rotating: false,

init: function initFn() {
this.createModelAtLocation();
},

createModelAtLocation: function createModelAtLocationFn() {

/*
First a location where the model should be displayed will be defined. This location will be relativ to the user.

var location = new AR.RelativeLocation(null, 5, 0, 2);
*/
var location = new AR.GeoLocation(57.139060, -2.120925);
var altitude = location.altitude; //altitude = -32768

/*
Next the model object is loaded.
*/
var modelEarth = new AR.Model("assets/earth.wt3", {
onLoaded: this.worldLoaded,
scale: {
x: 1,
y: 1,
z: 1
}
});

var indicatorImage = new AR.ImageResource("assets/indi.png");

var indicatorDrawable = new AR.ImageDrawable(indicatorImage, 0.1, {
verticalAnchor: AR.CONST.VERTICAL_ANCHOR.TOP
});

/*
Putting it all together the location and 3D model is added to an AR.GeoObject.
*/
var obj = new AR.GeoObject(location, {
drawables: {
cam: [modelEarth],
indicator: [indicatorDrawable]
}
});
},

worldLoaded: function worldLoadedFn() {
World.loaded = true;
var e = document.getElementById('loadingMessage');
e.parentElement.removeChild(e);
}
};

World.init();

Hi,


Did you check if the correct user location is fetched during location updates? 


Greetings

Nicola

Hi, How would i check the user location is fetched?

You can check the details on how you work with location updates in the app in the documenation. You can then e.g. log the location to check if the values are as needed.


Thx and greetings

Nicola

Login or Signup to post a comment