How to display AGSRasterLayer beneath roads?

522
2
Jump to solution
05-10-2019 02:23 AM
JordanAhee1
New Contributor

Hi,

I'm trying to display couple of layers on map, but I would like to have all roads on top, so all my layers would be beneath them. Is this even possible? I've spent many days on finding the solution but without success. 

0 Kudos
1 Solution

Accepted Solutions
Nicholas-Furness
Esri Regular Contributor

Hi,

There are ways to do that for sure but it depends on the basemap that you're using.

You could check out this post which describes adding the World Transportation Layer to your basemap and making it a Reference Layer for that basemap, which means it'll be rendered above all your own layers (in this case the AGSRasterLayer).

Note that everything described in that process can be done in code in the Runtime if you're building your map that way rather than using a web map. See AGSBasemap, in particular the referenceLayers and baseLayers properties.

If you're using vector tile layers, you could use the Vector Tile Style Editor to create two custom styles. One with just the roads category visible (be sure to also turn off the background), and another "opposite" style with them not visible but everything else visible. Use them both in your basemap as described above (the roads only one would be a basemap reference layer, the "opposite" one would be a basemap base layer).

Note, you will want to include a lot of the Labels from various categories in the reference layer rather than the non-reference layer, or they'll appear behind the roads too which makes the map unreadable pretty rapidly. The Vector Tile Style Editor allows you to click on a label in the live preview to find it in the layers list.

It's a bit fiddly but will work for what you need.

See this web map for an example.

View solution in original post

2 Replies
Nicholas-Furness
Esri Regular Contributor

Hi,

There are ways to do that for sure but it depends on the basemap that you're using.

You could check out this post which describes adding the World Transportation Layer to your basemap and making it a Reference Layer for that basemap, which means it'll be rendered above all your own layers (in this case the AGSRasterLayer).

Note that everything described in that process can be done in code in the Runtime if you're building your map that way rather than using a web map. See AGSBasemap, in particular the referenceLayers and baseLayers properties.

If you're using vector tile layers, you could use the Vector Tile Style Editor to create two custom styles. One with just the roads category visible (be sure to also turn off the background), and another "opposite" style with them not visible but everything else visible. Use them both in your basemap as described above (the roads only one would be a basemap reference layer, the "opposite" one would be a basemap base layer).

Note, you will want to include a lot of the Labels from various categories in the reference layer rather than the non-reference layer, or they'll appear behind the roads too which makes the map unreadable pretty rapidly. The Vector Tile Style Editor allows you to click on a label in the live preview to find it in the layers list.

It's a bit fiddly but will work for what you need.

See this web map for an example.

JordanAhee1
New Contributor

Thanks for the answer, It worked  

0 Kudos