ThinkGeo.com    |     Documentation    |     Premium Support

Text outline for ScaleLine and MouseCoordinate

Hi,

What is the best method to set an outline / stroke for ScaleLine and MouseCoordinate?

My map is often used to view images that are either very dark or very bright.
So I need to change the style of text and lines in Scaleline and MouseCoordinate to one with a black fill / foreground and a white outline/stroke.

Hi Yohan,

The only you can changed is the text color, it looks I hadn’t found a way to modify the line color.

Please view the code as below:

  map.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("Green"));

 map.MapTools.ScaleLine.IsEnabled = true;            
 map.MapTools.ScaleLine.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("Blue"));

 map.MapTools.MouseCoordinate.IsEnabled = true;            
 map.MapTools.MouseCoordinate.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("White"));

Regards,

Ethan

Hi Ethan,

I don’t think just changing the text color will work. There is an “Effect” property for ScaleLine and MouseCoordinate, so maybe we can set it there?

The scale line in MapSuiteGisEditor sample has an outline, so there should be a way to set it:

If that doesn’t work, is there a way to set the background of ScaleLine and MouseCoordinate to white? I tried setting the “background” property, but there were no effect.

Hi Yohan,

We created one sample to show you how to implement that. Please refer the attachment.
Post9109.zip (10.3 KB)

If you need any more information, please let me know that.

Thanks
Mark

Thank you for the example, Mark.

Is there a similar adornmentLayer for mouse coordinate ?

Hi Yohan,

We don’t have an adornmentlayer for mouse coordinates, please view attached sample which shows how to implement it.

9109.zip (11.0 KB)

Regards,

Ethan

Thank you, Ethan.

That is exactly what I needed.

Hi Yohan,

I am glad to hear that works.

Regards,

Ethan