[OSM-dev] New Yahoo plugin concept and its problems

Rainer Rothkegel rainer.rothkegel at googlemail.com
Mon Apr 7 10:27:37 BST 2008


There is a Java Project called RouteConverter, which seems to use a similar
approach. GPS Routes are shown in an embedded browser which displays Google
Maps and OSM maps. If you haven't seen it, it might be worth taking a look:
http://www.routeconverter.de . It works fine on Windows but it has some
problems displaying maps on Linux systems.

Cheers, Rainer

The idea is the following: embed a Firefox inside JOSM to display a dynamic
>
>
> background of Yahoo images, or better, an OpenLayers canvas with many layers
> (Yahoo, Osmarender, Mapnik...)
>
> Some time after coding the Yahoo plugin, I started investigating another
> approach to the plugin, but didn't get to anywhere because of the immature
>
>
> status of the libraries to be used. Recently, because of some problems
> reported with this plugin (firefox window not closing in linux, and today
> reported error with FF3), I revised the libraries to see if they are more
>
>
> mature, and found that it may be usable [1]. There are several libraries
> that can embed a browser in Java, but currently only two libraries that I
> know are still supported and in development: SWT [2] and MozSwing [3].
>
>
>
> The first one is the library used by the Eclipse project (from IBM), and is
> heavily supported and developed.It supports native browsers (IE, FF,
> Safari), but requires a big download per O.S.  The second one is a new
>
>
> library, still under development, but very promising. Supports only FF, but
> until some patches are included in the final FF branch, a big download (a
> custom XUL Runtime) is also needed.
>
> Anyway, I tried to create the plugin, but found a big problem: every
>
>
> implementation uses an AWT component (heavyweight) for the browser, and so,
> it does not integrate well with our Swing (lighweight) program. The current
> JOSM Layer design only works with Swing components, since it provides a
>
>
> Graphics object to paint on, but AWT components don't paint on them, they
> paint directly on a native canvas. I tried to capture an image of the native
> browser canvas and paint it on the Graphics object, but it is painfully
>
>
> slow. One way I thought yesterday late was to code the browser not as a
> plugin, but as a feature of JOSM itself, by adding a permanent layer below
> every other layer in the MapFrame class with a JLayeredPane. However, I
>
>
> haven't even tested if it could be done. Is the new JOSM-ng going to manage
> layers the same way that current JOSM?
>
> Other problem I found is that the AWT/Swing browser integration requires
> Java 6 in some platforms (i.e. Linux), and even some glue library in MacOs.
>
>
>
> Since I am not too skillfull with AWT/Swing problems, I'm now stuck. Has
> anyone here worked with AWT/Swing integration problems?
>
> Regards,
> Quico
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20080407/7350c0ba/attachment.html>


More information about the dev mailing list