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
|
237
|
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
|
274
|
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
|
374
|
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
|
228
|
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
|
276
|
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
|
305
|
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
|
313
|
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
|
395
|
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
|
433
|
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
|
463
|
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
|
342
|
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
|
387
|
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
|
482
|
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
|
260
|
Title | Kudos | Posted |
---|---|---|
1 | 01-17-2019 08:21 AM | |
1 | 07-06-2023 07:08 AM | |
1 | 03-26-2025 06:39 AM | |
1 | 07-31-2024 07:55 AM | |
1 | 03-17-2025 08:52 AM |
Online Status |
Offline
|
Date Last Visited |
Tuesday
|