Can PictureMarkerSymbol will be able to load image from Base64 string content instead of url?

1799
1
Jump to solution
03-20-2018 11:07 AM
UmeshManilal
New Contributor II
const weatherSymbol = {
type: 'picture-marker',
url: base64StringConent,
contentType: 'image/png',
width: '32px',
height: '32px',
yoffset: '24px'
};
Here my requirement is to load images which are received from back-end services (say REST service). Which will receive a base64 decoded string. Can we encode this value and assign to PictureMarkerSymbol for dynamic image generation?
0 Kudos
1 Solution

Accepted Solutions
UmeshManilal
New Contributor II

Found resolution, we can pass the data type (image) and format(png;base64) to the url property.

const weatherSymbol = {
type: 'picture-marker',
url: "data:image/png;base64," + base64ImageString,
contentType: 'image/png',
width: '32px',
height: '32px',
xoffset: -10,
yoffset: 24
};

View solution in original post

1 Reply
UmeshManilal
New Contributor II

Found resolution, we can pass the data type (image) and format(png;base64) to the url property.

const weatherSymbol = {
type: 'picture-marker',
url: "data:image/png;base64," + base64ImageString,
contentType: 'image/png',
width: '32px',
height: '32px',
xoffset: -10,
yoffset: 24
};