Select to view content in your preferred language

Point symbol with number in the middle

4358
4
Jump to solution
12-20-2012 10:59 AM
Labels (1)
JeremyCampbell1
New Contributor
Hopefully an easy one, although I haven't been able to find a solution in the samples or online.
What I want is to render a point with a number in the middle, is there an easy way to do this ? The cluster object (shown below) has this format however I'm not after a cluster - the number is a sequence number.
[ATTACH=CONFIG]20118[/ATTACH]
0 Kudos
1 Solution

Accepted Solutions
AnttiKajanus1
Deactivated User
Hi,
Here is one way to do it. Code from the hat and is not tested.


 
  <esri:SimpleMarkerSymbol x:Key="Circle" OffsetX="9" OffsetY="9">     <esri:SimpleMarkerSymbol.ControlTemplate>         <ControlTemplate>             <Grid>                  <Ellipse Fill="Red" Width="18" Height="18" Stroke="White" StrokeThickness="1"></Ellipse>                   TextBlock Text="1" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>                  </Grid>          </ControlTemplate>      </esri:SimpleMarkerSymbol.ControlTemplate>          </esri:SimpleMarkerSymbol>


with regards,
Antti

View solution in original post

0 Kudos
4 Replies
AnttiKajanus1
Deactivated User
Hi,
Here is one way to do it. Code from the hat and is not tested.


 
  <esri:SimpleMarkerSymbol x:Key="Circle" OffsetX="9" OffsetY="9">     <esri:SimpleMarkerSymbol.ControlTemplate>         <ControlTemplate>             <Grid>                  <Ellipse Fill="Red" Width="18" Height="18" Stroke="White" StrokeThickness="1"></Ellipse>                   TextBlock Text="1" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>                  </Grid>          </ControlTemplate>      </esri:SimpleMarkerSymbol.ControlTemplate>          </esri:SimpleMarkerSymbol>


with regards,
Antti
0 Kudos
FranklinEbner
Emerging Contributor
Assuming the numbers are relatively small, you could use a simple label and to make it appear inside the symbol, go to 'Placement Properties' then select the 'Place label on top of the point' option.
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

I'd recommend using PictureMarkerSymbols to achieve this. You will then still be able to use the accelerated display mode (which a controltemplated symbol would prevent you from doing).

Cheers

Mike
0 Kudos
JeremyCampbell1
New Contributor
I had a look at the options, thanks for the replies!

I liked the solution from Antti, it was straight forward and did what I needed. The number in the middle was an attribute from my database, I was able to bind this to display the unique sequence number (this looked a bit harder using a PictureMarkerSymbol).

I was using the accelerated display mode, using the accelerated display layers collection I was able to keep some layers as accelerated - specifically the basemap.

I have re posted the snippet below, there was a minor typo - missing an angle bracket;

<esri:SimpleMarkerSymbol x:Key="Circle" OffsetX="9" OffsetY="9">
[INDENT]<esri:SimpleMarkerSymbol.ControlTemplate>
[INDENT]<ControlTemplate>
[INDENT]<Grid>
[INDENT]<Ellipse Fill="Red" Width="18" Height="18" Stroke="White" StrokeThickness="1"></Ellipse>
<TextBlock Text="1" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>[/INDENT]
</Grid>[/INDENT]
</ControlTemplate>[/INDENT]
</esri:SimpleMarkerSymbol.ControlTemplate>[/INDENT]
</esri:SimpleMarkerSymbol>

Jeremy.
0 Kudos