Right now, it seems that adding an image overlay requires an image url
"overlay": {
"type": "image",
"url": "https://www.mapbox.com/mapbox-gl-js/assets/radar.gif",
"coordinates": [
[-80.425, 46.437],
[-71.516, 46.437],
[-71.516, 37.936],
[-80.425, 37.936]
]
}
However, what if i have the image as a base64 string, is that anyway i can add it rather than from a url?
thanks
i managed to get this to work using
img = new Image
img.src = "data:image/png;base64," + image
img.onload = (e) ->
map.addSource('image', {
coordinates,
type: 'image'
url: "data:image/png;base64," + image
})
maybe useful to add this to documentation?
Most helpful comment
i managed to get this to work using
maybe useful to add this to documentation?