JOSM/Plugins/YWMS
From OpenStreetMap
YWMS is a plugin for JOSM that allows you to use Yahoo! Aerial Imagery as a local WMS server, and therefore as a background in JOSM through the WMS plugin. It uses Firefox to "browse" the Yahoo imagery through the standard Yahoo APIs, and then save the screengrab as an image.
The use of this plugin was at first disallowed by the people at Yahoo!, but they have since taken a closer look at what we are doing, and what their terms-of-use say, and have decided to allow it. See mailing list post
Any modern Gecko browser should work, not only Firefox. However, only Firefox (1.5 < 2.0) has been tested. Firefox 3 beta will not work for some reason; you have to use a copy of Firefox2. Look below for instructions for other browsers.
Contents |
Installation on Windows and GNU/Linux
See Installation on Mac OS X for specific notes.
The installation is largely identical on Windows and on GNU/Linux, the following instructions should apply to both.
- Go to the Edit tab in JOSM and open the Preferences menu. There open the "Configure all available plugins" menu (Plug and Socket icon). Download the YWMS plugin and the WMS plugin by checking the little boxes before them. Then click on "Update current" button on the bottom. After that restart JOSM.
- In the Preferences menu open the new Yahoo tab...
- Set the path to firefox executable (e.g. C:\Program Files\Mozilla Firefox\firefox.exe)
- Set the name of a new profile for firefox (e.g. name it 'josmprofile')
- Click "create". This opens a new browser window. If you see an error about firefox already running, try doing file->exit within Firefox first, to close it down completely.
- Click "Make changes" and accept the question. Close the browser.
- Try using it! See "Using the YWMS plugin" below for details.
Installation on Mac OS X
See Talk:JOSM/Plugins/YWMS for alternative method that does not involve installing X11
On Mac OS X, the standard Firefox's save pages as image feature (PAINT_FORCED_AFTER_ONLOAD) is broken, so you need to use the X11 version, which you can install with fink or darwinports.
Vague instructions (needs someone to try them and add more detail):
For fink:
- Install fink from http://finkproject.org/
- Install X11 from Apple (or possibly from fink) (preinstalled on 10.5 Leopard)
- Install fink package firefox1.5 (on 10.4 Tiger) or firefox2 (10.5 Leopard)
- Note that the path to the firefox executable is /sw/lib/firefox1.5/firefox-bin or /sw/lib/firefox2/firefox-bin (/sw/bin/firefox is not the real executable, and doesn't quite work properly)
or for darwinports:
- Install darwinports
- Install X11 according to darwinports recommendations
- Install darwinports package firefox-x11
- (somebody fill in what the executable path is)
then, to run JOSM:
- Run X11
- Type: "java -jar /path/to/josm.jar" in an xterm
You should then be able to set up the plugin as above.
Testing other browsers
To test if a Gecko browser works with this plugin, do the following:
- Close any browser window already open.
- Set the environment variable MOZ_FORCE_PAINT_AFTER_ONLOAD=/tmp/test.ppm (or any other directory you like)
- Open a new browser window and load any page, i.e., http://www.google.com.
- Look in the directory /tmp (or the one you used) for .ppm images named test.ppm-1, test.ppm-2, ... One of them should be the dump of the loaded page.
If the image is not there, or it is not a dump of the loaded page, the browser is not useful for this plugin. This happens, for example, with the standard Firefox in Mac OS X.
Using the YWMS plugin
After installing the plugin (described above), you can start mapping with Yahoo! Aerial Imagery.
- Load / Download map data and go to your favorite area
- Click the menu option "WMS → Yahoo"
A firefox window should open briefly. This is the plugin performing an image grab. An image should appear, as a layer within JOSM. Fetching more images doesn't happen automatically as you pan around. Use the menu option again.
To map over the top of the image, you need to show the 'layers' panel (bottom left toolbar button), then select the data layer. You might also like to adjust the colour settings (in 'preferences') to make the map data lines brighter.
See Using Yahoo! Aerial Imagery for details of how we might modify our mapping process to make use of the imagery.
Troubleshooting
- If you get a NoSuchMethod error while opening the plugin window. You need a later version of JOSM with recent enhancements to plugin support.
As YWMS plugin has nearly no frontend, all errors appear while requesting images through the WMS plugin, with a "500 error". If you get this error, try the following:
- If firefox didn't open, check that the right executable path is set in preferences.
- If firefox opened, it loaded the satellite images, it closed, and JOSM gave a 500 error, it could be that the profile wasn't set up correctly. Try setting it up again using the button in the preferences.
- In Firefox 2.0.0.12 I solved the problem adding the boolean key browser.dom.window.dump.enabled in mozilla, under the profile used by the plugin. Simply digit about:config in the navigation bar, then new-->boolean. Add "browser.dom.window.dump.enabled" as name, "true" as value. --Danilo 13:13, 9 February 2008 (UTC)
- If you do the setup, and there's no entry on the WMS menu, you can add one manually in the Preferences. The values you want are "Yahoo" and "http://localhost:8000/ymap?request=GetMap&format=image/jpeg"
- If you install the ywms plugin, and can't find the WMS menu, you probably haven't installed the wmsplugin, which is required.
- If firefox opened, it loaded the satellite images, it closed, and JOSM received the image, don't worry. This is JOSM bug #114: it shows previous errors even though the request is OK. Just restart JOSM to fix it.
- Check that no other browser window with same profile is still open.
- If after installation your bookmarks are gone, you started Firefox in a new profile. To change back to the original profile, go to Windows Start menu -> Run... and type firefox.exe -P ENTER. This opens the profile manager. Then change the profile back to default. Restart Firefox, and it opens in the original profile. YWMS should still work.
- If you are using Firefox 3, as your main browser, YWMS will not work for some reason. You must install a copy of Firefox 2, and use that instead. However, if Firefox 3 is already running it will use that window instead. To open both versions at the same time, use the -profile switch to open the profile manager. "firefox-2 -P" should work for Linux.
If none of the above applies, start JOSM on the command line (java -jar josm-latest.jar) and look for any informative message.
Firefox proxy settings (if needed)
If you're behind a http proxy you need to make sure the proxy settings are carried over to the new Firefox-profile. If you suspect this might not have happened, try the following:
- close all instances of firefox
- change into the mozilla profile directory for the plugin i.e. ".mozilla/firefox/*.josmprofile/" (the default profile is located in ".../*.default")
- look for the settings "network.proxy.*", "network.proxy.backup.*" in "prefs.js" and edit appropriately (or copy the settings from "../*.default/prefs.js").
Dont forget to save!
NoScript
If you have installed the NoScript plugin, you need to enable scripting, either globally, or for the following:
- file://
- yahoo.com
- yimg.com
(Remember that this should be done under your JOSM profile, and not your default profile.)
Torbutton
If you have Torbutton installed and Firefox closes right after it is opened check that the option "Block Tor access to network from file:// urls" in Torbutton Preferences --> Security Settings is disabled.

