Changeset 30386 in osm for applications


Ignore:
Timestamp:
2014-04-08T21:16:47+02:00 (11 years ago)
Author:
stoecker
Message:

see #josm9890 - fix two of three issues with imagery-xml plugin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ComputeBoundsAction.java

    r30342 r30386  
    188188        "        " + simpleTag(XML_NAME, name) + "\n"+
    189189        "        " + simpleTag(XML_TYPE, type, "wms") + "\n"+
    190         "        " + simpleTag(XML_URL, url != null ? encodeUrl(url) : "") + "\n"+
     190        "        " + simpleTag(XML_URL, url != null ? encodeUrl(url) : "", false) + "\n"+
    191191                     bounds+"\n";
    192192                if (projections != null && !projections.isEmpty()) {
     
    326326        protected static final String getClosedWayShape(Way cw) {
    327327                String result = "            <shape>\n";
    328                 for (int i=0; i<cw.getNodesCount()-1; i++) {
     328                for (int i=0; i<cw.getNodesCount(); i++) {
    329329                        if (i%3 == 0) {
    330330                                result += "                ";
    331331                        }
     332                        int j = i;
     333                        if(j == cw.getNodesCount())
     334                            j = 0;
    332335                        result += "<point ";
    333336                        result += "lat='" + df.format(cw.getNode(i).getCoor().lat()) + "' ";
    334337                        result += "lon='" + df.format(cw.getNode(i).getCoor().lon()) + "'/>";
    335                         if (i%3 == 2 || i == cw.getNodesCount()-2 ) {
     338                        if (i%3 == 2 || i == cw.getNodesCount()-1 ) {
    336339                                result += "\n";
    337340                        }
Note: See TracChangeset for help on using the changeset viewer.