Start a new topic

Delete GeoObject in WTSimpleARBrowser example

Delete GeoObject in WTSimpleARBrowser example

Hi,

what is the best way to delete (=remove from screen) a GeoObject in the WTSimpleARBrowser example? In this example, GeoObjects are assigned to an array jsonObject. However, neither

                   jsonObject.poiObj.destroy();

nor

                   jsonObject.splice(id,1);

seems to do the job.

Best regards,
      Christian
Hi,

you will have to destroy the drawables and location as well

e.g.
jsonObject.poiObject.destroy();
jsonObject.locObject.destory();
jsonObject.drawableObject.destroy();
Okay, I tried:
                    jsonObject.poiObj.destroy();
                    jsonObject.geoLoc.destory();
                    jsonObject.img.destroy();
still, this does NOT remove the GeoObject from the browser view :-(. Any hints?
Hello,
I just had a closer look at the WTSimpleARBrowser example. Here the jsonObject is an Array.
If you want to delete an object then you have to know the index of this object and delete it:

eg (index 2):jsonObject.poiObj.destroy();
jsonObject.arLabel.destroy();
jsonObject.img.destroy();

If you want to destroy the GeoLocation, you get an array of locations (in this case an array with just one location inside) from the GeoObject. Then you can destroy it:jsonObject.poiObj.locations.destroy();
Please tell me if I could help you with this.
And sorry for the late replay.
-- Chris
I just had a closer look at the WTSimpleARBrowser example. Here the jsonObject is an Array.
If you want to delete an object then you have to know the index of this object and delete it:


This actually is a "bug" in the forum. When using copy & paste, jsonObject(i) gets trimmed to jsonObject ;-). Okay, I see - I cannot even type brackets... What kind of forum software do you use?


If you want to destroy the GeoLocation, you get an array of locations (in this case an array with just one location inside) from the GeoObject. Then you can destroy it:jsonObject.poiObj.locations.destroy();


This is exactly what I was looking for, i.e. it solves the problem. Thanks a lot for your kind support!

bye
Christian
This actually is a "bug" in the forum. When using copy & paste, jsonObject(i) gets trimmed to jsonObject ;-). Okay, I see - I cannot even type brackets... What kind of forum software do you use?
This actually is a "bug" in the forum. When using copy & paste, jsonObject(i) gets trimmed to jsonObject ;-). Okay, I see - I cannot even type brackets... What kind of forum software do you use?
dgdsagasdfasdfds
json
Login or Signup to post a comment