Start a new topic

How to make some POIs disappear

How to make some POIs disappear


I am working on sample app nativedetailscreen. In my cam view lots of POIs are displayed. What I want to do is, when I click on one of them, I want the others disappear.I tried destroyAll method but it cleans everything including radar. After it cleans I tried to find a way to add radar and selected poi again but could not make it. 

I also tried to free the World.markerList and add the selected poi marker again but it did not do the job as well. Any idea ?

Thanks.

 

Have a look at the documentation of an AR.GeoObject

Setting yourGeoObject.enabled to false no longer renders it in the scene.
You may set it to true to let it reappear.

Therefore simply run thorugh all of the marker you like to hide and set their enabled attribute to false.

Best regards,
Andreas

When user click on a poi, poi detail panel become visible. And in that panel I have a button called "Go". When user click on this button, just before closing the panel I run the below for loop. I tried your solution but none of the POIs become invisible. My code:

for(var k=0; k<World.markerList.length; k++){
if(World.markerList.poiData.title!=nameOfSelectedMarker){
World.markerList.enabled=false;
}
}


 

Am I doing something wrong?

you have to modify the markerObject instead...
e.g.

 

onMarkerSelected: function onMarkerSelectedFn(marker) {

World.currentMarker = marker;


// disables all non selected markers

for(var k=0; k<World.markerList.length; k++){

   World.markerList.markerObject.enabled = ( World.markerList == World.currentMarker );

}


It worked thank you.
Login or Signup to post a comment