How to reload the pois?

90 views
Skip to first unread message

cherry

unread,
Sep 28, 2012, 3:41:11 AM9/28/12
to junaio-d...@googlegroups.com
I did this :

function handleSceneEvents(type, trackingInformation)
{
if(type && type == arel.Events.Scene.ONTRACKING && trackingInformation[0].getType() == arel.Tracking.LLA_MARKER)
{
//override the GPS of the device with the location encoded in the marker
var lla = trackingInformation[0].getContent();
arel.Scene.setLocation(lla);
//remove the scan information
$('.llaInfo').hide();
$('.filteroptions').show();
if (selected == "Lab"){
//set the POIs visible
arel.Scene.getObject("LeftArrow").setVisibility(true, true, true);
arel.Scene.getObject("T12A203/C").setVisibility(true, true, true);

}
else
if (selected  ==  "Lecture") 
{
arel.Scene.getObject("frontArrow").setVisibility(true, true, true);
arel.Scene.getObject("T12A203").setVisibility(true, true, true);
}
else
if(selected  == "Tutorial"){
arel.Scene.getObject("T12A202").setVisibility(true, true, true);
arel.Scene.getObject("T12A201").setVisibility(true, true, true);
}
else
if(selected  == "Toilet"){
arel.Scene.getObject("T12Toilet").setVisibility(true, true, true);
}
else
{
arel.Scene.getObject("LeftArrow").setVisibility(true, true, true);
arel.Scene.getObject("T12A203/C").setVisibility(true, true, true);
arel.Scene.getObject("frontArrow").setVisibility(true, true, true);
arel.Scene.getObject("T12A203").setVisibility(true, true, true);
arel.Scene.getObject("T12A202").setVisibility(true, true, true);
arel.Scene.getObject("T12A201").setVisibility(true, true, true);
arel.Scene.getObject("T12Toilet").setVisibility(true, true, true);
}
}
}
function activateChange(){
var f = document.getElementById("filter");
        selected = f.options[f.selectedIndex].value;
        alert(selected);
handleSceneEvents();
}

when the button is being submitted, i can see the alert prompt, showing the value that has been selected, but the unwanted pois do not disapper.
is there a way where i can clear the screen at let the pois reload?

Thanks!
Cherry.

Christin

unread,
Sep 28, 2012, 4:57:41 AM9/28/12
to junaio-d...@googlegroups.com
Hi Cherry, 

I think you have to set the other POIs (you do not want to be visible) to setVisibility(false,false,false). Or try using the methods "removePoi" and "addPoi"

Cheers, 
Christin
   
--
 
 
 

cherry

unread,
Sep 28, 2012, 11:52:47 AM9/28/12
to junaio-d...@googlegroups.com, terwe...@googlemail.com
Hi Christin,

I tried setting other pois as false, but it still does not refresh, as i can still see all the pois. =(
do you have an example of using the methods of remove poi?

Thanks!

Cherry.

Rainer Lonau

unread,
Sep 29, 2012, 6:03:33 AM9/29/12
to junaio-d...@googlegroups.com, terwe...@googlemail.com
Hi Cherry,

I've implemented show/hide functions in a LBS channel. Do something like this:
allObjects = arel.Scene.getObjects()

function show() {
for (var i in allObjects) {
       
if(allObjects[i] instanceof arel.Object) {
                allObjects
[i].setVisibility(true, true, true);
       
}
}
}

function hide() {
for (var i in allObjects) {
       
if(allObjects[i] instanceof arel.Object) {
                allObjects
[i].setVisibility(false, false, false);
       
}
}
}


I hope this helps.
Cheers,
Rainer

cherry

unread,
Oct 1, 2012, 3:03:04 AM10/1/12
to junaio-d...@googlegroups.com, terwe...@googlemail.com
Hi Rainer,

I have tried it, but it still wont work.
I also tried setting everything to false:

but it still cant remove the objects.

function hide() {
var f = document.getElementById("filter");
selected = f.options[f.selectedIndex].value;
arel.Scene.getObject("LeftArrow").setVisibility(false,false,false);
arel.Scene.getObject("T12A203/C").setVisibility(false,false,false);
arel.Scene.getObject("frontArrow").setVisibility(false,false,false);
arel.Scene.getObject("T12A203").setVisibility(false,false,false);
arel.Scene.getObject("T12A202").setVisibility(false,false,false);
arel.Scene.getObject("T12A201").setVisibility(false,false,false);
arel.Scene.getObject("T12Toilet").setVisibility(false,false,false);
}

function activateChange(){
alert(selected);
handleSceneEvents(type, trackingInformation);
}

currently, i am able to see the alert, that shows the selected value, however the objects does not clear.
by using your method, do we need to create an array?
i tried creating but there is still no change.

THanks!!

Cherry.

Rainer Lonau

unread,
Oct 1, 2012, 10:42:51 AM10/1/12
to junaio-d...@googlegroups.com, terwe...@googlemail.com
Hi Cherry,

sorry, right now I can't see where the error could be.
Does the setVisibility work in general? You could try hide a object in the onSceneReady function.
arel.sceneReady(function() {
       
try {
                arel
.Scene.getObject("T12Toilet").setVisibility(false,false,false);
       
} catch (err) {
                alert
('hide T12Toilet: '+err);
       
}
}

Cheers,
Rainer

cherry

unread,
Oct 1, 2012, 1:26:49 PM10/1/12
to junaio-d...@googlegroups.com, terwe...@googlemail.com
Hi Rainer,I tried putting 
arel.Scene.getObject("T12Toilet").setVisibility(true,true,true);
before i scan the marker, and 
arel.Scene.getObject("T12Toilet").setVisibility(false,false,false);
after i scan the marker, but it does not hide it after i scanned the marker.
does this mean that i am not able to set it invisible?

Thanks!
Cherry.
Reply all
Reply to author
Forward
0 new messages