Commit 2eb7a48c authored by duminil's avatar duminil
Browse files

RegionChooser: Cleaning up

No related merge requests found
Showing with 38 additions and 34 deletions
+38 -34
...@@ -70,7 +70,7 @@ public void processJob(Geometry poly, String productName, JSObject novaFactoryOp ...@@ -70,7 +70,7 @@ public void processJob(Geometry poly, String productName, JSObject novaFactoryOp
@Override @Override
public void jobStatusChanged(JobStatusEvent event) { public void jobStatusChanged(JobStatusEvent event) {
JobStatus status = (JobStatus) event.getSource(); JobStatus status = (JobStatus) event.getSource();
System.out.println(status); // System.out.println(status);
if (status == JobStatus.LOCAL) { if (status == JobStatus.LOCAL) {
novaFactoryOpenLayer.call("updateStatus", "REQUEST HAS BEEN PREPARED"); novaFactoryOpenLayer.call("updateStatus", "REQUEST HAS BEEN PREPARED");
} else if (status == JobStatus.SENT) { } else if (status == JobStatus.SENT) {
......
...@@ -97,13 +97,16 @@ protected Integer call() throws Exception { ...@@ -97,13 +97,16 @@ protected Integer call() throws Exception {
public void extractZIPtoGML(String zipFilename) throws IOException { public void extractZIPtoGML(String zipFilename) throws IOException {
ZipFile zipFile = new ZipFile(zipFilename); ZipFile zipFile = new ZipFile(zipFilename);
Enumeration<? extends ZipEntry> entries = zipFile.entries(); Enumeration<? extends ZipEntry> entries = zipFile.entries();
String userName = System.getProperty("user.name");
while (entries.hasMoreElements()) { while (entries.hasMoreElements()) {
ZipEntry ze = entries.nextElement(); ZipEntry ze = entries.nextElement();
if (ze.getName().toLowerCase().contains("gml")) { String zeName = ze.getName();
File extractedCityGML = selectSaveFileWithDialog(null, ze.getName(), ""); if (zeName.toLowerCase().contains("gml")) {
File extractedCityGML = selectSaveFileWithDialog(null,
zeName.replace("_GML.", ".").replace(userName, "novaFACTORY"), "");
if (extractedCityGML != null) { if (extractedCityGML != null) {
InputStream cityGMLInputStream = zipFile.getInputStream(ze); InputStream cityGMLInputStream = zipFile.getInputStream(ze);
System.out.println("Extract zipFile " + zipFilename + " to " + extractedCityGML); // System.out.println("Extract zipFile " + zipFilename + " to " + extractedCityGML);
FileOutputStream fos = new FileOutputStream(extractedCityGML); FileOutputStream fos = new FileOutputStream(extractedCityGML);
byte[] bytes = new byte[1024]; byte[] bytes = new byte[1024];
int length; int length;
......
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<title> Simstadt Region Chooser </title> <title> Simstadt Region Chooser </title>
<meta name="keywords" content="polygon,creator,google map,v3,draw,paint"> <meta name="keywords" content="polygon,creator,google map,v3,draw,paint">
<meta name="description" content="Google Map V3 Polygon Creator for Simstadt"> <meta name="description" content="Google Map V3 Polygon Creator for Simstadt">
<link rel="stylesheet" type="text/css" href="style/style.css"> <link rel="stylesheet" type="text/css" href="style/style.css">
<script type="text/javascript" src="script/proj4.js"></script> <script type="text/javascript" src="script/proj4.js"></script>
<script type="text/javascript" src="script/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="script/jquery-1.4.2.min.js"></script>
<!-- <link rel="stylesheet" href="http://openlayers.org/en/v3.4.0/css/ol.css" type="text/css"> <!-- <link rel="stylesheet" href="http://openlayers.org/en/v3.4.0/css/ol.css" type="text/css">
...@@ -17,27 +17,23 @@ ...@@ -17,27 +17,23 @@
<!-- <script src="ol-debug.js" type="text/javascript"></script> --> <!-- <script src="ol-debug.js" type="text/javascript"></script> -->
<script src="script/ol.js" type="text/javascript"></script> <script src="script/ol.js" type="text/javascript"></script>
<script src="script/turf.js" type="text/javascript"></script> <script src="script/turf.js" type="text/javascript"></script>
</head> </head>
<body> <body>
<div id="header"> <div id="header">
<ul> <ul>
<li class="title"> <li class="title">
Simstadt Region Chooser Simstadt Region Chooser
</li> </li>
</ul> </ul>
<p> </div>
<span class="instruction">Demo Instruction:</span> <div id="map" class="map" tabindex="0"></div>
Left click on the map to create markers, when last marker meets first marker, it will form a polygon. <div id="side">
</p> <div id="dataPanel">
</div> </div>
<div id="map" class="map" tabindex="0"></div> </div>
<div id="side"> <input id="reset" value="Reset" type="button" class="navi" disabled/>
<input id="reset" value="Reset" type="button" class="navi" disabled/> <script src="script/simstadt_openlayers.js" type="text/javascript"></script>
<div id="dataPanel">
</div>
</div>
<script src="script/simstadt_openlayers.js" type="text/javascript"></script>
</body> </body>
</html> </html>
//TODO: Add zoom to extent as control //TODO: Add zoom to extent as control
//TODO: Try to leave everything in 4326 //TODO: Try to leave everything in 4326
//TODO: Add some tiles for offline mode
var reset_btn = $('#reset')[0]; var reset_btn = $('#reset')[0];
var dataPanel = $('#dataPanel'); var dataPanel = $('#dataPanel');
......
...@@ -19,8 +19,9 @@ div#header{ ...@@ -19,8 +19,9 @@ div#header{
div#map{ div#map{
width:70%; width:70%;
height:70%; height:80%;
float:left; float:left;
outline: 0;
} }
div#side{ div#side{
width:30%; width:30%;
...@@ -29,9 +30,14 @@ div#side{ ...@@ -29,9 +30,14 @@ div#side{
div#dataPanel{ div#dataPanel{
width:90%; width:90%;
height:50%; height:80%;
overflow:auto; overflow:auto;
border:2px solid #DDDDDD; border:2px solid #DDDDDD;
font-family: Consolas,monaco,monospace;
font-size: 12px;
box-sizing:border-box;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
} }
div#side input{ div#side input{
width:90%; width:90%;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment