Select to view content in your preferred language

Refresh map after adding feature using apply edits

2209
3
Jump to solution
07-11-2021 09:20 AM
divyabathina
Occasional Contributor

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
Occasional Contributor

Hi ,

I Have added

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

 

View solution in original post

3 Replies
GeoGarage-vmbp-
Emerging Contributor

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

The universe is a hostile place
0 Kudos
divyabathina
Occasional Contributor

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
Occasional Contributor

Hi ,

I Have added

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