mapbox-maps-ios
mapbox-maps-ios copied to clipboard
Create ImageSource from a UIImage without having to write to disk
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 thank you for bringing this to our attention. We will consider your request for adding this feature in a future version of v10.
@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?
+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.