Ignore:
Timestamp:
2018-06-22T22:40:09+02:00 (6 years ago)
Author:
donvip
Message:

see #josm14120 - fix deprecation warnings

Location:
applications/editors/josm/plugins/imagery_offset_db/src/iodb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/imagery_offset_db/src/iodb/OffsetDialogButton.java

    r33309 r34337  
    127127     */
    128128    private double[] getLengthAndDirection(ImageryOffset offset) {
    129         AbstractTileSourceLayer layer = ImageryOffsetTools.getTopImageryLayer();
     129        AbstractTileSourceLayer<?> layer = ImageryOffsetTools.getTopImageryLayer();
    130130        double[] dxy = layer == null ? new double[] {0.0, 0.0} :
    131131                new double[] {layer.getDisplaySettings().getDx(), layer.getDisplaySettings().getDy()};
     
    144144        LatLon correctedCenterLL = proj.eastNorth2latlon(pos.add(-dx, -dy));
    145145        double length = correctedCenterLL.greatCircleDistance(offset.getImageryPos());
    146         double direction = length < 1e-2 ? 0.0 : correctedCenterLL.heading(offset.getImageryPos());
     146        double direction = length < 1e-2 ? 0.0 : -correctedCenterLL.bearing(offset.getImageryPos());
    147147        if (direction < 0)
    148148            direction += Math.PI * 2;
     
    253253        public void updateIcon(LatLon from) {
    254254            distance = from.greatCircleDistance(to);
    255             direction = to.heading(from);
     255            direction = -to.bearing(from);
    256256        }
    257257
  • applications/editors/josm/plugins/imagery_offset_db/src/iodb/SimpleOffsetQueryTask.java

    r32528 r34337  
    99import java.net.MalformedURLException;
    1010import java.net.URL;
     11import java.nio.charset.StandardCharsets;
    1112import java.util.Scanner;
    1213import java.util.regex.Matcher;
     
    139140        String response = "";
    140141        if (inp != null) {
    141             Scanner sc = new Scanner(inp).useDelimiter("\\A");
     142            Scanner sc = new Scanner(inp, StandardCharsets.UTF_8.name()).useDelimiter("\\A");
    142143            response = sc.hasNext() ? sc.next() : "";
    143144        }
Note: See TracChangeset for help on using the changeset viewer.