Start a new topic

Showing POI name when in focus on camera view

Showing POI name when in focus on camera view


Hi,

I wanted to show name of my point of interest in the status div at bottom of the camera view, once the poi get in focus or it's in some action area?

Is there any way to do it with wikitude?  I am not sure, If ActionArea or ActionRange is the right option to achive this behaviour?

Any help is apprecieated...

Thanks..

Hi there!

As far as I understood, you like to update the label in an HTML div once geobased content is shown in your camera (compare POI samples in the SDK samples app).


The mentioned AR.ActionArea or AR.ActionRange would cover a "display country/region/village I am currently in" rather than your POI scenario.

I recommend you to use POI markers as in the Sample application but implement the onEnterFieldOfVision and onExitFieldOfVision methods of the AR.GeoObject (Marker). That way you can update a div once the marker is visible in the camera. Note: In case there is more than one marker visible all will fire, so don't forget to handle this.


Kind regards,
Andreas

Hi Andreas,

Thanks for your answer. I am able to implement onEnterFieldOfVision and onExitFieldOfVision methods, but I want to update the div when POI comes in center of the camera view.

Not just in vision. 

Is there any other way to do so??

Thanks,

Nisha

Hi there,

This feature is yet nothing that comes out of the box in the Wikitude SDK.
You may workaround this issue by auto-clicking the center of the screen manually and react in AR.GeoObject's onClick-function.

Find snippet attached. Note: This workaround calls internal Wiktiude SDK JS code that may not work on future SDK releases.

Kind regards,
Andreas

 

Hi Andreas,

I can not click mannually on the screen. I should be able to show POI details automatically when it comes in center of the screen.

Please help.

Thanks,

Nisha

Hi again,

Manually in this case means: "programatically". The snippet above auto-triggers a click on the center of the screen every 0.5 second.

Kind regards,
Andreas

Thanks Andreas,

I was able to use the snippet and that invokes click event of geo object.

But, currently, I have a panel showing up on click of that geo object. Now with this implementation, that panel automatically shows up, as the snippet invokes onClick.

Can I control that? Can I pass some parameter or something when I invoke AR.js.click.executePlatformClick(event);??

Thanks a lot,

Nisha

Hi there!

You may define a global "fake-click"-flag which is set when you fire the auto-center-screen click and reset it after e.g. 30ms. When handling the onClick in your AR.GeoObject you can check the global "fake-click"-flag and decide whether to ignore it or not.

Kind regards

Hi Andreas,

I can not use this global variable for fake click. As my onclick function gets executed every 1 second and the flag turns true, so many times when I click on POI the flag still remains true and I don't get my detail panel.

This solution is fleaky. Is there any way I can know that this click is a fake click??

Please help.

Thanks,

Nisha

Hi again,

Please increase the fake-click-rate and decrease the flag-reset-timeout - this should avoid conflicting real and fake clicks.

As an alternative approach you can use onEnter- and onExitFieldOfVision of AR.GeoObject to find out which markers are in the visible area.
You can then select the closest one by default and provide  "right" and "left" button to iterate through them (using distance value or angle to user).

Kind regards,
Andreas

Hi Andreas,

sorry but I am not able to follow your following input

"You can then select the closest one by default and provide  "right" and "left" button to iterate through them (using distance value or angle to user)."

What do you mean with this?

Thanks a lot,

Nisha

Hi Nisha,

As Andreas is on vacation currently, I will take over, following up with the conversation you had with Andreas already.

What he meant was that you can find out what POIs are currently in the field of vision of the camera view, using onEnter/ExitFieldOfVision of the GeoObjects.

Then, you need to provide some kind of navigation through the POIs for the user to select the most central one, and Andreas suggested to provide a left/right button to navigate through the POIs in the field of vision for that purpose.

Best,

Martin

Hi,

What modification is required in order to invoke the click event of geo object.

I have tried the snippet for auto click in case of drawable displayed on top of target image.

I am attaching my piece of code. Please suggest if i am doing it wrong.
Login or Signup to post a comment