Ticket #5911: JMapViewer_attribution.patch

File JMapViewer_attribution.patch, 4.0 KB (added by mfloryan, 13 years ago)

Attribution patch for the JMapViewer - will submit to authors.

  • src/org/openstreetmap/gui/jmapviewer/BingAerialTileSource.java

     
    160160    @Override
    161161    public Image getAttributionImage() {
    162162        try {
    163             return ImageIO.read(getClass().getResourceAsStream("/images/bing_maps.png"));
     163            return ImageIO.read(getClass().getResourceAsStream("images/bing_maps.png"));
    164164        } catch (IOException e) {
    165165            return null;
    166166        }
  • src/org/openstreetmap/gui/jmapviewer/Demo.java

     
    5454                map.setDisplayToFitMapMarkers();
    5555            }
    5656        });
    57         JComboBox tileSourceSelector = new JComboBox(new TileSource[] { new OsmTileSource.Mapnik(),
    58                 new OsmTileSource.TilesAtHome(), new OsmTileSource.CycleMap() });
     57        JComboBox tileSourceSelector = new JComboBox(new TileSource[] {
     58                new OsmTileSource.Mapnik(),
     59                new OsmTileSource.TilesAtHome(),
     60                new OsmTileSource.CycleMap(),
     61                new BingAerialTileSource() });
    5962        tileSourceSelector.addItemListener(new ItemListener() {
    6063            public void itemStateChanged(ItemEvent e) {
    6164                map.setTileSource((TileSource) e.getItem());
  • build.xml

     
    2727                <delete file="JMapViewer.jar" />
    2828                <delete file="JMapViewer_src.jar" />
    2929                <jar destfile="JMapViewer.jar" filesetmanifest="mergewithoutmain">
    30                         <fileset dir="bin" includes="**/jmapviewer/**">
    31                         </fileset>
     30                        <fileset dir="bin" includes="**/jmapviewer/**" />
    3231                        <fileset dir="src" includes="**/jmapviewer/**" />
    3332                </jar>
    3433                <jar destfile="JMapViewer_src.jar" filesetmanifest="mergewithoutmain">
     
    4544                                <attribute name="Class-Path" value="." />
    4645                        </manifest>
    4746                        <fileset dir="bin" includes="**/jmapviewer/**" />
    48                         <fileset dir="src" includes="**/jmapviewer/**/*.java" />
     47            <fileset dir="src" includes="**/jmapviewer/**/*.java" />
    4948                </jar>
    5049        </target>
    5150</project>
  • src/org/openstreetmap/gui/jmapviewer/OsmTileSource.java

     
    2727            NAME = name;
    2828            BASE_URL = base_url;
    2929            ATTR_IMG_URL = attr_img_url;
    30             if(ATTR_IMG_URL == null) {
    31                 REQUIRES_ATTRIBUTION = false;
    32             }
    33         }
     30        }
    3431
    3532        public String getName() {
    3633            return NAME;
     
    8885        }
    8986
    9087        public String getAttributionText(int zoom, Coordinate topLeft, Coordinate botRight) {
    91             return "CC-BY-SA OpenStreetMap and Contributors";
     88            return "© OpenStreetMap contributors, CC-BY-SA ";
    9289        }
    9390
    9491        public String getAttributionLinkURL() {
     
    9693        }
    9794
    9895        public String getTermsOfUseURL() {
    99             return "http://openstreetmap.org/";
     96            return "http://www.openstreetmap.org/copyright";
    10097        }
    10198
    10299        public double latToTileY(double lat, int zoom) {
     
    182179            return TileUpdate.IfModifiedSince;
    183180        }
    184181    }
     182
    185183    public static class TilesAtHome extends OsmaSource {
    186184        public TilesAtHome() {
    187185            super("TilesAtHome", "tile");
    188186        }
    189187    }
     188
    190189    public static class Maplint extends OsmaSource {
    191190        public Maplint() {
    192191            super("Maplint", "maplint");