7
$\begingroup$

I'm plotting the GeoScaleBar over satellite image and wish it to be white but cannot find an option which controls its styling:

GeoGraphics[{EdgeForm[Yellow], FaceForm[], Entity["Ocean", "BlackSea"]["Polygon"]}, 
 GeoServer -> {StringTemplate[
    "http://khms<*Mod[#2+#3,4]*>.googleapis.com/kh?x=`2`&y=`3`&z=`1`&v=196"], 
    "ZoomRange" -> {1, 21}}, 
 GeoScaleBar -> Placed[Quantity[Range[0, 900, 100], "Kilometers"], Scaled[{.13, .25}]]]

GeoGraphics

(for future: in the above StringTemplate the version number of Google maps v=196 may require updating to the current version number).

How to control the styling of GeoScaleBar?

$\endgroup$
  • 1
    $\begingroup$ It's very odd isn't it? You can say BaseStyle -> White and the line goes white and that's it. You can change the FontFamily, the FontSize, even the FontSlant, but FontColor has no effect. $\endgroup$ – Jason B. Feb 25 '16 at 14:22
5
$\begingroup$

Hmm, I can't find any way to give GeoScaleBar options, but all it does is produce some Line and Text graphics that we can alter after with some simple replacement rules:

    g = GeoGraphics[...];

    g /. {
      Line[x_] :> {Red, Thick, Dashed, Line[x]},
      Text[x_, y__] :> Text[Style[x, Red, 14, Bold], y]
      }

enter image description here

You can see the structure of the graphic at g[[1,1]], towards the end are the Line and Text objects we're changing the formatting of.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.