Changeset 17561 in osm
- Timestamp:
- 2009-09-09T17:05:43+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/wmsplugin/src/wmsplugin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/GeorefImage.java
r17556 r17561 35 35 } 36 36 37 /* this does not take dx and dy offset into account! */ 38 public boolean isVisible(NavigatableComponent nc) { 39 Point minPt = nc.getPoint(min), maxPt = nc.getPoint(max); 37 public boolean isVisible(NavigatableComponent nc, double dx, double dy) { 38 EastNorth mi = new EastNorth(min.east()+dx, min.north()+dy); 39 EastNorth ma = new EastNorth(max.east()+dx, max.north()+dy); 40 Point minPt = nc.getPoint(mi), maxPt = nc.getPoint(ma); 40 41 Graphics g = nc.getGraphics(); 41 42 … … 51 52 Point minPt = nc.getPoint(mi), maxPt = nc.getPoint(ma); 52 53 53 /* this is isVisible() but taking dx, dy into account */ 54 if(!(g.hitClip(minPt.x, maxPt.y, maxPt.x - minPt.x, minPt.y - maxPt.y))) { 54 if(!isVisible(nc, dx, dy)){ 55 55 return false; 56 56 } -
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java
r17407 r17561 65 65 image.max = b.max; 66 66 67 if(image.isVisible(mv )) { //don't download, if the image isn't visible already67 if(image.isVisible(mv, layer.getDx(), layer.getDy())) { //don't download, if the image isn't visible already 68 68 image.image = grab(url); 69 69 image.flushedResizedCachedInstance(); -
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java
r17407 r17561 101 101 } 102 102 } 103 } 104 105 public double getDx(){ 106 return dx; 107 } 108 109 public double getDy(){ 110 return dy; 103 111 } 104 112 … … 207 215 return; 208 216 ProjectionBounds bounds = mv.getProjectionBounds(); 209 int bminx= (int)Math.floor (( bounds.min.east() * pixelPerDegree) / ImageSize );210 int bminy= (int)Math.floor (( bounds.min.north() * pixelPerDegree) / ImageSize );211 int bmaxx= (int)Math.ceil (( bounds.max.east() * pixelPerDegree) / ImageSize );212 int bmaxy= (int)Math.ceil (( bounds.max.north() * pixelPerDegree) / ImageSize );217 int bminx= (int)Math.floor (((bounds.min.east() - dx) * pixelPerDegree) / ImageSize ); 218 int bminy= (int)Math.floor (((bounds.min.north() - dy) * pixelPerDegree) / ImageSize ); 219 int bmaxx= (int)Math.ceil (((bounds.max.east() - dx) * pixelPerDegree) / ImageSize ); 220 int bmaxy= (int)Math.ceil (((bounds.max.north() - dy) * pixelPerDegree) / ImageSize ); 213 221 214 222 if((bmaxx - bminx > dax) || (bmaxy - bminy > day)){
Note:
See TracChangeset
for help on using the changeset viewer.