I figured out that I need to set the OffsetX/OffsetY properties. Hardcoding the values managed to center it, but I'd much prefer to calculate the values based on the total size of the ControlTemplate I'm using. Unfortunately I can't seem to find a way to get the size of that at run time.
If you use a custom symbol template, try and place your element so it's centered at 0,0 in it's local coordinate system regardless of size, and you won't have to muck around with offsets.
If you use a custom symbol template, try and place your element so it's centered at 0,0 in it's local coordinate system regardless of size, and you won't have to muck around with offsets.
More specifically what's happening is template's left top corner is placed on the GPS coordinate. I'm not sure what you mean by local coordinate system for the template relative to the map?
I mean relative to the symbol element. Ie. centering rectangle on the parent grid's 0,0 using negative margin (If root is a Canvas, use Canvas.Left/Top): <ControlTemplate> <Grid> <Rectangle Margin="-10,-10,0,0" Width="20" Height="20" Fill="Green" /> </Grid> </ControlTemplate>