Select to view content in your preferred language

Highway shields in custom basemaps

416
3
Jump to solution
03-06-2026 01:23 PM
TWChi
by
Occasional Contributor

I'm creating a custom basemap for my organization. I started with the Light Gray Canvas base because I want my custom basemap to be fairly simple. I've edited all the colors and have it looking pretty much the way I want it, except for the highway shields. The Light Gray Canvas basemap uses rectangles for all highway shields which I've always thought was a strange choice. I want to use the more common highway shields like most of the other basemaps use. 

I have downloaded the shields used in the Streets basemap and then added them to my custom basemap. The problem I am running into is that every road in the Light Gray Canvas basemap uses the same shield. So if I change the rectangle to an interstate highway shield, every shield on my map becomes an interstate highway shield even if it's a US or state highway. I think I need to somehow classify the roads in order to be able to assign the right type of shield to each road but I don't know the best way of going about this.

Can I copy and paste the relevant section of JSON code from the Streets basemap into my custom basemap? If so, which sections should I use?  Or would it be easier to start over using a different basemap that has the shields I want? I spent a full day creating my custom basemap so I'd rather not start over if possible.

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
CalvinHarmin
MVP

I think I see how to do this. The gist is that you need to

  • Open and save a copy of the World Street Map (WSM) vector tile style. 
    • This is required for you to be able to 'download' the shield png icon(s) that you want to use in your Light Gray Canvas (LGC) style.
  • Manually navigate to your area of interest in the WGS style editor and review the available Roads/Shield layers until you find the one(s) controlling the road type labels that you want to customize the label for in LGC. 
    • When you find the relevant shield labels, go to Edit JSON for that layer.
    • Note the id  integer id for the "_label_class" property and the "icon-image" name. 
      • label class.png
    • Download the relevent icon png's from WGS from the 'Edit icon and patterns' menu. In my example, the icon-image name is called "Road/label/Secondary Hwy white black".
      • icon download.png
    • Once you've downloaded it, then go back to your LGC and 'Add' (upload) the png into the icon menu for your LGC and give it a name you can easily type (you'll use this name later). 
      • upload.png
  • In your LGC layer menu, 'duplicate' the highway shield icon layer in the Light Gray Canvas - I believe if we're looking at the same thing it would be called "Road/label/Rectangle white black".
  • edit the JSON for this new layer to change it's id (name) for your own benefit, and edit the JSON to only include the integer reference(s) for the road types you want to label (don't include a comma following the integer if it's the only (or final) integer); also remove that particular integer id from the JSON of the 'original' layer above it so they both aren't trying to display an icon/label for it.
  • update the "icon-image" name property with the icon name that you have added from the World Street Map vector style.
    • updated.png

 

I think after you get your proof of concept for this process, then you may need to dive into how you want to customize it further to fit in with your other style changes.

View solution in original post

0 Kudos
3 Replies
CalvinHarmin
MVP

I think I see how to do this. The gist is that you need to

  • Open and save a copy of the World Street Map (WSM) vector tile style. 
    • This is required for you to be able to 'download' the shield png icon(s) that you want to use in your Light Gray Canvas (LGC) style.
  • Manually navigate to your area of interest in the WGS style editor and review the available Roads/Shield layers until you find the one(s) controlling the road type labels that you want to customize the label for in LGC. 
    • When you find the relevant shield labels, go to Edit JSON for that layer.
    • Note the id  integer id for the "_label_class" property and the "icon-image" name. 
      • label class.png
    • Download the relevent icon png's from WGS from the 'Edit icon and patterns' menu. In my example, the icon-image name is called "Road/label/Secondary Hwy white black".
      • icon download.png
    • Once you've downloaded it, then go back to your LGC and 'Add' (upload) the png into the icon menu for your LGC and give it a name you can easily type (you'll use this name later). 
      • upload.png
  • In your LGC layer menu, 'duplicate' the highway shield icon layer in the Light Gray Canvas - I believe if we're looking at the same thing it would be called "Road/label/Rectangle white black".
  • edit the JSON for this new layer to change it's id (name) for your own benefit, and edit the JSON to only include the integer reference(s) for the road types you want to label (don't include a comma following the integer if it's the only (or final) integer); also remove that particular integer id from the JSON of the 'original' layer above it so they both aren't trying to display an icon/label for it.
  • update the "icon-image" name property with the icon name that you have added from the World Street Map vector style.
    • updated.png

 

I think after you get your proof of concept for this process, then you may need to dive into how you want to customize it further to fit in with your other style changes.

0 Kudos
TWChi
by
Occasional Contributor

Thanks so much for the response! I hadn't thought of duplicating the highway shield layer for each road class - that's a good idea and it definitely helped.

I also found an alternate solution which is to create a "sandwich" basemap with the labels as a completely separate file. Here's a blog post about it:

https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/basemap-sandwiches-and-label-layers

CalvinHarmin
MVP

That makes perfect sense! I wasn't sure if you were using the 'unified' Light Grey Canvas or the 'sandwich' version with the split reference/base. Sandwich is a great term for that  😄

0 Kudos