Start a new topic

Image load lag in ARchitect

Image load lag in ARchitect


Hi , thanks for the great sdk , I'm facing a problem which is my images which I define in :

myMarkerDrawable : new AR.ImageResource("assets/drawable.png"),

load with a considerable lag . Images are about 5k in size and are 512*256 in resolution . I'll appreciate if you can help me with a tip or trick to reduce this loading time and lag . 

thanks very much

 

How much time does it take to show up? If you loading it over the network it of course depends on the network speed, thus it could make sense to store it locally.

Additionally you can play with when the image is created. E.g. create needed images right at startup should speed things up for when you later create and show an imagedrawable. It might also help to know when an image finished loading. To do this use its onLoaded trigger.

Thanks, I load images locally . it takes about 15 to 30 seconds to load the images . when ARchitect world loads I see the description and title but no images , and after about 15 to 30 seconds the images start to appear . 

that should not happen. Can you give us more information on what is done during startup? Are there any other resources you are loading? How many and in what order?

If possible a look at your source code helps as well.

Thanks , I have just modified "MultiplePOis" sample . I suspected about some of other apps slowing my phone , I'll test the app on other phones and see if the problem still exists . although the idea of loading a simple image before every other source is loaded seems to be a very good idea .

thanks so much

The problem isn't fully solved but some of the lag was caused by repeatedly defining poiData variable , like this :

        var poiData = {

            "latitude": lat,

            "longitude": lon,

            "altitude": altitude,

            "title": "Marker 0",

            "description": "Description 0",

            "myVar": 0

        };

        World.markerList.push(new Marker(poiData));

 

        var poiData = {

            "latitude": lat1,

            "longitude": lon1,

            "altitude": altitude,

            "title": "Marker 1",

            "description": "Description 1",

            "myVar": 1

        };

        World.markerList.push(new Marker(poiData));

Let me know if you need further assistance. I would also be happy to quickly look over your source code to suggest possible improvements.
Login or Signup to post a comment