Changeset 18590 in osm for applications/editors/josm/plugins/slippymap
- Timestamp:
- 2009-11-14T19:09:20+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapLayer.java
r18367 r18590 732 732 return this.tilesSpanned() > 10; 733 733 } 734 boolean insane() { 735 return this.tilesSpanned() > 100; 736 } 734 737 double tilesSpanned() { 735 738 return Math.sqrt(1.0 * this.size()); 736 739 } 737 740 738 intsize() {739 int x_span = z12x1 - z12x0 + 1;740 int y_span = z12y1 - z12y0 + 1;741 double size() { 742 double x_span = z12x1 - z12x0 + 1.0; 743 double y_span = z12y1 - z12y0 + 1.0; 741 744 return x_span * y_span; 742 745 } … … 753 756 { 754 757 List<Tile> ret = new ArrayList<Tile>(); 758 // Don't even try to iterate over the set. 759 // Someone created a crazy number of them 760 if (this.insane()) 761 return ret; 755 762 for (int x = z12x0; x <= z12x1; x++) { 756 763 for (int y = z12y0; y <= z12y1; y++) { … … 852 859 // Too many tiles... refuse to draw 853 860 if (!ts.tooLarge()) { 861 //out("size: " + ts.size() + " spanned: " + ts.tilesSpanned()); 854 862 ts.loadAllTiles(false); 855 863 } … … 875 883 LatLon botRight2 = tileLatLon(t2); 876 884 TileSet ts2 = new TileSet(topLeft2, botRight2, newzoom); 885 if (ts2.tooLarge()) 886 continue; 877 887 newlyMissedTiles.addAll(this.paintTileImages(g, ts2, newzoom, missed)); 878 888 } … … 911 921 //g.drawString("currentZoomLevel=" + currentZoomLevel, 120, 120); 912 922 oldg.setColor(Color.black); 913 if (ts.tooLarge()) { 923 if (ts.insane()) { 924 oldg.drawString("zoom in to load any tiles", 120, 120); 925 } else if (ts.tooLarge()) { 914 926 oldg.drawString("zoom in to load more tiles", 120, 120); 915 927 } else if (ts.tooSmall()) {
Note:
See TracChangeset
for help on using the changeset viewer.