Refresh map after adding feature using apply edits

1797
3
Jump to solution
07-11-2021 09:20 AM
divyabathina
New Contributor III

Hi,
After adding feature using apply edits, the feature layer don’t show the newly created feature.  Layer.refresh() don’t refresh the map on the web scene. Is there a way to get the newly added features updated on the webscence.

Thanks,

Divya

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
divyabathina
New Contributor III

Hi ,

I Have added

fLayerView.layer.refresh();  and the map is getting refresh 🙂 
 
Thank Divya

 

View solution in original post

3 Replies
GeoGarage-vmbp-
New Contributor II

Hello. Can you tell us what the API version is and post the code?

The universe is a hostile place
0 Kudos
divyabathina
New Contributor III

Hi @GeoGarage-vmbp- ,

api 4.19, After adding the feature the map don't show the newly added feature. please see the code below .

I am newly creating the feature from different layer to the flayer where the feature is added.

try {

      await flayer

        .applyEdits(parameter)

        .then(async function (editsResult) {

          if (editsResult.addFeatureResults.length > 0) {

            console.log("Added feature to the layer");

            clearGeometry();

            flayer.refresh();

            flayer.load();

          }

        })

        .catch(function (error) {

          console.log("Error - Adding feature to the layer");

          console.log("[ applyEdits ] FAILURE:", error);

        });

    } catch (ex) {

      console.error(ex);

    }

 

Thanks ,

Divya

0 Kudos
divyabathina
New Contributor III

Hi ,

I Have added

fLayerView.layer.refresh();  and the map is getting refresh 🙂 
 
Thank Divya