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
D
Default
said
almost 11 years ago
Hi,
you will have to destroy the drawables and location as well
e.g. jsonObject.poiObject.destroy(); jsonObject.locObject.destory(); jsonObject.drawableObject.destroy();
D
Default
said
almost 11 years ago
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?
C
Christian Ebner
said
almost 11 years ago
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:
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
D
Default
said
almost 11 years ago
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
D
Default
said
almost 11 years ago
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?
D
Default
said
almost 11 years ago
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?
Christian