Start a new topic

wikitude.setLocation not firing AR.context.onLocationChanged?

I'm using wikitude.setLocation to inject location provided by 3rd party positioning service.

I'm doing this:

wikitude.loadARchitectWorld(function (url) {
	window.positionService.onchange = function (position) {
		alert(position.latitude + ',' + position.longitude + ',' + position.accuracy);
		wikitude.setLocation(position.latitude, position.longitude, position.altitude, position.accurary);
	};

and this:

AR.context.onLocationChanged = function (latitude, longitude, altitude, accurary) {
	AR.context.onLocationChanged = null;
	alert(latitude + ',' + longitude + ',' + accuracy);

but it turns out that AR.context.onLocationChanged does not follow immediately after location update, and the alert shows that the value received is different from the value provided by the positioning service, so I guess the mechanism is simply not working and wikitude is using location from GPS.

Am I doing wrong?

I'm using Cordova plugin 5.1.4.


Hi Jack,

The snippet I wanted to send you is the one you posted the last time. Sorry for the delay.


Can you help me one more time in answering the following? Is the delay between the Architect World and the Cordova application - between the Cordova application and the Wikitude Plugin - between the Wikitude Plugin and the Wikitude SDK or inside the Wikitude SDK?


Best regards,

Andreas

Hi Jack,

Our last responses overlapped :) My last message was referring to the one from Feb 28, 10:40 AM.

Hi Jack,

You should be able so specify the accuracy in the Wikitude Cordova plugin JS API. The Android plugin tries to read it in line 410 - 426.


Best regards,

Andreas

Andreas,

410-426 is code for ACTION_CALL_JAVASCRIPT in v5.1.4 cordova plugin code, so I guess you are mentioning the code above it, which is the lines I pasted in my last post, specifically:

 

WikitudePlugin.this.architectView.setLocation( lat, lon, altitude, accuracy.floatValue() );
Seems it should work, however I'm always receiving 1, regardless of what I set in WikitudePlugin.setLocation. Maybe I'm making mistakes elsewhere, I'll try to repro it in a small demo.
Thanks!
Login or Signup to post a comment