I am IOS developer and don`t much knowledge of HTML and Java script. I am posting my code which I am using. It will be good if you can guide me where i am wrong in the code so that i can overcome the issue which i am facing in the app.
function newData(jsonData)
{
AR.context.destroyAll();
//Radar Section
//
var radar = AR.radar;
radar.background = new AR.ImageResource("radar.png");
radar.positionX = 0.0; //0.7
radar.positionY = 0.0; //0.67
radar.width = 0.3;
radar.centerX = 0.5;
radar.centerY = 0.5;
radar.radius = 0.4;
radar.northIndicator.image = new AR.ImageResource("needleindicator.png");
radar.northIndicator.radius = 0.5;
radar.enabled = true;
radar.onClick = generateOnPoiBubbleClickFunc(10);
var radarCircle = new AR.Circle(0.05, {style: {fillColor: '#83ff7b'}});
// DirectionIndicator section
var indiImg = new AR.ImageResource("DirectionIndicator.png");
var indiDrawable = new AR.ImageDrawable(indiImg,0.1,{verticalAnchor: AR.CONST.VERTICAL_ANCHOR.TOP});
// current selected object
var selectedObject = null;
firstImage = new AR.ImageResource("simple-text-bar.png", {onError: errorLoadingImage});
secondImage = new AR.ImageResource("with-lock-text-bar.png", {onError: errorLoadingImage});
On a quick check of your code I don't see any major problems. But you should check the following:
How big are the used .png's and is it possible to use smaller images?
AR.Labels created for the pois additionally use up texture memory, thus reducing the amount of loaded POIs helps (e.g. filter on distance).
T
Taler N
said
almost 10 years ago
hi,there
thanx for your wonderful codes,AND i just need more image loading guide . Can someone give me some advice?
W
Wolfgang Damm
said
almost 10 years ago
thanks. I'll try to quickly summarize a few things:
1. Check the size of your images (e.g. don't use huge images that will only take up a small part of the screen). Generally I would suggest staying below 512px or even 256px for POI assets (for IR overlays 1024px)
2. Check the number of your images.
Loading images only when they are needed (e.g. don't load all thumbnails if there is only a slight chance of them being visible to the user)
Use only 1 AR.ImageResource for the same image (e.g. POI background should be loaded once by creating one AR.ImageResource)
Call .destroy() on image not needed anymore, this will free up memory
Abhishek Goyal