Hello,
How can I do it?
In context of InfoWindow
<img src=\"${Photo}\" />
not work...
What is the value of the "Photo" field? Is it a url? Is it a base64 encoded string?
If you could provide a sample that may help.
no, it is type "Raster" in ArcGIS.
in the REST I see this field as esriFieldTypeBlob. I found sample:
<img src="https://us.v-cdn.net/6038851/uploads/attachments/image_comment-654521-1.png" />
but image not display
You would need to convert your raster Blob data to base64 before you apply it to the image src as Rene suggests.
One way I have seen to do this on the client side is using the HTML5 canvas object. For example: javascript - How to get the right image data in base64 format using HTML5 canvas - Stack Overflow
Another option may be using the Dojo toolkit: dojox.encoding.base64 — The Dojo Toolkit - Reference Guide
(info from this post: How to read FieldTypeBlob from graphic.attributes).
Using the HTML5 canvas object will have compatibility issues with older browsers.
Encoding the Blob to base64 server-side is relatively simple but it looks like you need to do this on the client.
I read this post How to read FieldTypeBlob from graphic.attributes and I try this, but image not display (I wrote this above)
Oh, no... I was wrong... field type is esriFieldTypeRaster
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.