|
POST
|
I clicked on the sample code link you provided and I don't see any errors. I'm using MS Edge version 95.0.1020.40 (Official build) (64-bit).
... View more
11-05-2021
02:01 PM
|
1
|
1
|
1351
|
|
POST
|
I think view.goTo(response.extent) will work with the response from your querytask. Just a reminder that querytask (https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html ) has been deprecated as of 4.21 and Esri is recommending the use of Query instead (https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html ). This is Esri's sample page https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-queryextent/
... View more
10-28-2021
08:42 AM
|
0
|
2
|
1975
|
|
POST
|
The error is pretty specific that it "failed to load the portal item". Since I can't see any of your code it's hard to suggest anything, but since it opens in all environments except for production, my guess is that you have been working with a map that's only shared to a local user, and you need something outside of the firewall. There could be other reasons why a Map wouldn't show but you don't present much to work on. If you are trying to present a map outside of your firewall then you should check the URL of the REST endpoint separately to make sure it works. If it does, then there's something else going on.
... View more
10-18-2021
08:58 AM
|
0
|
0
|
1192
|
|
BLOG
|
Granted you will need to do a test for each field, but you could reduce the code required using a ternary condition test as in: var aNL = TextFormatting.NewLine;
var popupString = "";
var lineBreak = "_______________________";
popupString += lineBreak;
popupString += IIF(!IsEmpty($feature.PARCELID), aNL + "APN: " + $feature.PARCELID, "");
popupString += IIF(!IsEmpty($feature.incorpname), aNL + $feature.SA_FullAddress, "");
return popupString
... View more
10-14-2021
11:18 AM
|
2
|
0
|
3933
|
|
POST
|
Dojo has a library for dragging DIVs called "dojo/dnd/Moveable". In an app I'm working on I have a draggle window for tools. To this I have a div on the page with a whole bunch of buttons for tools: <div id="toolsDiv" style="z-index:100;">
<button id="btnFullExtent" class="ui-button" title="Full Extent">
<i class="fas fa-expand-arrows-alt fa-lg"></i>
</button>
<button id="btnPrevExtent" class="ui-button" title="Previous Extent">
<i class="fas fa-chevron-circle-left fa-lg"></i>
</button>
<button id="btnSearch" class="ui-button" title="Search">
<i class="fas fa-search fa-lg"></i>
</button>
<button id="btnAddStop" class="ui-button" title="New Stop Button">
<i class="fas fa-plus fa-lg"></i>
</button>
...
</div> Which sits within a DIV 'wrapper' that also has the map div init: <div class="wrapper">
<div id="toolsDiv" style="z-index:100;">
<button id="btnFullExtent" class="ui-button" title="Full Extent">
...
</div>
<div id="viewDiv" class="map"></div>
<div id="loadingDiv" class="loading"><img src="./resources/Loading.gif" height="100" width="100" /></div>
</div> And CSS to render the tools Div: #toolsDiv {
padding: 10px;
border: 3px solid #000;
background: #fff;
position: absolute;
left: 150px;
border-radius: 15px;
} And then a call to instantiate the library: let toolsDiv = new Moveable(dom.byId("toolsDiv")); After that the the div can be dragged anywhere within the wrapper div.
... View more
10-07-2021
09:12 AM
|
0
|
0
|
1609
|
|
POST
|
In one of Esri's Editor widget examples (Editor popup edit action ), they show how you can get access to the widget's dom node and make changes: let arrComp = editorNode.getElementsByClassName("esri-editor__back-button esri-interactive");
if (arrComp.length === 1) {
// Add a tooltip for the back button
arrComp[0].setAttribute("title", "Cancel edits, return to popup");
// Add a listerner to listen for when the editor's back button is clicked
arrComp[0].addEventListener('click', function (evt) {...
or
// Remove 'Delete' button from bottom of Editor widget
let btnDelete = editorNode.getElementsByClassName("esri-editor__control-button esri-button esri-button--tertiary");
if (btnDelete.length === 1) { btnDelete[0].style.display = "none"; } Maybe you can access a node in the particular widget you are interested in and then attach your close button through the Dom.
... View more
10-07-2021
08:49 AM
|
0
|
3
|
2791
|
|
POST
|
Maybe you could maintain a list of the loaded map feature layers, then if one is changed to have a transparency set to 0 you could remove it from this list (until it was set back I'm guessing). Then when you called the query function you could check this list and not perform the query if the feature layer wasn't in it. It just seems that if you control when a layer's transparency is turned off, then you should be able to track that and know which layers not to use in the query.
... View more
10-06-2021
09:50 AM
|
0
|
1
|
1418
|
|
POST
|
Andy Gup from Esri responded to a similar question a couple of weeks back: https://community.esri.com/t5/arcgis-api-for-javascript-questions/can-i-freely-use-this-api-in-an-ios-android-app/m-p/1093240/highlight/true#M74463
... View more
10-05-2021
11:51 AM
|
0
|
2
|
1017
|
|
POST
|
Luckachi, Not sure if you have tried the field options method, but that could limit the user's selection to only a specified range of values. I am using it on an asset field that I pull all of the potential assets out using a call to the web service prior to presenting the Grid. The field is set up using this syntax in the Grid columns setup: { field: 'AmenityType',
label: 'Type',
editor: Select,
editOn: 'dblclick',
editorArgs: {
style: { width: "66px;" },
options: optionsAmenityType
}
}, The optionsAmenityType list is built by calling the web service like this: // Query for AmenityType domain information
let optionsAmenityType = [];
let amenityTypeDomainURL = "https://services2.arcgis.com/2t1927381mhTgWNC/ArcGIS/rest/services/Regional_Bus_Stops/FeatureServer/1?f=pjson";
esriRequest(amenityTypeDomainURL, {
responseType: "json"
}).then(function (response) {
let lstTypes = response.data.fields[1].domain.codedValues;
for (var i = 0; i < lstTypes.length; i++) {
var curType = lstTypes[i];
optionsAmenityType.push({ value: curType.code, label: curType.name });
}
})
.catch(function (error) {
console.error("AmenityType Domain Error: " + error);
}); It seems to work well and doesn't impact performance that much. My biggest issue is trying to get dGrid to look good as it seems the styles are not that well documented and changing one thing impacts 2 others. But this process might work in your instance if before the Grid deployment you could get the specific 'kingdom' to use, then you could build a list of options (through either a web service call like I did or just specifying the values in the code (not always best because then you are locked into any value changes being done in the code)) and then the user would only be able to select one of the values for that particular 'kingdom'. Just a thought. And if you have any good dGrid styling ideas please let me know.
... View more
09-28-2021
11:09 AM
|
0
|
1
|
2946
|
|
POST
|
I think you can, however I don't know how to get the current value of a specific field when you are in the formatter function. The formatter function is handling the row event and I'm not sure if it exposes what the selected row is. You could string together a function to push out the current 'Kingdom' value on any row select and then pick that up with a formatter, I'm guessing. It might look something like this (need to have the Dojo 'on' library loaded): var sKingdom = "";
resultsGrid.on("dgrid-select", function (evt) {
let cell = resultsGrid.cell(evt);
sKingdom = cell.row.data.Kingdom;
});
dPlantDensities = {1:"Almost 1", 2:"Between 2 and 3", 3:"Below 4"};
dAnimalDensities = {1:"Just below 2", 2:"Between 2.5 and 3.4", 3:"Unknown"};
function getDensity(value) {
var outText = "";
if (sKingdom == "Plant") {
if (value == 1) outText = dPlantDensities[1];
else if (value == 2) outText = dPlantDensities[2];
else {
if (value == 1) outText = dAnimalDensities[1];
else if (value == 2) outText = dAnimalDensities[2];
etc...
}
return outText;
} Maybe someone can figure out how to access the row directly from the formatter function but this might work.
... View more
09-27-2021
02:21 PM
|
0
|
1
|
2979
|
|
POST
|
FYI, this works well for a small number of possible values (numbers in this case). But if it would get too large I would do something like make a dictionary (ordered pairs in Javascript) of all of the possible values {1:"One", 2:"Two", 3:"Three", etc. } and then use the value coming into the formatter function to determine the value to pass back. It seemed like you were only dealing with a small list and the if/then/else would suffice.
... View more
09-27-2021
12:12 PM
|
1
|
1
|
3015
|
|
POST
|
How about setting up another formatter? Looks like a generic one would work for both fields, something like: function numberToText(value) {
var outText = "";
if (value == 1) outText = "One";
else if (value == 2) outText = "Two";
etc...
else outText = "Unknown";
return outText;
} Then you can set that formatter to both of your fields: }, {
label: "Density",
field: "OB_DENSITY",
formatter: numberToText
}, {
... View more
09-27-2021
11:57 AM
|
2
|
1
|
3029
|
|
POST
|
If you take any ArcGIS Javascript API example that adds a feature layer to a basemap and interchange that REST endpoint URL with one from an ArcGIS Online REST endpoint that is not publicly shared, then when you instantiate the page it will automatically ask you for your credentials. If the 'hosted feature layer' is not on ArcGIS Online, but on an ArcGIS Server or Portal behind an agency firewall then you can't see it. You could download a particular version of ArcGIS Javascript and serve it up from your local server and then access only your internal data if needed, and somewhere Esri has examples of how set up and use their Javascript API from your own server. If the data is on ArcGIS Online, and is not publicly shared, but you want only certain people to access it you can share it up to an Online group, or specific accounts, and then those users will need to have an ArcGIS Online login. Otherwise, if you want to handle the login and then push the data request through using a specific online account then you will have to useOAuth2 authentication as suggested by Sage.
... View more
09-10-2021
12:34 PM
|
1
|
0
|
2053
|
|
POST
|
I keep trying to post some code that works, but basically if you move 'Map' from the end of the variable list in the Require statement to the beginning to correspond to the "esri\Map" library exposed there it will start working. The feedlotCount variable needs to be set prior to using it as well but that you can probably handle.
... View more
09-08-2021
08:52 AM
|
0
|
0
|
1451
|
|
POST
|
In the Require, your 'Map' variable doesn't correspond to the right javascript library. Also, if you click on the map the Console is saying that you don't define feedlotCount before you use in the For statement.
... View more
09-08-2021
08:40 AM
|
0
|
0
|
1441
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-01-2022 02:02 PM | |
| 1 | 02-28-2024 01:40 PM | |
| 2 | 02-27-2024 01:13 PM | |
| 1 | 10-18-2022 11:31 AM | |
| 1 | 06-23-2023 09:13 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-28-2025
09:15 AM
|