Saving a geometry from a standalone ESRI javascript app to a WebMap

404
0
02-05-2021 05:54 AM
GregoryLewis2
New Contributor

In 4.x, I have a basic working app using the custom search source widget to fetch from an external API and display it on the webmap. Identical to https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-customsource/ for all intents and purposes.

 

I also have basic webmap save function which at this point just saves the underlying webmap to portal, but of course it doesn't contain the searchsource geometries as they aren't added as a true layer. I'm using https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#saveAs for saveAs.

 

So the problem is I don't know how to get my geometries to be saved with the WebMap. I see there's limitations of the types of FeatureLayers that can be saved (have to be backed by a FeatureService or MapService). I'm not sure how to create and populate a FeatureService from the Javacript API.

 

Alternatively, I could use the 4.x Request Interceptors to add it into the saveAs requests manually, but I'm not sure of the workflow that I need to do to kick off what I would like to do.

Tags (2)
0 Kudos
0 Replies