[OSM-dev] [RFC] Scale bar

Jan-Benedict Glaw jbglaw at lug-owl.de
Sat May 13 17:00:42 BST 2006


On Sat, 2006-05-13 14:48:01 +0100, SteveC <steve at asklater.com> wrote:
> * @ 12/05/06 09:19:50 PM jbglaw at lug-owl.de wrote:
> > I'm quite new to OSM, signed up just some days ago. I'm /not/ a Java
> > hacker (but I'm quite used to C) and thus I tried to address a problem
> > I faces with the online editing applet: the missing scale bar
> > disturbed me a lot. That's also a bug in the trac'ker.
> > 
> > Not being really familiar with the Java stuff, I implemented a
> > statically sized status bar and a text that points out the bar's
> > length in meters. (-> So this is basically always a floating value and
> > not something "nice.")
> 
> applied, cheers!

Thanks.  Though I don't like the thickness of the lines.

> Tom: How do you make the text non-transparent and use a better font?

The font is IMHO okay (at least for me),  but it could be a bold and
maybe a bit larger.

> I'll look at making the bar 'nice' lengths.

I've got a good idea about it. All that's missing is

  * round
  * fabs
  * log

in Java. How are these called?

The idea is to break the expected bar length down to a 10'th
logarithm wrt. the scale, subtracting the round()ed value and
comparing the result (-1 <= x <= 1) with the log()s of 1, 2.5 and 5
(and 1/1, 1/2.5 and 1/5.)  That way, we can decide on a proper value
which needs an additional factor of 10^x. The bar can then be scaled
properly.

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw at lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 für einen Freien Staat voll Freier Bürger"  | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20060513/7d19f914/attachment.pgp>


More information about the dev mailing list