|
POST
|
I have a Date only field called closingDate. How would I use that field in a Styles expression as a means to hide the symbol on the map when that date is over? Something like this: // Variable containing closing day of event
var closingDay = $feature.closingDate
// Variable containing today's date in date only format
var todaysDate = DateOnly()
if (closingDay < todaysDate) {
return null;
}
... View more
07-22-2025
12:52 PM
|
0
|
3
|
984
|
|
POST
|
Ok. Did you go into the Map Layers widget and select any layers? When none are selected you'll also get that message. No items selected: Items selected (blue check marks next to layers):
... View more
07-15-2025
01:06 PM
|
0
|
0
|
1730
|
|
POST
|
Back in the Map widget are you sure it is selected? That happens when no map is selected, for ex:
... View more
07-15-2025
11:58 AM
|
0
|
0
|
1749
|
|
POST
|
example How would I recreate this expandable "infoDiv" using map components? I don't understand how to get it in the view when there is no longer a view. I'd rather not create a html/css button outside the view. This is the html of the app I'm currently creating. <arcgis-map zoom="14" center="-88.1, 41.5">
<arcgis-search position="top-left"></arcgis-search>
<arcgis-zoom position="top-left"></arcgis-zoom>
<arcgis-home></arcgis-home>
<arcgis-locate scale="5000"></arcgis-locate>
<arcgis-swipe swipe-position="32"></arcgis-swipe>
<arcgis-expand position="top-right">
<arcgis-layer-list></arcgis-layer-list>
</arcgis-expand>
</arcgis-map>
... View more
07-07-2025
09:49 AM
|
0
|
1
|
826
|
|
POST
|
I have a two fields that deal with the operating hours of cooling centers. The HOURS field has text that displays in a pop-up in AGOL. The HoursDays field converts the hours to the 24hr clock and those values are used in the Arcade expression to style the features in the webmap. The feature styles show either "Open now" or "Closed" based on the 24hr values. // convert to 24 hour time
function ConvertTime(input) {
var theTime = input;
if (Find(":", theTime) > -1) {
var times = split(theTime, ":");
theTime = Number(times[0]) + Number(times[1]) / 60;
}
return Number(theTime);
}
var current = ConvertTime(Time(Now()));
var fTime = $feature.HoursDays;
var times = Split(fTime, ',')
var todaysTime = times[Weekday(Today()) - 1];
if (todaysTime == 'closed') return 'Closed'
var todaysTimes = Split(todaysTime, '-')
var start = ConvertTime(todaysTimes[0]);
var end = ConvertTime(todaysTimes[1]);
iif(current >= start && current <= end, 'Open now', 'Closed') What I'm missing is a way to use Arcade to create a "Closed" style for government holidays, namely: January 1st, 2025 January 20th, 2025 February 17th, 2025 May 26th, 2025 June 19th, 2025 July 4th, 2025 September 1st, 2025 October 13th, 2025 November 11th, 2025 November 27th, 2025 December 25th, 2025 Any ideas?
... View more
06-27-2025
09:43 AM
|
0
|
1
|
1993
|
|
POST
|
I'm attempting to remove an esri TileLayer from the legend. This does not remove it: esriTileLayer = new TileLayer({
url: "https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer",
legendEnabled: false,
title: "I'm a title",
}); If I do not give it a title the default still appears: esriTileLayer = new TileLayer({
url: "https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer",
legendEnabled: false,
// title: "I'm a title",
});
... View more
04-23-2025
06:27 AM
|
0
|
2
|
1119
|
|
POST
|
Thanks @Edvinas_S for the help! That got me real close. When I click a button I expect to see the webmap on the trailing side of the swipe only. The leading side of the swipe should include the street labels and the satellite basemap on start-up, only and always. In your Codepen the webmap is on both sides after clicking a button. I believe using a promise function .when to add the satellite basemap after the webmapids, hence, rendering it over them will work if I can figure out how/where to implement it. My old code did this with an imagery layer.
... View more
04-21-2025
08:55 AM
|
0
|
1
|
1775
|
|
POST
|
This question is a continuation of my last post. I'm attempting to combine Swipe and Map. In my sample, my goal is to initialize on the 1862 webmap with the basemap and vector tile layer as the leading swipe layer. The webmaps should be the trailing swipe layers. Then, I want the ability to click back and forth between the other webmap(s) while also being able to swipe. Right now, the swipe doesn't mesh with the webmaps. When I click one of the buttons I get: Uncaught (in promise) "No layerview has been found for the layer" What's confusing me is that components do not use views as far as I understand. Here's how I did it with the current JS SDK: <script>
require(["esri/Map",
"esri/views/MapView",
"esri/layers/ImageryLayer",
"esri/widgets/Swipe",
"esri/WebMap",
], (Map, MapView, ImageryLayer, Swipe, WebMap) => {
//webmap IDs
/************************************************************
* Create multiple WebMap instances
************************************************************/
const webmapids = [
"e67a8eb6768641c19d4a7c5df394dbf4", //DTM
"bfc5b0242adb42bfb0fc41e54497dfc8", //DSM
"6ed3d2e495db4e859a73d2a32ce3d576", //HEDEM
"d653b18bc941458491e06e657e10f393", //Intensity
"a9ab25b1c7204764b2fabad6fc7a4635", //IR
"e6bab92ebc524072a3305ec8f128e8f8", //Soil
"2f9acebfb8db4e10bb6dddab8d3239c7", //ClosedDepressions
];
const webmaps = webmapids.map((webmapid) => {
return new WebMap({
portalItem: {
// autocasts as new PortalItem()
id: webmapid,
}
});
});
// add image services used in the swipe map
const imagery2024 = new ImageryLayer({
url: "https://gis.willcountyillinois.com/portal/sharing/servers/871887c09c234de98109ed4033f842ad/rest/services/Orthoimagery/Orthos_2024_3IN/ImageServer",
});
webmaps[0].add(imagery2024);
/************************************************************
* Initialize the View with the first WebMap
************************************************************/
const view = new MapView({
map: webmaps[0],
container: "viewDiv",
constraints: {
maxScale: 500,
minScale: 300000,
}
});
console.log('construct the view')
//use promise function.when to add the imagery layer after the webmap group layer, hence, rendering it over the group layers
view.when(function () {
console.log('show the view')
webmaps[0].add(imagery2024);
});
// create a new Swipe widget
let swipe = new Swipe({
leadingLayers: [imagery2024],
// trailingLayers: [imagery2024],
position: 45, // set position of widget to 35%
dragLabel: "drag left or right",
view: view,
});
// add the widget to the view
view.ui.add(swipe);
/************************************************************
* On a button click, change the map of the View
************************************************************/
document.querySelector(".btns").addEventListener("click", (event) => {
const id = event.target.getAttribute("data-id");
if (id) {
const webmap = webmaps[id];
view.map = webmap;
webmap.add(imagery2024);
// promise
webmap.when(function () {
webmap.add(imagery2024);
console.log("View loaded");
}, function (error) {
});
const nodes = document.querySelectorAll(".btn-switch");
for (let idx = 0; idx < nodes.length; idx++) {
const node = nodes[idx];
const mapIndex = node.getAttribute("data-id");
if (mapIndex === id) {
node.classList.add("active-map");
} else {
node.classList.remove("active-map");
}
}
}
});
});
</script>
... View more
04-15-2025
02:40 PM
|
0
|
3
|
1875
|
|
POST
|
How would I convert this sample to map components? I have an existing app that combines that sample with a swipe widget. And I'm attempting to update it. I've gotten as far as utilizing the arcgis-swipe component, but I'm stuck on how to implement more than one webmap.
... View more
04-14-2025
09:39 AM
|
0
|
1
|
1098
|
|
POST
|
I take it back. This components page takes me to that widgets page... confusing.
... View more
04-09-2025
01:55 PM
|
0
|
0
|
2102
|
|
POST
|
Apologies, I think I've found the right documentation. Sometimes it's hard to know where to look. https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources
... View more
04-09-2025
01:43 PM
|
0
|
0
|
2131
|
|
POST
|
After finding out about the transition to components, I'm wondering how I should proceed with the search widget? I'm about to build an app template (that will be followed by many) that includes searching a feature layer. As of now that's only possible with the widget as far as I can tell?
... View more
04-09-2025
01:27 PM
|
0
|
3
|
2139
|
|
POST
|
Hi @Noah-Sager, yes I am aware of the transition. My goal here is just that. I'm creating an app using components, not widgets, to get a leg-up on my functioning custom apps that will need transitioning.
... View more
04-02-2025
02:03 PM
|
0
|
1
|
1452
|
|
POST
|
Thanks for the reply. That doesn't seem to have any effect on the zoom either? And it's asking me to sign in. Does it need a token? Sample.
... View more
04-02-2025
12:51 PM
|
0
|
0
|
1490
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-25-2026 12:25 PM | |
| 1 | 05-04-2026 08:45 AM | |
| 1 | 04-20-2026 01:20 PM | |
| 1 | 07-24-2025 01:27 PM | |
| 1 | 11-13-2025 08:22 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|