Pregunta

I have troubles to set the location inside architectView in Wikitude SDK, below is the code snippet in short:

public class myArchitectActivity extends Activity{

    protected ArchitectView architectView;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.samplecam);

        architectView = (ArchitectView) findViewById(R.id.architectView);
        final ArchitectConfig config = new ArchitectConfig(elecompARKey);
        architectView.onCreate(config);

        architectView.setLocation(20.471556, 72.871284, 10f); // this thing is not working
    }
}

ISSUE: As per the wikitude samples architectView.setLocation() method is used inside a location listener class in onLocationChanged() method. Works perfectly over there. But I don't want to fetch the current location instead set location to virtual place co-ordinates.

If I do set architectView.setLocation(virtual_lat, virtual_lng, virtual_alt) inside the onLocationChanged() method it still work. But I need to request location update which is unnecessary cos I'm not using the location update.

I just want a solution for not requesting location update and setting the virtual location for Architecture view.

¿Fue útil?

Solución

Wikitude SDK view accept location-updates once set-up properly.

Please call architectView.setLocation(latitude, longitude, altitudeMeters, accuracyMeters) in onPostResume() of your Activity (use 3 arguments in case you don't have any altitude information. Use value >0 for faked accuracy).

You may even create a Thread or AsyncTask in case you want to periodically inject fake location (e.g. add some random lat/lon values to a fixed center point every x seconds).

Kind regards, Andreas

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top