/[projects]/android/TrainInfoService/src/dk/thoerup/traininfoservice/RequestPlotter.java
ViewVC logotype

Diff of /android/TrainInfoService/src/dk/thoerup/traininfoservice/RequestPlotter.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1355 by torben, Wed Apr 20 19:01:33 2011 UTC revision 1428 by torben, Mon May 2 18:30:31 2011 UTC
# Line 267  public class RequestPlotter extends Http Line 267  public class RequestPlotter extends Http
267                  for(RequestPosition current : list) {                  for(RequestPosition current : list) {
268                          String id = color + count++;                          String id = color + count++;
269                          sb.append( " <Placemark id=\"" + id + "\">\n" );                          sb.append( " <Placemark id=\"" + id + "\">\n" );
270                            sb.append( "  <name>").append(current.time).append("</name>\n" );
271                          sb.append( "  <styleUrl>#").append(color).append("</styleUrl>\n" );                          sb.append( "  <styleUrl>#").append(color).append("</styleUrl>\n" );
272                          sb.append( "  <description><![CDATA[IP=").append(current.ip).append("<br/>Time=").append(current.time).append("]]></description>\n" );                          sb.append( "  <description><![CDATA[IP=").append(current.ip).append("<br/> ]]></description>\n" );
273                          sb.append( "  <Point><coordinates>").append(current.lng).append(",").append(current.lat).append(",0</coordinates></Point>\n" );                          sb.append( "  <Point><coordinates>").append(current.lng).append(",").append(current.lat).append(",0</coordinates></Point>\n" );
274                          sb.append( " </Placemark>\n" );                                          sb.append( " </Placemark>\n" );                
275                  }                                }              
# Line 385  public class RequestPlotter extends Http Line 386  public class RequestPlotter extends Http
386                                    
387                  if (count > 30) //limit to 30 days                  if (count > 30) //limit to 30 days
388                          count = 30;                          count = 30;
389                    if (count < 0) //negative count is not allowed
390                            count = 0;
391                                    
392                  String kmlData = getRequestsFromFile(count);                  String kmlData = getRequestsFromFile(count);
393                                    
# Line 401  public class RequestPlotter extends Http Line 404  public class RequestPlotter extends Http
404                          byte bytes[] = baos.toByteArray();                          byte bytes[] = baos.toByteArray();
405    
406                          resp.setContentType(KMZ);                          resp.setContentType(KMZ);
407                          resp.setContentLength( bytes.length );                          resp.setHeader("Content-Disposition", "attachment; filename=Traininfo-requestplotter.kmz");
408                            resp.setContentLength( bytes.length );                  
409                          resp.getOutputStream().write(bytes);                          resp.getOutputStream().write(bytes);
410    
411                  } else {                  } else {

Legend:
Removed from v.1355  
changed lines
  Added in v.1428

  ViewVC Help
Powered by ViewVC 1.1.20