Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

103
Views
Unable to applyEdits ArcGIS FeatureLayer

Good Evening,

I am trying to update my featureLayer using the applyEdits properties. I am facing some issues as I cannot change the value of the specific layer. I am not sure what is wrong here do assist me on this, cheers! (This project is running on ArcGIS API 3.25)

 let testButton = document.getElementById('testButton')
    if (testButton){
    testButton.addEventListener("click",function(){
      var announcementInput = document.getElementById('announcementInput').value;
      console.log(announcementInput)
 
      featureLayer.applyEdits(
                  null,
                  [{
                    "attributes":{
                      "objectid":objectid,
                      "announcement": announcementInput, // I want to update this value
                  }
                  }],
                  null,
                  null,
                  null
    })
    }
    else{
      console.log("Not working")
    }
      });
    });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I think the problem is that you need to pass Graphic elements, you are just passing an object. It should be something like this,

// first get the feature you want to edit
const query = new Query();
query.objectIds = [objectid];
query.outFields = [ "*" ];
featureLayer.queryFeatures(query, function(featureSet) {
    if (featureSet.features.length === 0) {
        return;
    }
    // now update the desire attribute
    const feature = featureSet.features[0];
    feature.attributes.announcement = announcementInput;
    featureLayer.applyEdits(
      null,
      [feature],
      null,
      null,
      null
    })
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!