|
IDEA
|
Thanks for the feedback! Slots are on our roadmap, but we have some under-the-hood work to do first before that can happen. Some things such as the `childElem` you pointed out are not documented because they could change or go away in a future release. There is not set release for this work though, but when it is, we'll be talking about it!
... View more
07-18-2024
07:06 AM
|
0
|
0
|
1377
|
|
POST
|
Maybe referenceScale will get you what you are looking for. https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#referenceScale Sample: https://developers.arcgis.com/javascript/latest/sample-code/visualization-heatmap-static/
... View more
07-15-2024
10:58 AM
|
0
|
1
|
1235
|
|
POST
|
I believe there was a support ticket opened for this. That would be best route to track it.
... View more
07-03-2024
08:29 AM
|
0
|
0
|
2955
|
|
POST
|
If you wrap most of your code in a view.when, you can use the views spatial reference to create your point. const point = new Point({
x: -9810308.361037346,
y: 5136801.597252877,
spatialReference: view.spatialReference
}); The default spatial reference of geometries is WGS84, so you need to specify when using something else.
... View more
06-21-2024
08:03 AM
|
1
|
0
|
755
|
|
POST
|
If you are just using them for type annotations, you can use the `import type` syntax. import type Map from "@arcgis/core/Map"; It's safer, as this import won't be in the output JavaScript. Most bundlers "should" omit unused imports, but honestly, this can vary. I could have sworn the TS compiler was smart enough to do this anyway, but either way, the "import type" syntax would cover your bases.
... View more
06-20-2024
09:56 AM
|
1
|
0
|
3287
|
|
POST
|
Ah. For stuff like this, you can use Layer.fromPortalItem. It's useful to load an entire FeatureService or any layer where you have the item, but don't know the layer type. You can do something like this. Layer.fromPortalItem({
portalItem: {
id: "4601abb43d564387a785aeaaba8d7486",
}
}).then(async (layer) => {
// Will be a GroupLayer
// await layer.load();
// layer.layers -> [a, b] has two layers in the group
// pull out layer you are interested in
// and add only that layer.
// map.add(layer.layers.at(1));
// add the whole GroupLayer
map.add(layer);
}); Here is a codepen.
... View more
06-20-2024
09:25 AM
|
0
|
0
|
1812
|
|
POST
|
Hosted layer views look the same as regular layers to a user. They have an item id and url, so you can use them in the same way you would any other layer.
... View more
06-18-2024
02:22 PM
|
0
|
1
|
1672
|
|
POST
|
You might want to look at building your own custom UI element that covers what you need. You can use the NavigationToggleViewModel to handle the logic and build a custom UI around that. You can do it in your framework of choice or a vanilla HTML/JS element.
... View more
06-11-2024
09:45 AM
|
0
|
1
|
1649
|
|
POST
|
So I had some time and a crazy idea. You could return a Features widget in the CustomContent of your popup and turn your innerGraphics into pseudo graphics the Features widget could use. It requires some set up, but it works. https://codepen.io/odoe/pen/xxNdQMQ?editors=0010 const fieldContent = new FieldsContent({
outFields: ["*"],
fieldInfos: [
{
fieldName: "crashId",
label: "Crash ID"
},
{
fieldName: "groupId",
label: "Group ID"
}
]
});
const customContentWidget = new CustomContent({
outFields: ["*"],
creator: ({ graphic }) => {
const { innerGraphics } = graphic.attributes;
const graphics = innerGraphics.map((attributes) => {
return new Graphic({
geometry: null,
attributes,
popupTemplate: {
title: "Inner Crash ID: {crashId}",
content: [
{
type: "fields",
outFields: ["*"],
fieldInfos: [
{
fieldName: "crashId",
label: "Inner Crash ID"
},
{
fieldName: "groupId",
label: "Inner Group ID"
},
{
fieldName: "symbolType",
label: "Symbol"
},
{
fieldName: "direction",
label: "Direction"
},
{
fieldName: "severity",
label: "Severity"
},
{
fieldName: "narrative",
label: "Narrative"
}
]
}
]
}
});
});
console.log(graphics);
const features = new Features({
features: graphics,
visible: true,
visibleElements: {
actionBar: false,
closeButton: false,
collapseButton: false,
}
});
return features;
}
});
const graphicObj = {
geometry: {
spatialReference: {
wkid: 4326
},
x: -72.93538699999993,
y: 41.332516000000055,
type: "point" // add geometry type
},
symbol: null,
attributes: {
crashId: 1,
symbolType: "Sideswipe, Same Direction",
groupId: 25,
direction: null,
date: null,
innerGraphics: [
{
crashId: 222,
symbolType: "Sideswipe, Same Direction",
groupId: 20,
direction: 0,
date: 1682173620000,
severity: "O",
narrative: ""
},
{
crashId: 333,
symbolType: "Front to Rear",
groupId: 14,
direction: 0,
date: 1674143040000,
severity: "O",
narrative: ""
},
{
crashId: 111,
symbolType: "Front to Rear",
groupId: 22,
direction: 0,
date: 1697535840000,
severity: "O",
narrative: "Narrative unavailable for this crash."
}
]
},
popupTemplate: {
title: "Crash ID: {crashId}",
outFields: ["*"],
content: [fieldContent, customContentWidget]
}
};
view.graphics.add(graphicObj);
... View more
06-04-2024
01:15 PM
|
1
|
0
|
1257
|
|
POST
|
This is going to require using CustomContent and writing your own UI to display that info. The creator event will give you the graphic and you can return some custom HTML in the function to display your results. I had shown something similar here for weather data.
... View more
06-04-2024
08:28 AM
|
2
|
0
|
1298
|
|
POST
|
There is a calcite tutorial on how to do this you can apply to a react application. https://developers.arcgis.com/calcite-design-system/tutorials/build-a-dark-mode-switch/ The main thing to know is this part of the tutorial. const updateDarkMode = () => {
// Calcite mode
document.body.classList.toggle("calcite-mode-dark");
// ArcGIS Maps SDK theme
const dark = document.querySelector("#arcgis-maps-sdk-theme-dark");
const light = document.querySelector("#arcgis-maps-sdk-theme-light");
dark.disabled = !dark.disabled;
light.disabled = !light.disabled;
// ArcGIS Maps SDK basemap
map.basemap = dark.disabled ? "gray-vector" : "dark-gray-vector";
// Toggle ArcGIS Maps SDK widgets mode
const widgets = document.getElementsByClassName("esri-ui");
for (let i = 0; i < widgets.length; i++) {
widgets.item(i).classList.toggle("calcite-mode-dark");
}
};
document.querySelector("calcite-switch").addEventListener("calciteSwitchChange", updateDarkMode);
... View more
05-30-2024
08:50 AM
|
0
|
0
|
1828
|
|
POST
|
You will need to add some authentication to your application. In the documentation there is a section in the table of contents you can refer to. https://developers.arcgis.com/javascript/latest/ The links in that dropdown ArcGIS Org Portals - https://developers.arcgis.com/javascript/latest/arcgis-organization-portals/ Access Secure Resources - https://developers.arcgis.com/javascript/latest/secure-resources/ Tutorial - https://developers.arcgis.com/javascript/latest/tutorials/implement-user-authentication/ Sample - https://developers.arcgis.com/javascript/latest/sample-code/identity-oauth-basic/
... View more
05-22-2024
08:56 AM
|
0
|
0
|
1379
|
|
POST
|
You can check the searchTerm property https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#searchTerm It just depends on what event you want to check it https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#events-summary searchWidget.on("suggest-start", () => {
console.log("term: ", searchWidget.searchTerm);
});
searchWidget.on("suggest-complete", () => {
console.log("term: ", searchWidget.searchTerm);
});
... View more
05-20-2024
07:31 AM
|
1
|
1
|
1061
|
|
POST
|
As long as you have Routing and probably geocoding enabled for your key, should be fine.
... View more
05-03-2024
10:21 AM
|
1
|
1
|
2852
|
|
POST
|
The sample works in the sandbox. https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-directions Are you opening the codepen link? If so, the Route service requires an API Key, so you need to provide a key in your own app.
... View more
05-03-2024
09:29 AM
|
1
|
4
|
2898
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 2 | 2 weeks ago | |
| 1 | 02-27-2026 06:31 AM | |
| 1 | 01-13-2026 02:15 PM | |
| 1 | 12-31-2025 09:05 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|