|
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
|
1597
|
|
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
|
903
|
|
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
|
1499
|
|
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
|
1528
|
|
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
|
1536
|
|
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
|
1210
|
|
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
|
1248
|
|
POST
|
I don't see a way to control the zoom? I don't see a property to do so. This has no effect: <arcgis-search position="top-left" zoom="10"></arcgis-search>
... View more
04-02-2025
11:23 AM
|
0
|
6
|
1278
|
|
POST
|
<arcgis-map zoom="13" center="-88.1, 41.5">
<arcgis-zoom position="top-left"></arcgis-zoom>
<arcgis-swipe swipe-position="32"></arcgis-swipe>
<arcgis-expand position="top-right">
<arcgis-layer-list
label="1862 Imagery"
visibility="checkbox"
></arcgis-layer-list>
</arcgis-expand>
</arcgis-map> I thought I would be able to change the layer name from AerialBW1862 by using a label property in the Layer List component, but it has no effect. I've tried most other relevant-sounding properties, but still no effect. Here is a sample.
... View more
03-28-2025
11:48 AM
|
0
|
2
|
1056
|
|
BLOG
|
Would you know if this transition would have any effect on apps built in the online version of ExB?
... View more
03-26-2025
06:39 AM
|
1
|
0
|
1724
|
|
POST
|
@JHolbrook I was having the same issue with street labels. If you convert labels to annotation then you can layer them below the global background.
... View more
03-17-2025
08:52 AM
|
1
|
0
|
2214
|
|
POST
|
I forgot to mention something. The search point/geocode does not even show up in the Customize Layers list. So I can't uncheck it, intuitively.
... View more
03-12-2025
11:20 AM
|
0
|
0
|
847
|
|
POST
|
ExB Developer v. 1.16 ExB is like whack-a-mole. It takes a long time to get widgets to do what you want. You make one change on one then suddenly that makes a change on another. In my Search widget settings I set it to use a custom symbol to show on the map. I thought I was good. But then I see it's showing as ArcGIS World Geocoding Service in my Map Layers. Why and how can I avoid this?
... View more
03-12-2025
11:03 AM
|
0
|
2
|
857
|
|
POST
|
That gives me a pop-up, but it's of the point layer in the webmap, not an address. I actually have a Near Me widget which gives me all the info I need from the features. So, I'm just looking for the search widget to give me an address and that's it.
... View more
02-14-2025
07:18 AM
|
0
|
1
|
631
|
|
POST
|
@Laura Changing the color or switching off the highlight doesn't remove the yellow square when you hover over the Near Me results. I don't see anywhere in the Map or Search settings, the only other widgets in my ExB build, to turn it off either. I have no idea where the hover is coming from.
... View more
02-13-2025
08:35 AM
|
0
|
1
|
1173
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a week ago | |
| 1 | 3 weeks ago | |
| 1 | 07-24-2025 01:27 PM | |
| 1 | 11-13-2025 08:22 AM | |
| 1 | 11-12-2025 08:37 AM |
| Online Status |
Online
|
| Date Last Visited |
a minute ago
|