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

110
Vistas
Uncaught (in promise) TypeError: layerView.createQuery is not a function
Layer.fromArcGISServerUrl("").then(function (layer) {
                map.add(layer);
                view.popup.autoOpenEnabled = false; // <- disable view popup auto open
                view.on("click", function (event) { // <- listen to view click event
                    if (event.button === 0) { // <- check that was left button or touch
                        view.whenLayerView(layer).then(function (layerView) {
                            const query = layerView.layer.createQuery();
                            query.geometry = view.toMap(event);
                            query.distance = 1;
                            query.units = "meters";
                            layerView.queryFeatures(query).then(
                                response => {
                                    document.getElementById("infomap").innerText = JSON.stringify(response.features);
                                    console.error(response);
                                },
                                err => {
                                    document.getElementById("infomap").innerText = "Query returns an error, check console to see what happen!.";
                                    console.error(err);
                                }
                            );
                        });
                    }
                });
            });

I want to get info about pop up's using ArcGis in React and I get the mistake that createQuery is not a function. I dont understand why I have this err. Help please

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

From the documentation, I understand that layer is a base class, and there are multiple types of layers that extend that class. The createQuery method is not on the base class so it might be that you are calling createQuery on layer type that does not have that method implemented.

What does layerView.layer.constructor.name give you in the console?

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