Changeset 18619 in osm for applications/editors/josm/wmsadapter
- Timestamp:
- 2009-11-15T13:51:33+01:00 (15 years ago)
- Location:
- applications/editors/josm/wmsadapter/orthofotos-bern
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/wmsadapter/orthofotos-bern/VERSION.txt
r16752 r18619 1 1 2 Built-On: 2009- 08-01 10:02:243 Build-ID: 2 22 Built-On: 2009-11-15 13:50:26 3 Build-ID: 21 4 4 -
applications/editors/josm/wmsadapter/orthofotos-bern/build.number
r16723 r18619 1 1 #Build Number for ANT. Do not edit! 2 # Wed Jul 29 19:04:08 CEST 20093 build.number= 162 #Sun Nov 15 13:50:25 CET 2009 3 build.number=22 4 4 1= -
applications/editors/josm/wmsadapter/orthofotos-bern/build.xml
r16752 r18619 12 12 13 13 <path id="javax.servlet.classpath"> 14 <fileset dir="${ basedir}/../javax.servlet" includes="*.jar" />14 <fileset dir="${library.dir}" includes="*.jar" /> 15 15 </path> 16 16 … … 85 85 <copy file="${library.dir}/winstone-0.9.10.jar" todir="${build.dir}/distrib/orthofoto-bern-wms-adapter-${build.number}" /> 86 86 <copy file="${basedir}/README.txt" todir="${build.dir}/distrib/orthofoto-bern-wms-adapter-${build.number}" /> 87 <copy file="${basedir}/RELEASE-NOTES.txt" todir="${build.dir}/distrib/orthofoto-bern-wms-adapter-${build.number}" /> 87 88 <copy file="${basedir}/VERSION.txt" todir="${build.dir}/distrib/orthofoto-bern-wms-adapter-${build.number}" /> 88 89 -
applications/editors/josm/wmsadapter/orthofotos-bern/src/ch/guggis/josm/bern/servlet/OrthofotoBernWMSAdapter.java
r16752 r18619 83 83 static public final String DEFAULT_URL_GEN_SESSION_ID2 = "http://www.stadtplan.bern.ch/TBInternet/WebMapPageLV.aspx"; 84 84 85 /**86 * the default URL to enter Berns map application. The session ID is87 * retrieved from this URL88 */89 static public final String DEFAULT_URL_MAP_APP_ENTRY = "http://www.stadtplan.bern.ch/TBInternet/WebTitlePage.aspx";90 // static public final String DEFAULT_URL_MAP_APP_ENTRY =91 // "http://www.stadtplan.bern.ch/TBInternet/WebMapPageLV.aspx";92 93 /** the default URL to retrieve map tiles from Berns map application */94 static public final String DEFAULT_URL_MAP_REQUESTS = "http://www.stadtplan.bern.ch/TBInternet/WebMapServer.aspx?VERSION=1.0.0&REQUEST=GETMAP&TYPE=11&LAYERS=TBI_orthofoto_08.mwf&FORMAT=image/jpeg&EXCEPTIONS=image/jpeg";95 96 85 /** the logger */ 97 private static Logger logger = Logger 98 .getLogger(OrthofotoBernWMSAdapter.class.getName()); 86 private static Logger logger = Logger.getLogger(OrthofotoBernWMSAdapter.class.getName()); 99 87 100 88 HashMap<String, String> cityMapSessionCookies = new HashMap<String, String>(); 101 89 90 static private final String DEFAULT_LAYER = "TBI_orthofoto_08.mwf"; 91 private String layer = DEFAULT_LAYER; 92 102 93 /** 103 94 * remembers session cookie retrieved from Berns map server … … 312 303 } 313 304 305 protected String buildDefaultUrlForMapRequests() { 306 StringBuffer sb = new StringBuffer(); 307 sb.append("http://www.stadtplan.bern.ch/TBInternet/WebMapServer.aspx?"); 308 sb.append("VERSION=1.0.0").append("&"); 309 sb.append("REQUEST=GETMAP").append("&"); 310 sb.append("TYPE=11").append("&"); 311 sb.append("LAYERS=").append(layer).append("&"); 312 sb.append("FORMAT=image/jpeg").append("&"); 313 sb.append("EXCEPTIONS=image/jpeg"); 314 return sb.toString(); 315 } 316 314 317 /** 315 318 * handles a tile request … … 376 379 // 377 380 StringBuffer sb = new StringBuffer(); 378 sb.append( DEFAULT_URL_MAP_REQUESTS);381 sb.append(buildDefaultUrlForMapRequests()); 379 382 sb.append("&WIDTH="); 380 383 sb.append(width); … … 437 440 } 438 441 442 protected String buildConfigurationForm(HttpServletRequest req) { 443 StringBuffer sb = new StringBuffer(); 444 sb.append("<html><head></head><body>").append("\n"); 445 sb.append("<h1>WMS Adapter for Orthofots of Bern</h1>").append("\n"); 446 sb.append("Please open <a href=\"http://www.stadtplan.bern.ch/TBInternet/default.aspx?User=1\">the city map of Bern</a> in your browser.</br>").append("\n"); 447 sb.append("Then lookup the cookie <strong>ASP.Net_SessionId</strong> for domain <strong>www.stadtplan.bern.ch</strong> in your browser and enter it in the form below.</br>").append("\n"); 448 sb.append("<form action=\"").append(req.getRequestURL()).append("\">").append("\n"); 449 sb.append("<input type=\"hidden\" name=\"action\" value=\"set-session-id\">").append("\n"); 450 sb.append("Session ID: <input type=\"text\" name=\"session-id\" value=\"\"><br/>").append("\n"); 451 sb.append("Select a layer:<br/>").append("\n"); 452 String checked; 453 if (layer == null || layer.equals("TBI_orthofoto_08.mwf")) { 454 checked=" checked "; 455 } else { 456 checked = ""; 457 } 458 sb.append("<input type=\"radio\" name=\"layer\" value=\"TBI_orthofoto_08.mwf\"").append(checked).append(">Luftbilder 2008 Stadt Bern<br>").append("\n"); 459 if (layer != null && layer.equals("orthofoto_Regio_08.mwf")) { 460 checked=" checked "; 461 } else { 462 checked = ""; 463 } 464 sb.append("<input type=\"radio\" name=\"layer\" value=\"orthofoto_Regio_08.mwf\"").append(checked).append(">Luftbilder 2008 Region Bern<br>").append("\n"); 465 sb.append("<input type=\"submit\" value=\"Submit\">").append("\n"); 466 sb.append("</form").append("\n"); 467 sb.append("</body></html>").append("\n"); 468 return sb.toString(); 469 470 } 439 471 protected void renderSessionIDInputForm(HttpServletRequest req, 440 472 HttpServletResponse resp) throws IOException { 441 String msg = "<html><head></head><body>\n"442 + "<h1>WMS Adapter for Orthofots of Bern</h1>"443 + "Please open <a href=\"http://www.stadtplan.bern.ch/TBInternet/default.aspx?User=1\">the city map of Bern</a> in your browser.</br>"444 + "Then lookup the cookie <strong>ASP.Net_SessionId</strong> for domain <strong>www.stadtplan.bern.ch</strong> in your browser and enter it in the form below.</br>\n"445 + "<form action=\""446 + req.getRequestURL()447 + "\">\n"448 + "<input type=\"hidden\" name=\"action\" value=\"set-session-id\">\n"449 + "<input type=\"text\" name=\"session-id\" value=\"\">\n"450 + "<input type=\"submit\" value=\"Submit\">\n" + "</form>\n"451 + "</body></html>";452 453 473 PrintWriter pw = new PrintWriter(resp.getWriter()); 454 pw.println( msg);474 pw.println(buildConfigurationForm(req)); 455 475 } 456 476 … … 460 480 if (req.getParameter("session-id") == null) { 461 481 throw new MissingParameterException("session-id"); 482 } 483 if (req.getParameter("layer") != null) { 484 layer = req.getParameter("layer"); 485 } else { 486 layer = DEFAULT_LAYER; 462 487 } 463 488
Note:
See TracChangeset
for help on using the changeset viewer.