Generate image for Marker in runtime

I am using Charts and Maps addon to show some markers on Map. All images for markers are uploaded on our storage and each image has ots own url as it should be. So I can add image to marker simply with

   String s = "url-of-image";
    MarkerImage image = map.createMarkerImage(s);
    marker.setIcon(image);

It works fine. But now I have a situation when I need to generate these images in runtime. In details I should take several images from the storage by URL, combine them to one image and set this image to marker. So the problem is that I dont want to upload new image to storage, because I dont want to clog the storage by thousands of these new images. But this new image situated in my RAM doesn’t have a URL, so I can not attach it to marker\markerImage with code above. Is there any solutions of these problem? How can I add generated image from RAM to the Marker?

Hi,

I would recommend converting an image to base64 string and use it as URL, e.g.:

MarkerImage markerImage = map.createMarkerImage("data:image/gif;base64,[data]");

Regards,
Gleb