Changeset 18597 in osm for applications/editors/josm/plugins/walkingpapers
- Timestamp:
- 2009-11-14T20:01:49+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/walkingpapers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/walkingpapers/.project
r16522 r18597 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <projectDescription> 3 <name> slippymap</name>3 <name>JOSM-walkingpapers</name> 4 4 <comment></comment> 5 5 <projects> -
applications/editors/josm/plugins/walkingpapers/build.xml
r18404 r18597 26 26 <attribute name="Plugin-Description" value="Supports downloading tiled, scanned maps from walking-papers.org. This plugin is still under early development and may be buggy."/> 27 27 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/WalkingPapers"/> 28 <attribute name="Plugin-Mainversion" value="2 323"/>28 <attribute name="Plugin-Mainversion" value="2450"/> 29 29 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 30 30 </manifest> -
applications/editors/josm/plugins/walkingpapers/src/org/openstreetmap/josm/plugins/walkingpapers/WalkingPapersLayer.java
r18484 r18597 5 5 import java.awt.Color; 6 6 import java.awt.Component; 7 import java.awt.Graphics ;7 import java.awt.Graphics2D; 8 8 import java.awt.Image; 9 9 import java.awt.Point; … … 30 30 /** 31 31 * Class that displays a slippy map layer. Adapted from SlippyMap plugin for Walking Papers use. 32 * 32 * 33 33 * @author Frederik Ramm <frederik@remote.org> 34 34 * @author LuVar <lubomir.varga@freemap.sk> 35 35 * @author Dave Hansen <dave@sr71.net> 36 * 36 * 37 37 */ 38 38 public class WalkingPapersLayer extends Layer implements ImageObserver { … … 55 55 private String tileUrlTemplate; 56 56 private String walkingPapersId; 57 57 58 58 @SuppressWarnings("serial") 59 59 public WalkingPapersLayer(String id, String tile, Bounds b, int minz, int maxz) { … … 66 66 this.minzoom = minz; this.maxzoom = maxz; 67 67 currentZoomLevel = minz; 68 68 69 69 clearTileStorage(); 70 70 71 71 Layer.listeners.add(new LayerChangeListener() { 72 72 public void activeLayerChange(Layer oldLayer, Layer newLayer) { … … 182 182 */ 183 183 @Override 184 public void paint(Graphics g, MapView mv) {184 public void paint(Graphics2D g, MapView mv, Bounds bounds) { 185 185 LatLon topLeft = mv.getLatLon(0, 0); 186 186 LatLon botRight = mv.getLatLon(mv.getWidth(), mv.getHeight()); 187 Graphics oldg = g;187 Graphics2D oldg = g; 188 188 189 189 if (botRight.lon() == 0.0 || botRight.lat() == 0) { … … 200 200 return; 201 201 } 202 202 203 203 needRedraw = false; 204 204 lastTopLeft = topLeft; 205 205 lastBotRight = botRight; 206 206 bufferImage = mv.createImage(mv.getWidth(), mv.getHeight()); 207 g = bufferImage.getGraphics();207 g = (Graphics2D) bufferImage.getGraphics(); 208 208 209 209 if (!LatLon.isValidLat(topLeft.lat()) || … … 228 228 viewportMaxY = tmp; 229 229 } 230 230 231 231 if (viewportMaxX-viewportMinX > 18) return; 232 232 if (viewportMaxY-viewportMinY > 18) return; … … 255 255 if (tile == null) { 256 256 // check if tile is in range 257 Bounds tileBounds = new Bounds(new LatLon(tileYToLat(y+1), tileXToLon(x)), 257 Bounds tileBounds = new Bounds(new LatLon(tileYToLat(y+1), tileXToLon(x)), 258 258 new LatLon(tileYToLat(y), tileXToLon(x+1))); 259 259 if (!tileBounds.asRect().intersects(printBounds.asRect())) continue; … … 275 275 } 276 276 } 277 277 278 278 if (count == 0) 279 279 { … … 283 283 284 284 oldg.drawImage(bufferImage, 0, 0, null); 285 285 286 286 if (imageScale != null) { 287 287 // If each source image pixel is being stretched into > 3 … … 289 289 if (imageScale > 3) { 290 290 increaseZoomLevel(); 291 this.paint(oldg, mv );291 this.paint(oldg, mv, bounds); 292 292 } 293 293 … … 296 296 else if (imageScale < 0.32) { 297 297 decreaseZoomLevel(); 298 this.paint(oldg, mv );299 } 300 } 298 this.paint(oldg, mv, bounds); 299 } 300 } 301 301 }// end of paint metod 302 302 … … 310 310 } 311 311 } 312 312 313 313 if (tilex == -1) return null; 314 314 315 315 for (int y = viewportMinY; y <= viewportMaxY; y++) { 316 316 if (pixelpos[0][y - viewportMinY + 1].y > py) { … … 319 319 } 320 320 } 321 321 322 322 if (tiley == -1) return null; 323 323 … … 411 411 Main.pref.listener.remove(WalkingPapersLayer.this); 412 412 } 413 413 414 414 public String getWalkingPapersId() { 415 415 return walkingPapersId; 416 416 } 417 417 418 418 public URL formatImageUrl(int x, int y, int z) { 419 419 String urlstr = tileUrlTemplate. … … 427 427 } 428 428 } 429 429 430 430 }
Note:
See TracChangeset
for help on using the changeset viewer.