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

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

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