Start a new topic

ArGeoObject.isVisible problem

ArGeoObject.isVisible problem


Calling ArGeoObject.isVisible() like this 

if (marker.markerObject) {
if (marker.markerObject.isVisible()) {
console.log("visible");
}
else {
console.log("invisible");
}
}
else {
console.log("marker obj not find ");
}

 

and it throws an error. Error logs follows.

ReferenceError: Can't find variable: arObjectInterface

isVisible (architect.js, line 1)

?????? (marker.js, line 526)

forEach (, line 0)

onFinish (marker.js, line 524)

?????? (world.html, line 1)

 

so, what is the correct way of using isVisible()?

Hi aguan,

You are using isVisible in a correct way, there seems to be something else that causes troubles, we need to check internally.

What Wikitude SDK version, and what OS version / version number are you using?

Can you also send the code how you construct a marker and the marker.markerObject?

Thanks,

Martin

# PhoneGap Plugin Release Notes
## Plugin 3.0.0 (SDK 4.1.0)
### PhoneGap Plugin 4.1.0-3.0.0
Release Date: 09.03.15

 

OS viersion : IOS 8.3 

I just construct marker and marker.markerObject like sample way:

function Marker(poiData){

...

this.markerObject = new AR.GeoObject(this.markerLocation, {
drawables: {
cam: ,
radar: this.radardrawables,

onEnterFieldOfVision:function(){
console.log("onEnterFieldOfVision");
}
}
});
return this;
}

 

for (var dataIndex = 0; dataIndex < World.statusDataList.length; dataIndex++) {
var data = World.statusDataList;
World.markerList.push(new Marker(data));
}

 

Hi aguan,
Congratulations, you found a bug :)
The ARObject.isVisible() implementation is currently not working. We will fix this in an upcoming release.

A workaround right now would be to introduce a new boolean member variable in the Marker class and use the ARObject onEnterFieldOfVision & onExitFieldOfVision trigger to change the internal boolean state.

Thanks for reporting the problem!

Best regards

Andreas
Login or Signup to post a comment