Hi there,
This is just a requirejs question rather than specific to arcgis sdk. I need to pass custom parameters to my query function.
Here is my query function, I am not able to pass more parameters in the require construct. I am using function as a part of a bigger js file that will contain other map functions. I need to pass canal and lateral while calling that function.
Below errors out. If I remove canal and lateral and just add it to the function definition they are always undefined.
let queryFeature = (canal,lateral) => {
require([
"esri/config",
"esri/WebMap",
"esri/views/MapView",
"esri/layers/FeatureLayer", canal,lateral
], function (esriConfig, WebMap, MapView, FeatureLayer,canal,lateral) {
//query features layer, which is the layer with gates. Feature # or URL needs to be stored in the config
console.log(canal);
console.log(lateral);
});
}
Any help or guyidance is appreciated. Thanks
Solved! Go to Solution.
Nevermind, I figured it out. It needs to be like below. I needed to remove it from the require section.
let queryFeature = (canal,lateral) => {
require([
"esri/config",
"esri/WebMap",
"esri/views/MapView",
"esri/layers/FeatureLayer",
], function (esriConfig, WebMap, MapView, FeatureLayer) {
//query features layer, which is the layer with gates. Feature # or URL needs to be stored in the config
console.log(canal);
console.log(lateral);
});
}
Nevermind, I figured it out. It needs to be like below. I needed to remove it from the require section.
let queryFeature = (canal,lateral) => {
require([
"esri/config",
"esri/WebMap",
"esri/views/MapView",
"esri/layers/FeatureLayer",
], function (esriConfig, WebMap, MapView, FeatureLayer) {
//query features layer, which is the layer with gates. Feature # or URL needs to be stored in the config
console.log(canal);
console.log(lateral);
});
}