POST
|
I am still new to esri's js-api. I am getting the error below at line 149 (queryTask.execute(cntryq);) in the attached file. I have no idea how to resolve this error TypeError {stack: "TypeError: undefined is not a function↵ at coun…ndler (http://js.arcgis.com/3.10/init.js:490:212)", message: "undefined is not a function"} message: "undefined is not a function" stack: "TypeError: undefined is not a function↵ at countries (http://tobagoborn.com/esri/examples/p1p2c.html:149:15)↵ at cntrycds (http://tobagoborn.com/esri/examples/p1p2c.html:163:5)↵ at http://tobagoborn.com/esri/examples/p1p2c.html:179:7↵ at S._resolve (http://js.arcgis.com/3.10/js/esri/layers/FeatureLayer.js:64:294)↵ at k (http://js.arcgis.com/3.10/js/esri/layers/FeatureLayer.js:65:355)↵ at c (http://js.arcgis.com/3.10/init.js:74:221)↵ at d (http://js.arcgis.com/3.10/init.js:74:10)↵ at resolve.callback (http://js.arcgis.com/3.10/init.js:75:350)↵ at Object.n._resDfd (http://js.arcgis.com/3.10/init.js:758:31)↵ at e._successHandler (http://js.arcgis.com/3.10/init.js:490:212)"
... View more
10-18-2014
04:50 AM
|
0
|
14
|
4174
|
POST
|
I am trying to combine 2 parts of of a scripts I was able to make work separately. In part 1 I am returning an array of country codes and in part 2 I and using the codes to display the associated countries I am have a problem passing the array from part 1 to part 2 in the combined file attached I am also getting the following error: Uncaught TypeError: undefined is not a function at line 90: queryTask.execute(cntryq);
... View more
10-17-2014
01:05 PM
|
0
|
0
|
495
|
POST
|
I would like to display a the result of a query that loops thru an array. The query statement should look the one shown below: countryCodes = [840, 332, 643, 724, ....]; for (var i = 0; i < countryCodes.length; i++) { cntryq.where = "UN = " + countryCodes = } cntryq.where = "UN = " + countryCodes = [0] + "OR UN = " + countryCodes = [1] + .... Is this possible? My script is attached
... View more
10-17-2014
08:07 AM
|
0
|
2
|
2314
|
POST
|
Figured it out!! Needed to include the Query keyword in the function after the require array
... View more
10-14-2014
05:33 AM
|
0
|
0
|
942
|
POST
|
I'm trying to understand how to query a feature layer and getting the following error: ReferenceError {stack: "ReferenceError: Query is not defined↵ at http:/… at d (http://js.arcgis.com/3.10/init.js:74:10)", message: "Unable to draw graphic (geometry:null, symbol:null): Query is not defined"} message: "Unable to draw graphic (geometry:null, symbol:null): Query is not defined" stack: "ReferenceError: Query is not defined↵ at http://tobagoborn.com/esri/examples/exam1.html:40:24↵ at null. (http://js.arcgis.com/3.10/init.js:777:175)↵ at h.(anonymous function).g [as onLoad] (http://js.arcgis.com/3.10/init.js:239:390)↵ at v (http://js.arcgis.com/3.10/js/esri/layers/FeatureLayer.js:24:225)↵ at S._forceIdentity (http://js.arcgis.com/3.10/js/esri/layers/FeatureLayer.js:50:338)↵ at S._initLayer (http://js.arcgis.com/3.10/js/esri/layers/FeatureLayer.js:25:72)↵ at Object. (http://js.arcgis.com/3.10/init.js:174:23)↵ at http://js.arcgis.com/3.10/init.js:630:478↵ at c (http://js.arcgis.com/3.10/init.js:74:221)↵ at d (http://js.arcgis.com/3.10/init.js:74:10)" Script below:...... <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> <title>Basic Example 1</title> <link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css"> <script src="http://js.arcgis.com/3.10/"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script type="text/javascript"> var countries; var buttonPicked; var buttonType; var countryCode = []; var map, featureLayer, relatedTable; var featureURL = "http://dev.consciousglobalchange.org/arcgis/rest/services/MEP/webmap_catalog/FeatureServer/0"; var relatedURL = "http://dev.consciousglobalchange.org/arcgis/rest/services/MEP/webmap_catalog/FeatureServer/1"; function countries() { require(["esri/map", "esri/layers/FeatureLayer", "esri/tasks/query", "dojo/domReady!" ], function(Map,FeatureLayer) { map = new Map("mapDiv", { center: [-56.049, 38.485], zoom: 3, basemap: "streets" }); var featureLayer = new FeatureLayer(featureURL, { outFields: ["*"] }); featureLayer.on("load", function () { var cntryq = new Query(); cntryq.outFields = ["*"]; cntryq.where = "UN = " + 840; //332 countries.queryFeatures(cntryq, function(featureSet) { var data = featureSet.features; console.log(data); }); }); //end of on //map.addLayer(featureLayer); }); //end require } countries(); </script> </head> <body> <div id="mapDiv"></div> </body> </html>
... View more
10-13-2014
05:06 PM
|
0
|
1
|
4083
|
POST
|
Jake, I think there is problem with the server hosting the esri software Thanks Joe
... View more
10-13-2014
02:29 PM
|
0
|
0
|
412
|
POST
|
Jake, I did as you suggested but still the error Chris
... View more
10-13-2014
02:06 PM
|
0
|
0
|
412
|
POST
|
I have a very basic script show below and get the error: Any ideas as to what I'm doing wrong?? Error {code: 500, message: "Error performing query operation", details: Array[0], log: undefined, httpCode: 500…} _ssl: undefined code: 500 details: Array[0] httpCode: 500 log: undefined message: "Unable to draw graphic (null): Error performing query operation" stack: "Error↵ at Error (native)↵ at Object.e.load (http://js.arcgis.com/3.10/init.js:619:426)↵ at http://js.arcgis.com/3.10/init.js:187:69↵ at c (http://js.arcgis.com/3.10/init.js:74:221)↵ at d (http://js.arcgis.com/3.10/init.js:74:10)↵ at resolve.callback (http://js.arcgis.com/3.10/init.js:75:350)↵ at c (http://js.arcgis.com/3.10/init.js:74:436)↵ at d (http://js.arcgis.com/3.10/init.js:74:10)↵ at resolve.callback (http://js.arcgis.com/3.10/init.js:75:350)↵ at http://js.arcgis.com/3.10/init.js:191:300" __proto__: d ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> <link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css"> <script src="http://js.arcgis.com/3.10/"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> </head> <body> <div id="mapDiv"></div> <script type="text/javascript"> var map, featureLayer; var featureURL = "http://dev.consciousglobalchange.org/arcgis/rest/services/MEP/webmap_catalog/FeatureServer/0"; require(["esri/map", "esri/layers/FeatureLayer", "dojo/domReady!"],function(Map,FeatureLayer) { map = new Map("mapDiv", { center: [-56.049, 38.485], zoom: 3, basemap: "streets" }); var featureLayer = new FeatureLayer(featureURL); map.addLayer(featureLayer); </body> </html>
... View more
10-13-2014
12:53 PM
|
0
|
3
|
3621
|
POST
|
I am new to esri's javascript API. Can someone point me to a simple example of how use esri's javascript api with related table query. The samples on the website are rather complicated and not annotated. I'm trying to figure out how to return only the geometry of the countries that the satisfies a query of my related table and overlay this result on a base map Thanks Chris
... View more
10-04-2014
03:02 PM
|
0
|
0
|
2034
|
POST
|
Paul, Everything looks good!! Thanks for the help!! Chris
... View more
09-15-2014
12:44 PM
|
0
|
0
|
563
|
POST
|
Make countries a global variable worked I do have multiple buttons and what to clear the countries from the previous button click... Any suggestions??
... View more
09-15-2014
11:57 AM
|
0
|
2
|
565
|
POST
|
Paul, Your suggestions worked great!! The new issue I have is with my mouseout:resetHighlight resetHighlight(e){ countries.resetStyle(e.target); } Is not recognizing the "countries" object since Iam now creating the instance inside of the click function.
... View more
09-15-2014
09:25 AM
|
0
|
4
|
565
|
POST
|
Hmmm... I am running it on a esri webserver installed on an AWS virtual machine. countries.addTo(map); <- placed outside the click function $('#NSM').click(function(){ var buttonType = document.getElementById('NSM') countries.setWhere("type like "+"'"+buttonType.value+"'"); }); The above "works" but it creates the a layer of ALL the countries BEFORE the setWhere works see link: Add Map But I want to create the layer only AFTER you click on the button with the countries that satisfies the query. Chris
... View more
09-15-2014
08:00 AM
|
0
|
7
|
565
|
POST
|
Paul, Using the single quotes worked!! I made some changes similar to the code you posted above so that the tilemap is displayed initially. When you click on the button the countries that satisfy the query are over-layed on the map Now I am getting the following error: Uncaught TypeError: Cannot read property 'getBounds' of undefined $('#NSM').click(function(){ var buttonType = document.getElementById('NSM') countries.setWhere("type like "+"'"+buttonType.value+"'"); countries.addTo(map); <- placing this line here causes the error }); Link to demo: Esri Leaflet Demo Can you tell me what I'm doing wrong?? Thanks
... View more
09-14-2014
10:39 AM
|
0
|
9
|
1026
|
Title | Kudos | Posted |
---|---|---|
1 | 08-25-2015 09:37 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|