Start a new topic

Updating already displayed POI

Updating already displayed POI


Hi,

Is it possible to update already visible and displayed POI? I want to respont to some events, e. g. additional data about POI becomes available, which I want to display near POI/ update POI icon etc. Additinaly, is it possible to display some "raw text" near POI icon?

Thanks,

Branimir

hi!

Please have a look at the Wikitude ARchitect SDK Documentation.

You may use e.g. an AR.Label for that and update text-property.

Kind regards,
Andreas

Andreas,

thank you for your answer. I still can't figure out how to update properties of a label.

http://www.wikitude.com/external/doc/alr/Label.html -> AR.Label gives no methods like "setText()" or similar to update Text field of displayed Label.

So, I passed array of JSONObjects from native android app to ARchitect engine, and displayed them successfully. I attached a label to each POI using:

X= new AR.Label("Test", 0.5, {offsetY : -1.5, offsetX : 2.5,
                            style : {textColor : '#FFC100',backgroundColor : '#FFFFFF80'}});

poidrawables.push(X);

and it works fine. How can I access first property in X? If I manage to edit it, how can I notify ARchitect engine to refresh view on device?

I hope you got what I meant to say :)

Kind regards,

Branimir

Hi Branimir!

You can change AR.Label's attributes by direct access using e.g. myLabel.text = "my new label text"

Hope that helps.

Kind regards,
Andreas

Andreas,

thanks again for your answer and effort. With your guidance, I managed to solve my problem :)

Best regards,

Branimir

Hi, everyone. Sorry for bringing up this issue again.

 

I can't figure out how to update already displayed POIs. Assuming the SimpleARBrowser example that comes with Wikitude SDK, if I create a method called "updateData()" in the ARchitectBrowser.html similar to "newData()", how can I access and modify all the POIs being displayed? I read in one of the comments inside ARchitectBrowser.html that the jsonObject array "keeps jsonData received from the native app" but I can't update the changes made inside it.

 

Thanks in advance. Best regards.

 

Leandro

Hi Leandro,

When reloading POI data you may either update lablels and information of existin places in case you e.g. just want to update POI title or destroy existing placemarks and recreate new ones.

There is documentation in how to properly destroy GeoObjects, you can afterwards simply recreate them.
I recommend you to define a clear-function that wipes all AR content and call it as first line in your newData-function, that way you can easily update your data.

Please also keep in mind, that radar-component will also be destroyed when calling AR.context.destroyAll(), so you may need to redefine the radar.

Hope that helps.

Kind regards,
Andreas

Thanks for your help, Andreas! 

Best regards,

Leandro
Login or Signup to post a comment