Emulates a primitive WMS server (only GetMap requests) that serves Yahoo! satellite images.
This plugin is heavily based on Frederik Ramm <email@example.com> YWMS server in perl (see http://lists.openstreetmap.org/pipermail/dev/2007-January/002814.html), so most of the calculations and documentation is taken from his code. However, this plugin does not need any X server to run, because of a Firefox feature that dumps all loaded pages to PPM files, activated through the environment variable MOZ_FORCE_PAINT_AFTER_ONLOAD, pointing to the directory and prefix of the generated image files.
For each incoming request:
This method can theoretically be used to display maps from any web site where the API supports selecting a geographic region AND includes a call to find out the region actually displayed.
This is required because most such services have discrete zoom levels, while the WMS request issued by josm expects to receive EXACTLY the coordinates requested in an image of the requested pixel size.
To illustrate: <lu> josm says "I want the area (48.5,7.0)-(48.8,7.1) as a 1000x800 pixel image" we ask Yahoo about the best zoom level to display this area on 1000x800 and request the image we ask Yahoo about the extents actually displayed and receive the answer: (48.45,6.95)-(48.85,7.15) This is .4 degrees high (we requested .3 degrees high) and .2 degrees wide (we requested .1 wide). We scale the image to 1333x1600 and cut a 1000x800 section from the middle, knowing that this will now be exactly .3 degrees by .1 degrees (minus projection errors of course!) <lu>
Also, as firefox must be started and killed once and again, it is recommended to create a profile with the option "browser.sessionstore.resume_from_crash" to false and set other profile to default, so no nag screens are shown. </lu>
Public Member Functions
Static Package Attributes