FeatureLayer.addAttachment() not working with MapServer layers

04-30-2021 10:13 AM
New Contributor III

If I have a dynamic map service with feature access enabled, and the feature service has attachments enabled, a FeatureLayer object created from a layer in the MAP service will show that attachment capabilities are enabled. However, if I try to post a new attachment with the addAttachment() method, the API throws an error, so as a work-a-round, I have to grab the URL, replace 'MapServer' with 'FeatureService', create a new FeatureLayer object, and post the attachment.

If the FeatureLayer object is able to detect that the map service's associated feature service has attachment capabilities, should the object be able to know how to post attachments to that feature service?

Here's a console.log of the error that takes place inside the 4x API



0 Kudos
0 Replies