ThinkGeo.com    |     Documentation    |     Premium Support

Set the position of a ScaleLineAdornmentLayer

Hey there.


 


Would it be possible to open up the positioning of the ScaleLineAdornmentLayer? I'd like to be able to set it's position based on an absolute point. So something like this...


ScaleLineAdornmentLayer.Location = new ScreenPointF(x,y);


Would that be possible in a future release?



Brendan,


  We should have been able to do this with inheritance but we didn’t make the GetDrawingLocation virtual.  In the future we will do this so you can have full control over the positioning. We will also add another overload for you to override the location using a simple ScreenPointF as well. For now we have work around for you. What we do provide is an X & Y offset. The problem for you is that the location is first determined by considering the width and height of the screen along with some other calculations that you do not have access to. What I can tell you is that Location.UpperLeft is screen point 0,0 so choose that and control the positioning from the X & Y offsets.  This is a hack but it will allow you to do what you want until we get the virtual method in place and the new constructor.  I hope this helps for now.


David



Thanks David. It’s not something we need immediately. I’ll play with the work around in the meantime.

Brendan, 
  
 We have added AdornmentLocation.UserOffsets to the AdornmentLocation enumeration and made AdornmentLayer.GetDrawingLocation virtual so you can override the drawing position yourself. The latest version (which will be released on Dec.12th) will include the changes. 
  
 Ben 


Thanks for this Ben.

Always my pleasure. Brendan