Select to view content in your preferred language

Create Label Symbol for Interstate

326
3
03-06-2024 08:06 AM
kapalczynski
Regular Contributor

I have a line feature that I want to Label with an interstate symbol and put text in it from a field... 

Not sure how to so this with Javascript Api 4.x

I see here that you can label by creating a label class and applying it to the Feature Layer but not sure how to make it an interstate Shield and populate the text via a field value

https://developers.arcgis.com/javascript/latest/sample-code/labels-basic/

Thoughts?

0 Kudos
3 Replies
MatthewDriscoll
MVP Alum

Maybe a Picture Marker Symbol?  Maybe play around in the symbol builder?  Honestly it might be easiest to create in Pro and host it.

0 Kudos
BlakeTerhune
MVP Regular Contributor

It looks to be possible, but I'm not sure how to implement it. I've not worked with CIMSymbol.

Esri Web Style Symbols (2D) | Overview | ArcGIS Maps SDK for JavaScript 4.29 | ArcGIS Developers

Maybe this video demo on Dynamic Vector Symbology will help.

0 Kudos
JohnGrayson
Esri Regular Contributor

As Matt suggested, I too would recommend the use of CIMSymbols and the symbol builder app which is a great way to help us get started. I used the symbol builder to mock up the symbol json for the line layer and then I updated one of the samples to create this CodePen, which I then further tweaked to connect the label text to a feature attribute via the primitive overrides and Arcade.  Hopefully these links will help in your task.