Select to view content in your preferred language

How to remove the miles annotation from the ScaleBarOverlay

4447
1
Jump to solution
01-01-2015 11:44 AM
JerrySchultz
Occasional Contributor

The ScaleBarOverlay is instantiated showing both KM and Miles. I would like to remove the miles annotation but so far have been unable to find any method to accomplish this. Can anyone suggest how to get this done.

0 Kudos
1 Solution

Accepted Solutions
VijayGandhi
Deactivated User

Hi Jerry,

We don't an API to do that. However, since the source code of ScaleBarOverlay is publicly available, you could customize it.

Here is the source code of ScaleBarOverlay that does not display miles - ScaleBarOverlay without miles.

The changes made are:

1) In createScaleBar(), I have commented out the code that was creating the second row and text (miles).

2) In onPaint(), I removed code that was drawing the second row and text.

View solution in original post

0 Kudos
1 Reply
VijayGandhi
Deactivated User

Hi Jerry,

We don't an API to do that. However, since the source code of ScaleBarOverlay is publicly available, you could customize it.

Here is the source code of ScaleBarOverlay that does not display miles - ScaleBarOverlay without miles.

The changes made are:

1) In createScaleBar(), I have commented out the code that was creating the second row and text (miles).

2) In onPaint(), I removed code that was drawing the second row and text.

0 Kudos