Advertisement
Guest User

bt747 local tiles

a guest
Jan 6th, 2013
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.86 KB | None | 0 0
  1. --- ../orig/src_j2se/net/sf/bt747/j2se/app/map/MapFactoryInfos.java
  2. +++ src_j2se/net/sf/bt747/j2se/app/map/MapFactoryInfos.java
  3. @@ -45,6 +45,31 @@
  4.                      + y;
  5.          }
  6.      };
  7. +
  8. +    // replace osm cloudmade with local tiles
  9. +    // My tiles were generated by gdal2tiles.pl, which outputs standard TMS that differs from
  10. +    // OSM in that its y coordinate is flipped, see
  11. +    // http://alastaira.wordpress.com/2011/07/06/converting-tms-tile-coordinates-to-googlebingosm-tile-coordinates/
  12. +    public final static MyTileFactoryInfo tfiOSM_OSM_CYCLE_CLOUDMADE = new MyTileFactoryInfo(
  13. +            "local tiles", 2, 18, 19, 256, true, true,
  14. +            "file:///m/pic/slippymap/slippytiles", "x", "y", "z",
  15. +            "Local TMS tiles",
  16. +            "http://www.gdal.org/gdal2tiles.html") {
  17. +        public String getTileUrl(int x, int y, int zoom) {
  18. +            zoom = getTotalMapZoom() - zoom;
  19. +            y = (1 << zoom) - y - 1; // flip y coordinate
  20. +            String url = baseURL + "/" + zoom + "/" + x + "/" + y + ".png";
  21. +            return url;
  22. +        }
  23. +
  24. +        public String getTileBaseKey(int x, int y, int zoom) {
  25. +            zoom = getTotalMapZoom() - zoom;
  26. +            return "" + zoom + File.separatorChar + x + File.separatorChar
  27. +                    + y;
  28. +        }
  29. +    };
  30. +
  31. +/*
  32.      public final static MyTileFactoryInfo tfiOSM_OSM_CYCLE_CLOUDMADE = new MyTileFactoryInfo(
  33.              "osmcycle_cloudmade", 2, 18, 19, 256, true, true,
  34.              "http://andy.sandbox.cloudmade.com/tiles/cycle", "x", "y", "z",
  35. @@ -62,7 +87,8 @@
  36.                      + y;
  37.          }
  38.      };
  39. -
  40. +*/
  41. +    
  42.      public final static MyTileFactoryInfo tfiOSM_OSM_CYCLE_THUNDER = new MyTileFactoryInfo(
  43.              "osmcycle_thunder", 4, 18, 19, 256, true, true,
  44.              "http://www.thunderflames.org/tiles/cycle", "x", "y", "z",
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement