Hi!
This post deals with a similar topic.
You have to trigger the .destroy()-function to clean the memory. Also consider recycling existing POI drawables by updating the label text and just replace the image representation (ImageDrawable).
Hope this helps.
Best regards,
Andi
Hi guys, I'm from the same team.
The above link to updating the label text was quite helpful. Referring to it I found the following documentation:
// Destroy and remove existing drawables markerObject.drawables.cam[index].destroy(); markerObject.drawables.removeCamDrawable(index); // Add the new drawables markerObject.drawables.addCamDrawable(updatedDrawable, index);
It didn't work quite as expected as the new drawables were not being added to the specified position. I debugged the issue and into Architect.js itself and found a issue in the implementation where the provided index is directly checked in a condition statement and if provide with 0 coerces it to be a falsy value. The issue can be found here:
__addDrawable: function(a,b,c,d) { if(b==_PROPERTY_VALIDATOR.validate("drawable,b,{type:_PROPERTY_VALIDATOR.TYPE.ARRAY_OR_PROPERTY,ofType:d}, _PROPERTY_VALIDATOR.RULE.CAN_BE_EMPTY),c) { ... } ... }
variable 'c' in above code is the index at which to insert the new drawable and the condition fails if it's value is 0. The condition should instead be:
__addDrawable: function(a,b,c,d) { if(b==_PROPERTY_VALIDATOR.validate("drawable,b,{type:_PROPERTY_VALIDATOR.TYPE.ARRAY_OR_PROPERTY,ofType:d}, _PROPERTY_VALIDATOR.RULE.CAN_BE_EMPTY),c!=undefined) { ... } ... }
Best Regards,
Huzaifa
Yogendra Girase
Hi,
I'm developing an iOS app with 2 screens:
And in the World.loadPoisFromJsonData(jsonData) method I always set the World.markerList = [] and then iterate over the new data and create new markers as in the example code.
However I can see that each time this code runs new set of Markers are generated in the view and the old ones are not removed this leads to steady increase in the memory used by the app leading to ultimately freezes the app itself. Please guide me as to how: