Start a new topic

Overlapping the POI

Overlapping the POI


I have read some previous forum posts already, I tried to set the singlePoi.altitude in Random number between -50 -> 50, but it dones't have any effect.

The POI marker is overlapping if they are on same direction (angle). 

I want to display the overlapped marker higher.

Thanks.

Besides, there is another question.

If I want to move the POI object from back to top of all others POI, then how do that?

In the function
Marker.prototype.getOnClickTrigger = function(marker) {

How to change the object zOrder?

Thanks.

 

Hi Frederick,

The altitude parameter can only be considered if you have a GPS signal that is good enough to deliver reliable altitude values. In case the GPS signal is not good enough on the vertical axis, altitude is disabled (since there is no indication in what altitude the user currently is).

To avoid this, you can use RelativeLocation, which allows you to set an altitude relative to the user's current altitude. This way, the GPS signal is irrelevant, however, you also need to supply relativ positions (northing and easting).

To send a POI object to the front, use ARObject.renderingOrder, which gives you full control over what POI object should be drawn on top of others. In case you have multiple Drawables attached to the ARObject, you can specify the drawing order within the ARObject using Drawable2D.zOrder.

Best,

Martin

Hi Martin,

Understand the altitude problem. 

Besides, would you mind giving some example how to use the "renderingOrder" ?

In the samples, where need to be updated in the marker.js?

Thanks.

 

Hi Frederick,

You could use a private variable in your World, highestRenderingOrder, and initialize it with 0.

Once a GeoObject is clicked, you need to set the renderingOrder of the GeoObject to the highest value + 1.

In the geoObject's onClick method, you can do something like this:

onClick(){

  this.renderingOrder = ++highestRenderingOrder;

}

This way, the renderingOrder will always be the highest value as soon as a geoObject is clicked (assuming you don't click so many times that the highestRenderingOrder creates an overflow, which will be practically impossible anyways).

Best,

Martin

Hi Martin,

Please take a look at line 95, I am not sure is it correct, but it doesn't work.

Thanks.

Hi Frederick,

It's semi-correct actually :-)

You need to set the renderingOrder on the GeoObject, so line 95 should read something like marker.markerObject.renderingOrder = ++highestRenderingOrder;

Best,

Martin
Login or Signup to post a comment