On 1/18/07, <b class="gmail_sendername">Nick Burch</b> <<a href="mailto:openstreetmap@gagravarr.org">openstreetmap@gagravarr.org</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thu, 18 Jan 2007, Frederik Ramm wrote:<br>> It is a difficult topic as current agreements seem to allow only access<br>> through their JavaScript API which cannot be directly controlled from<br>> within a Java application.
<br><br>Java 1.6 has a javascript runtime built in. Has anyone had a chance to<br>play with it? (I was thinking we could use it to load the yahoo js,<br>provide override the image display functions, and use this to grab the
<br>images. However, I don't know if that sort of thing is possible with the<br>Java 1.6 JS stuff)</blockquote><div><br>You just need the rhino JAR to be able to run javascript (<a href="http://www.mozilla.org/rhino/">
http://www.mozilla.org/rhino/</a>), which is probably better than putting a reliance on 1.6.<br>Unfortunately, the yahoo JS will rely heavily on the browser DOM to do things like download images, decide where to put things etc. So while running js from java is easy (about 3 lines of code), the complicated bit of embedding in something like JOSM would be to properly mock the browser environment with enough detail to get the yahoo js to actually run without throwing errors.
<br>I was actually gonna take a look at how complicated this might be at the weekend. I'm guessing not easy.<br>If anybody knows of an open source mock broswer dom project... that would probably help.<br><br>What I'd avoid doing is trying to reverse engineer yahoo's js, and figuring out which bits could be overridden... firstly yahoo might not like that, and secondly, any change in their code would almost certainly break any implementation.
<br></div><br></div><br>