|
POST
|
I did find a solution for my problem. It was completely related to screen resolution. I just have to minimize the window a bit and everything works fine.
... View more
08-31-2023
01:21 PM
|
1
|
9
|
3135
|
|
POST
|
Thanks for the info @T_R. However, there isn't a single layer in each map that can be removed.
... View more
08-29-2023
08:24 AM
|
0
|
10
|
3145
|
|
POST
|
I'm also experiencing intermittent performance issues with Experience Builder, particularly with layers and the basemap in the map widget. When I try to open the layers or the basemap, the tool window basically flashes. I've opened a case with Esri, but no luck so far with resolving the issue. We've tested on multiple machines, on multiple browsers. So far, the only commonality has been the issue has presented on three desktop machines at two different locations. Has not presented on two other desktops, on any laptop we've tested, or any phone we've tested. Testing has occurred behind different firewalls and on personal computers. https://experience.arcgis.com/experience/1a4ff69a9d6142aab92e3056df8a787f
... View more
08-29-2023
08:09 AM
|
0
|
0
|
3164
|
|
POST
|
@SarahSaint-Ruth For this most recent scenario, it is for guidance only. In speaking with the biologist, he figured a circle would be the easiest buffer, but a rectangle would be more representative of the project. He had asked for a circle that covered 18 acres. We've had projects in the past when running transects where it would be used both for guidance and knowing when something fell outside of the scope of the project.
... View more
08-29-2023
06:44 AM
|
0
|
0
|
2138
|
|
POST
|
I have a series of 8 maps and 8 surveys pulled into an Experience for a statewide project. The project considers different aspects of all species within certain taxa groups in Alabama. The same species occur in the maps and surveys, so the maps may range from having 50 layers to over 400 layers. Each layer shows the range of a species in the state. The Layers tool in the Map widget is showing for less than a second when the tool is clicked on the published Experience. Through testing, it's occurring in both Chrome and Edge on desktops that are behind firewalls. It has opened without any issue on laptops in the same browsers. But the issue doesn't always happen on the desktops, though it's usually a problem. This is a second version of the Experience after some updates, and the issue didn't occur in the first version with the same data (which was used until a month ago). I've tried removing the published maps and adding them back in, but that didn't fix the problem. Has anyone else run into something similar or know anything to try to resolve this issue? The published Experience can be found here: https://experience.arcgis.com/experience/1a4ff69a9d6142aab92e3056df8a787f/page/Home/
... View more
08-23-2023
12:52 PM
|
0
|
1
|
900
|
|
POST
|
We have the same need for surveys where a biologist needs to stay within a set radius.
... View more
08-21-2023
01:28 PM
|
1
|
0
|
2215
|
|
POST
|
Fabricio, Did you find a solution to this? I am using an Arcade Expression to generate a list of species (common name, scientific name, and protection status) in JavaScript, but have not yet been able to figure out how to italicize just the species name. Any insight you may have would be appreciated. Ashley
... View more
08-08-2023
08:40 AM
|
0
|
1
|
1013
|
|
POST
|
Wow, thank you all! I looked at actions, but didn't see anything that made sense for a solution. But, that worked like a charm. Always good to learn something new!
... View more
04-28-2023
01:38 PM
|
0
|
0
|
2183
|
|
POST
|
I'm working with a single group layer in the layer list widget. By default, the group layer is visible, but collapsed upon map load. For ease of use for the end user, I would like the group layer to be open/expanded when the map loads. I believe I can achieve this by changing the CSS for the widget. I've added this block of code to the style and have tried different things, but haven't been able to get the group layer to be open upon map load. Any assistance is appreciated. .esri-layer-list__child-toggle .esri-layer-list__child-toggle-icon--opened,
.esri-layer-list__child-toggle .esri-layer-list__child-toggle-icon--closed-rtl,
.esri-layer-list__child-toggle--open .esri-layer-list__child-toggle-icon--closed {
display: none;
}
.esri-layer-list__child-toggle--open .esri-layer-list__child-toggle-icon--opened {
display: block;
}
... View more
04-28-2023
12:29 PM
|
1
|
4
|
2228
|
|
POST
|
Viktor, We've taken the code that Ken provided and have reworked it so it works with our data. Here it is: // Initialize variables
// This is the construct for telling the query which layer to pull from
const visibleLayer = counties;
let highlight, grid;
// call clearMap method when clear is clicked
const clearbutton = document.getElementById("clearButton");
clearbutton.addEventListener("click", clearMap);
view.on("click", function (event) {
clearMap();
queryFeatures(event);
});
function queryFeatures(screenPoint) {
const point = view.toMap(screenPoint);
// Query the for the feature ids where the user clicked
visibleLayer
.queryObjectIds({
geometry: point,
spatialRelationship: "intersects",
returnGeometry: false,
outFields: ["*"]
})
.then(function (objectIds) {
if (!objectIds.length) {
return;
}
// Highlight the area returned from the first query
view.whenLayerView(visibleLayer).then(function (layerView) {
if (highlight) {
highlight.remove();
}
highlight = layerView.highlight(objectIds);
});
// Query the for the related features for the features ids found
return visibleLayer.queryRelatedFeatures({
outFields: ["SpeciesGroup", "CommonName", "ProtectionLevels"],
relationshipId: visibleLayer.relationships[2].id,
objectIds: objectIds
});
})
.then(function (relatedFeatureSetByObjectId) {
if (!relatedFeatureSetByObjectId) {
return;
}
// Create a grid with the data
Object.keys(relatedFeatureSetByObjectId).forEach(function (
objectId
) {
// get the attributes of the FeatureSet
const relatedFeatureSet = relatedFeatureSetByObjectId[objectId];
const rows = relatedFeatureSet.features.map(function (feature) {
return feature.attributes;
});
if (!rows.length) {
return;
}
// create a new div for the grid of related features
// append to queryResults div inside of the gridDiv
const gridDiv = document.createElement("div");
const results = document.getElementById("queryResults");
results.appendChild(gridDiv);
// destroy current grid if exists
if (grid) {
grid.destroy();
}
// create new grid to hold the results of the query
grid = new Grid(
{
// create field aliases for query window
columns: Object.keys(rows[0]).map(function (fieldName) {
var fieldAliases = {
SpeciesGroup: "Species Group",
CommonName: "Common Name",
ProtectionLevels: "Protection Level"
};
return {
label: fieldAliases[fieldName] || fieldName,
field: fieldName,
sortable: true
};
})
},
gridDiv
);
// add the data to the grid
grid.renderArray(rows);
});
clearbutton.style.display = "inline";
})
.catch(function (error) {
console.error(error);
});
}
function clearMap() {
if (highlight) {
highlight.remove();
}
if (grid) {
grid.destroy();
}
clearbutton.style.display = "none";
} I've never tried to write queries before within the API, so I have had a few meetings with our IT group to get their assistance with this issue. We gave them the same code block above, with the idea of working from it to move towards a popup. So far, this is the closest we've come up with, and it isn't behaving properly. const visibleLayer3 = hex;
let highlight3, grid3;
// call clearMap method when clear is clicked
const clearbutton3 = document.getElementById("clearButton");
clearbutton3.addEventListener("click", clearMap);
view.on("click", function (event) {
clearMap();
queryFeatures(event);
});
function queryFeatures(screenPoint) {
var strResult = '';
//const strResult = document.getElementById("prpResults");
const point = view.toMap(screenPoint);
// Query the for the feature ids where the user clicked
visibleLayer3
.queryObjectIds({
geometry: point,
spatialRelationship: "intersects",
returnGeometry: false,
outFields: ["*"]
})
.then(function (objectIds) {
if (!objectIds.length) {
return;
}
// Highlight the area returned from the first query
view.whenLayerView(visibleLayer3).then(function (layerView) {
if (highlight3) {
highlight3.remove();
}
highlight3 = layerView.highlight3(objectIds);
});
// Query the for the related features for the features ids found
return visibleLayer3.queryRelatedFeatures({
outFields: ["SpeciesGroup", "CommonName", "ProtectionLevels"],
relationshipId: visibleLayer3.relationships[0].id,
objectIds: objectIds
});
})
.then(function (relatedFeatureSetByObjectId) {
if (!relatedFeatureSetByObjectId) {
return;
}
// Create a grid with the data
Object.keys(relatedFeatureSetByObjectId).forEach(function (
objectId
) {
// get the attributes of the FeatureSet
const relatedFeatureSet = relatedFeatureSetByObjectId[objectId];
const rows = relatedFeatureSet.features.map(function (feature) {
return feature.attributes;
});
if (!rows.length) {
return;
}
//**** Shane Code Beg ****
strResult = '<ul>';
//document.getElementById("prpResults").innerHTML = '<ul>';
//strResult.value = '<ul>';
var aobjRows = rows;
for (let z = 0; z < aobjRows.length; z++) {
let strCommonName = aobjRows[z].CommonName;
let strSpeciesGroup = aobjRows[z].SpeciesGroup;
let strProtectionLevel = aobjRows[z].ProtectionLevels;
//alert(aobjRows[z].CommonName);
strResult += '<li>' + strCommonName + ',' + strSpeciesGroup + ',' + strProtectionLevel + '<li>';
//strResult.value += '<li>' + strCommonName + ',' + strSpeciesGroup + ',' + strProtectionLevel + '<li>';
//document.getElementById("prpResults").innerHTML += '<li>' + strCommonName + ',' + strSpeciesGroup + ',' + strProtectionLevel + '<li>';
}
strResult += '</ul>';
//strResult.value += '</ul>';
//document.getElementById("prpResults").innerHTML += '</ul>';
//**** Shane Code End ****
//*** Begin Comment ***
// create a new div for the grid of related features
// append to queryResults div inside of the gridDiv
const gridDiv = document.createElement("div");
const results = document.getElementById("queryResults");
results.appendChild(gridDiv);
// destroy current grid if exists
if (grid3) {
grid3.destroy();
}
// create new grid to hold the results of the query
grid3 = new Grid(
{
// create field aliases for query window
columns: Object.keys(rows[0]).map(function (fieldName) {
var fieldAliases = {
SpeciesGroup: "Species Group",
CommonName: "Common Name",
ProtectionLevels: "Protection Level"
};
return {
label: fieldAliases[fieldName] || fieldName,
field: fieldName,
sortable: true
};
})
},
gridDiv
);
// add the data to the grid
grid3.renderArray(rows);
//**** End comment ****
});
alert(strResult);
//alert(document.getElementById("prpResults").value);
clearbutton3.style.display = "inline";
})
.catch(function (error) {
console.error(error);
});
alert(strResult);
//alert(document.getElementById("prpResults").innerHTML);
//alert(document.getElementById("prpResults"));
}
function clearMap() {
if (highlight3) {
highlight3.remove();
}
if (grid3) {
grid3.destroy();
}
clearbutton.style.display = "none";
} This code isn't clean, but will give an idea the direction we are heading.
... View more
04-17-2023
08:17 AM
|
0
|
0
|
2105
|
|
POST
|
Actually, we did run across that script and have been playing around with it. It works for us, but the map has three layers we need to toggle between, and we haven't been able to get it to work/focus on just the layer that is turned on. We also tried to rework it so it would open in a popup, but have not had success with that either. Both of those issues are likely due to lack of experience with queries on our end.
... View more
04-07-2023
12:07 PM
|
0
|
2
|
2150
|
|
POST
|
I do. But, per Esri, there is a limitation in ArcGIS Enterprise that doesn't allow it to work. It only works on hosted feature layers on AGOL. See the note here: RelationshipContent | API Reference | ArcGIS Maps SDK for JavaScript 4.26 | ArcGIS Developers
... View more
04-07-2023
11:09 AM
|
0
|
1
|
2156
|
|
POST
|
I have, yes. We can't use that sample as a guide as the layer sits on our ArcGIS Server and not on ArcGIS Online. I believe the closest I can get is actually using Query Related Records (Feature Service)—ArcGIS REST APIs | ArcGIS Developers. I have no experience with writing queries, so that's acting as another wall at the moment.
... View more
04-07-2023
08:35 AM
|
0
|
1
|
2163
|
|
POST
|
I am working with a non-hosted feature layer with a related table. The service is sitting on our REST endpoint, not on ArcGIS Online, because it contains data we consider sensitive. Because it is not hosted on AGOL, I am unable to use relationshipContent. Also, while I've been using the JavaScript API off and on for a while, I am still very much a beginner. I ran across this sample earlier - PopupTemplate with promise | Sample Code | ArcGIS Maps SDK for JavaScript 4.26 | ArcGIS Developers. It meets a lot of my needs I believe, but I am unsure how to rework the code to pull from a related table. I believe I need to change the queryURL, but that may not even be doable. Any guidance on reworking this code or suggestions on what I should consider instead?
... View more
04-06-2023
01:39 PM
|
0
|
8
|
2191
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-30-2025 01:35 PM | |
| 1 | 08-31-2023 01:21 PM | |
| 1 | 02-04-2025 06:23 AM | |
| 1 | 08-21-2023 01:28 PM | |
| 1 | 03-04-2024 01:50 PM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|