[josm-dev] Walking Papers Plugin broken
Frederik Ramm
frederik at remote.org
Fri Nov 6 15:14:53 GMT 2009
Hi,
I'm investigating this bug:
http://josm.openstreetmap.de/ticket/3855
The Walking Papers plugin is based on the old Slippy Map plugin, and the
code that leads to this bug roughly does this:
public void paint(Graphics g, MapView mv) {
LatLon topLeft = mv.getLatLon(0, 0);
LatLon botRight = mv.getLatLon(mv.getWidth(), mv.getHeight());
viewportMinX = lonToTileX(topLeft.lon());
viewportMaxX = lonToTileX(botRight.lon());
viewportMinY = latToTileY(topLeft.lat());
viewportMaxY = latToTileY(botRight.lat());
for (int x = viewportMinX-1; x <= viewportMaxX; x++) {
for (int y = viewportMinY-1; y <= viewportMaxY; y++) {
WalkingPapersKey key = new WalkingPapersKey(currentZoomLevel, x, y);
That's where it arrives at ridiculous values like 2147483647 for x and
-104914 for y.
Before I delve further into this - is this perhaps a consequence of
Dirk's recent change in the projection stuff? Is there an easy
workaround, or should I perhaps re-write the whole plugin based on the
*new* Slippy Map code which (I hear) is totally different?
Bye
Frederik
More information about the josm-dev
mailing list