I am creating a poly line graphic to add to a sceneView for a SwiftUI app. Is there any way to add a text label along this line?
Ideally I would like a box with some text inside it along the direction of the line in the middle of the line if that's achievable.
let polyline = Polyline(
points: [
point1,
point2
]
)
let polylineSymbol = SimpleLineSymbol(style: .solid, color: .cyan, width: 2.0)
let polylineGraphic = Graphic(geometry: polyline, symbol: polylineSymbol)
Solved! Go to Solution.
🤣 Spatial puns are the best kind!
I recommend avoiding CompositeSymbol. It has a more modern equivalent in the MultiLayerSymbol, although this does involve a more complex object model. A great way to work with these newer multi layer symbols is to use ArcGIS Pro to create symbols and then put them in a mobile style file (a sqlite database under the hood) and then you can search and retrieve those symbols from the mobile style and apply to your features or graphics.
We don't currently have a Swift sample for this (on the roadmap), but conceptually you can refer to these existing .NET samples:
Our cartographer John Nelson publishes some lovely desktop styles that you can open in ArcGIS Pro and copy into a mobile style file and then use in the Native Maps SDKs - see this ArcGIS Online search for his current range.
Apologies for the very late response. Just want to let you know this question is still under my radar and I'll post updates once I get feedback from our text feature team.