Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

104
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda