changeset 157:8ef6fbc8b89a

polygon-Layers
author fknauft
date Mon, 07 Feb 2011 13:39:59 +0100
parents 89f49aa24061
children 1897ef5479f4
files RestDbGisApi.py gis_gui/blocks/home.html.pt gis_gui/blocks/layer.js
diffstat 3 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/RestDbGisApi.py	Mon Feb 07 11:49:01 2011 +0100
+++ b/RestDbGisApi.py	Mon Feb 07 13:39:59 2011 +0100
@@ -341,8 +341,9 @@
     def getPointForChGisId(self, gis_id):
         """returns coordinate pair for given gis_id"""
         def getPoint(id):
-            sql="SELECT x_coord,y_coord FROM chgis.chgis_coords WHERE gis_id = %s"
-            res = self.executeSQL(sql, (gis_id,))
+            sql="SELECT x_coord,y_coord FROM chgis.chgis_coords WHERE gis_id = CAST(%s AS text)"
+            str_gis_id=str(gis_id).split('.')[0]
+            res = self.executeSQL(sql, (str_gis_id,))
             if len(res['rows']) > 0:
                 return res['rows'][0]
             return None
--- a/gis_gui/blocks/home.html.pt	Mon Feb 07 11:49:01 2011 +0100
+++ b/gis_gui/blocks/home.html.pt	Mon Feb 07 13:39:59 2011 +0100
@@ -158,6 +158,11 @@
       <input type="text" value="Filter" style="color: grey;"/>
       <br/><br/>
       <input type="button" value="Open" class="open_open_table"/> 
+      <div class="float right" style="width:200px;font-size:10px">
+      	Tablenames with "chgis_..." originate from the 
+      	<a href="http://www.fas.harvard.edu/~chgis/">China Historical GIS</a> 
+      	of the Harvard University and the Fudan University
+      </div>
     </div>
 
     <div class="subscreen open_layer" style="display:none">
--- a/gis_gui/blocks/layer.js	Mon Feb 07 11:49:01 2011 +0100
+++ b/gis_gui/blocks/layer.js	Mon Feb 07 13:39:59 2011 +0100
@@ -121,7 +121,7 @@
         paramstr += "&connect_line="+params.connect_line;
     }
     var layerurl = "../db/RESTdb/db/public/" + escape(params.table) + "?" + paramstr;
-    //alert(layerurl);
+    alert(layerurl);
     jQuery.get(layerurl, function(data, textStatus, XMLHttpRequest) {
         // function after load kml url finished
         console.debug("kml url loaded! this=", this, " data=", data, " ("+typeof(data)+")");