mapbox-maps-ios icon indicating copy to clipboard operation
mapbox-maps-ios copied to clipboard

Create ImageSource from a UIImage without having to write to disk

Open mpiannucci opened this issue 3 years ago • 3 comments

New Feature

Allow ImageSource to set a UIImage instead of a Url for the image. Not all images are stored on disk or on a remote server.

Why

I am creating image layers on the fly, on device and there is no way to add them as a layer on the map. I attempted using a base64 string but that did not work. It’s much less efficient to have to round trip to a server or save the image to disk (they add up quick) if I don’t have to.

mpiannucci avatar Dec 31 '21 05:12 mpiannucci

@mpiannucci thank you for bringing this to our attention. We will consider your request for adding this feature in a future version of v10.

ZiZasaurus avatar Jan 04 '22 18:01 ZiZasaurus

@mpiannucci, would it be possible to use the addImage(_:Id:sdf:stretchX:stretchY:content:) API (which uses UIImage) to add your image layers to the map?

ZiZasaurus avatar Jan 24 '22 16:01 ZiZasaurus

+1 I would also like to see this feature. So far I saw updateImageSource - which works only after I add the ImageSource to the map with some url.

ngerdzhikov avatar Jul 07 '23 08:07 ngerdzhikov