Pasteur Miranda
Posts: 0
Joined: Thu Aug 01, 2013 2:59 am

How to embed an image inside the app

Hi,

My app have some images that I wouldn't like to be loaded from web (for instance, I have some icons and images that are shown inside google maps (markers) and in lists). Is there any way to "embed" the image inside the app so that the images does not have to be loaded from internet (Loading from internet decrease the performance of my application. For instance, in google maps, if i have many markes to be showm, all of then shoud be loaded from internet, same problem if I have many items to be shown in a list).

Code: Select all

Thank you
Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to embed an image inside the app

Hello! You would need to upload images to assets first. Then your code for markers should look something like this:
pre var myOptions = {
zoom :8,
center: new google.maps.LatLng(37.63, -122.424),
mapTypeId: google.maps.MapTypeId.ROADMAP
};

var map = new google.maps.Map($('div[dsid="googlemap1"]').get(0), myOptions);

//San Francisco, with custom marker
var sfLatlng = new google.maps.LatLng(37.775, -122.4183333);
var marker = new google.maps.Marker({
position: sfLatlng,
map: map,
title: "San Francisco",
icon: Appery.getImagePath("imageName.png")
});/pre
take a look at the last line

Pasteur Miranda
Posts: 0
Joined: Thu Aug 01, 2013 2:59 am

How to embed an image inside the app

Thanks Marina,

Code: Select all

Sorry but I could not find in the app builder where to upload images to assets. Could you help me? 

Thanks

Pasteur Miranda
Posts: 0
Joined: Thu Aug 01, 2013 2:59 am

How to embed an image inside the app

Thanks Marina,

Code: Select all

I understood that the only way to upload images to asset is opening an image widget and access media manager from there. Is there another way? 

Thank you

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to embed an image inside the app

There is not for now, but we'll add an option to do that without using Image component.

Return to “Issues”