Select to view content in your preferred language

How create vertical TextSymbol?

871
3
11-30-2010 08:34 AM
StefhanCampos
Deactivated User
I want create a TextSymbol with vertical alignment how i can do that?
also, i want rotate this symbol...something like this:




each end of polyline, i will add a text.
0 Kudos
3 Replies
AliMirzabeigi
Emerging Contributor
You can set the ControlTemplate of your TextSymbol and apply a RotateTransform for the symbology of your Graphic:
<esri:GraphicsLayer ID="MyGraphicsLayer">
 <esri:Graphic>
  <esri:Graphic.Symbol>
   <esri:TextSymbol FontFamily="Arial" FontSize="14" Foreground="Black">
    <esri:TextSymbol.ControlTemplate>
     <ControlTemplate>
      <Grid RenderTransformOrigin="0.5,0.5">
       <Grid.RenderTransform>
        <RotateTransform Angle ="-90" />
       </Grid.RenderTransform>
       <TextBlock Text="My Text" />
      </Grid>
     </ControlTemplate>
    </esri:TextSymbol.ControlTemplate>
   </esri:TextSymbol>
  </esri:Graphic.Symbol>
  <esri:MapPoint X="-10.609" Y="23.729" />
 </esri:Graphic>
</esri:GraphicsLayer>
0 Kudos
StefhanCampos
Deactivated User
thx for help, how i can automatically rotate text by the end of the polyline, like the image above...have any sample or getting started?
0 Kudos
JenniferNery
Esri Regular Contributor
Another solution is to create your own RotatingTextSymbol by inheriting from MarkSymbol. Add new DependencyProperty for Text, HorizontalAlignment, and Angle.

Create the ControlTemplate such that it contains a TextBlock with RotateTransform. You can bind the TextBlock's Text and HorizontalAlignment to the Symbol's Text and HorizontalAlignment properties. Similarly, you can bind the RotateTransform's Angle to the Symbol's Angle.
0 Kudos