I hosted a points feature layer on Esri, and I want to pull information off from the feature layer and put it on my web map using Esri Leaflet and JavaScript. For a point with data like this: , I have 5 data rows and another attachment. I am able to pull off all the first 5 rows of data using the below sample pathname:
feature.properties.Name (gives the "Name" row, returns "Snow Condition")
This makes sense since the pathname matches with the GeoJSON file. I just have problems finding attachments, if anyone can give me a pathname to find where the attachment is saved, that will be appreciated.
Thanks in advance!
Solved! Go to Solution.
Have you tried looking at AttachmentInfo or AttachmentContent in the 4.x API?
If you'd rather work with the REST API, try getting the attachmentInfos for the feature service, then use the attachmentId of the applicable record and get the attachment (documentation says the content is streamed to the user).
Have you tried looking at AttachmentInfo or AttachmentContent in the 4.x API?
If you'd rather work with the REST API, try getting the attachmentInfos for the feature service, then use the attachmentId of the applicable record and get the attachment (documentation says the content is streamed to the user).
The ArcGIS API for JavaScript makes this easier, but if you're using something like Esri Leaflet...
To find the exact URL for the attachments you can use
queryAttachments -- see https://developers.arcgis.com/rest/services-reference/enterprise/query-attachments-feature-service-l...
For example using something like:
https://services1.arcgis.com/9NvE8jKNWWlDGsUJ/arcgis/rest/services/QuickCap_Data/FeatureServer/0/que...
Based on that response the URL to the attachment would be at
https://services1.arcgis.com/9NvE8jKNWWlDGsUJ/arcgis/rest/services/QuickCap_Data/FeatureServer/0/7/a...
Hi @HaowenRui
Can you please share an example on how do you got the attachment URL and used it on Leaflet L.esri.featureLayer bindPopup?
Thank you very much!
Best regards