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
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 answers
Answer question

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