Question for TextSymbol issue in 3D SceneView

1158
3
06-21-2017 08:07 AM
KyongGuKang
New Contributor

We have found a problem with the alignment of TextSymbol in 3D SceneView.

We applied the alignment of the TextSymbol included in CompositeSymbol to HorizontalAlignment = Center, VerticalAlignment = Middle, and added several corresponding Graphics to the GraphicsLayer.

If we add this GraphicsLayer to a 2D MapView, you would see a text which is in the center of the image, as shown in the image below.

However, we added the same GraphicsLayer to the 3D SceneView then the text in the center of the CompositeSymbol was displayed at the wrong position, as also shown in the image below.

This offset was changed everytime, when we create and add a new Graphics.
Also, whenever we MouseOvered at Graphic, the position of the number was shifted. 

And sometimes when rotating maps by clicking right button of the mouse, text's bold style was turned into Normal style .

In Addition, as you can see in the picture below, the Text was then come out in front of any other Symbols.

 

Does someone who knows about this problem, I would like to ask if there is a way to solve it.

 

We are using ArcGIS Runtime SDK for .Net Ver 10.2.7.

0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor

Hi KyongGu,

Thanks for your feedback. I see you're reporting two issues here

1 - Text alignment not respected by symbol

2 - Text rendered topmost (issue when overlapping graphics)

I'm able to reproduce both with the following code:

        xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
    <Grid>
        <esri:SceneView x:Name="MySceneView" SceneViewTapped="MySceneView_SceneViewTapped">
            <esri:Scene>
                <esri:ArcGISTiledMapServiceLayer ServiceUri="http://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer" />
            </esri:Scene>
            <esri:SceneView.GraphicsOverlays>
                <esri:GraphicsOverlay />
            </esri:SceneView.GraphicsOverlays>
        </esri:SceneView>
    </Grid>

        private void MySceneView_SceneViewTapped(object sender, MapViewInputEventArgs e)
        {
            var overlay = MySceneView.GraphicsOverlays[0];
            var symbol = new CompositeSymbol();
            symbol.Symbols.Add(new SimpleMarkerSymbol() { Style = SimpleMarkerStyle.Circle, Color = Colors.Gray, Size= 20d, Outline = new SimpleLineSymbol() { Style = SimpleLineStyle.Solid, Color = Colors.Black, Width = 2d } });
            symbol.Symbols.Add(new TextSymbol() { Text = "#", HorizontalTextAlignment = HorizontalTextAlignment.Center, VerticalTextAlignment = VerticalTextAlignment.Middle });
            overlay.Graphics.Add(new Graphic(e.Location, symbol ));
        }

The alignment issue is fixed in v100. Unfortunately, I don't have a workaround to offer for the version you're using. Are you able to upgrade?

The rendering issue is currently by design for GraphicsOverlay with (RenderingMode=Dynamic), which is the default. I'll forward your feedback to the team for consideration to accommodate the graphics and symbol collection order.

Thanks.

KyongGuKang
New Contributor

Hi, Jennifer

Thank you for your reply. Your answer was helpful.

2 - When used with GraphicsOverlay, we found that no topmost problems were found. 

But, As you know we want to use GraphicsLayer. I look forward to hearing from you about the solution.

3 - Could you answer questions about changing font weight issue? I've set fontweight to bold, but sometimes it's changing to normal.

textSymbol = new TextSymbol()
{
VerticalTextAlignment = VerticalTextAlignment.Middle,
HorizontalTextAlignment = HorizontalTextAlignment.Center,
AngleAlignment = MarkerAngleAlignment.Screen,
Font = new SymbolFont("Arial", 12, SymbolFontStyle.Normal, SymbolTextDecoration.None, SymbolFontWeight.Bold),
//YOffset = -5,
Text = count.ToString(),
};

Thank you.

0 Kudos
JenniferNery
Esri Regular Contributor

GraphicsOverlay and GraphicsLayer behave the same under same RenderingMode so when you say

Text was then come out in front of any other Symbols

this is by current design, which may be noticeable when you have overlapping graphics and/or symbols added after TextSymbol in a CompositeSymbol symbol collection.

As for your third case, I added a few screen shots top-left graphic is in bold, bottom-right graphic is in normal font weight. You're right that at FontSize=12, bold and normal seem identical.

If you increase font size (i.e. FontSize=20), the weight difference becomes much more noticeable.

If you are looking for an identical symbol as rendered in your 2D map in a 3D scene using v10.2.x, you can create an image of your CompositeSymbol and use PictureMarkerSymbol instead, will that work for you? This should avoid alignment, weight and rendering differences for TextSymbol. Alternatively if it is an option for you, you can upgrade to v100.

Thanks.

0 Kudos