git-svn-id: https://osmand.googlecode.com/svn/trunk@141 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-06-05 21:31:38 +00:00
parent 1df7216662
commit 12c5ddb719

View file

@ -5,6 +5,7 @@ import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.net.URL; import java.net.URL;
import java.net.URLConnection; import java.net.URLConnection;
import java.net.URLEncoder;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
@ -259,8 +260,8 @@ public class OsmBugsLayer implements OsmandMapLayer {
b.append("lat=").append(latitude); b.append("lat=").append(latitude);
b.append("&lon=").append(longitude); b.append("&lon=").append(longitude);
text = text + " [" + authorName +" "+ dateFormat.format(new Date())+ "]"; text = text + " [" + authorName +" "+ dateFormat.format(new Date())+ "]";
b.append("&text=").append(text); b.append("&text=").append(URLEncoder.encode(text));
b.append("&name=").append(authorName); b.append("&name=").append(URLEncoder.encode(authorName));
return editingPOI(b.toString(), "creating bug"); return editingPOI(b.toString(), "creating bug");
} }
@ -269,8 +270,8 @@ public class OsmBugsLayer implements OsmandMapLayer {
b.append("http://openstreetbugs.schokokeks.org/api/0.1/editPOIexec?"); b.append("http://openstreetbugs.schokokeks.org/api/0.1/editPOIexec?");
b.append("id=").append(id); b.append("id=").append(id);
text = text + " [" + authorName +" "+ dateFormat.format(new Date())+ "]"; text = text + " [" + authorName +" "+ dateFormat.format(new Date())+ "]";
b.append("&text=").append(text); b.append("&text=").append(URLEncoder.encode(text));
b.append("&name=").append(authorName); b.append("&name=").append(URLEncoder.encode(authorName));
return editingPOI(b.toString(), "adding comment"); return editingPOI(b.toString(), "adding comment");
} }
@ -283,8 +284,8 @@ public class OsmBugsLayer implements OsmandMapLayer {
private boolean editingPOI(String urlStr, String debugAction){ private boolean editingPOI(String urlStr, String debugAction){
urlStr = urlStr.replace(" ", "%20");
try { try {
log.debug("Action " + debugAction + " " + urlStr);
URL url = new URL(urlStr); URL url = new URL(urlStr);
URLConnection connection = url.openConnection(); URLConnection connection = url.openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
@ -300,7 +301,6 @@ public class OsmBugsLayer implements OsmandMapLayer {
return false; return false;
} }
protected List<OpenStreetBug> loadingBugs(double topLatitude, double leftLongitude, double bottomLatitude,double rightLongitude){ protected List<OpenStreetBug> loadingBugs(double topLatitude, double leftLongitude, double bottomLatitude,double rightLongitude){
List<OpenStreetBug> bugs = new ArrayList<OpenStreetBug>(); List<OpenStreetBug> bugs = new ArrayList<OpenStreetBug>();
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();