Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

105
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda