# HG changeset patch # User fknauft # Date 1315479888 -7200 # Node ID 7c5d825a00837a8ba28b7657f15fb5dd356d5119 # Parent 57f0dfaf59492c4e4c2b45f54a9c06ca8e9cdbb0 show line and polygon-layer diff -r 57f0dfaf5949 -r 7c5d825a0083 RestDbGisApi.py --- a/RestDbGisApi.py Tue Sep 06 12:53:17 2011 +0200 +++ b/RestDbGisApi.py Thu Sep 08 13:04:48 2011 +0200 @@ -41,12 +41,13 @@ HTML_schema_usertables = PageTemplateFile('zpt/HTML_schema_usertables', globals()) # and scripts - def KML_URL_schema_table(self,schema,table): + def KML_URL_schema_table(self,schema,table, useTimestamp=True): """KML_URL table function""" self.REQUEST.RESPONSE.setHeader("Content-Type", "text/plain") id = self.REQUEST.get('id',[]) doc = self.REQUEST.get('doc',None) - return self.getLiveKmlUrl(schema=schema,table=table) + # return self.getLiveKmlUrl(schema=schema,table=table, useTimestamp=useTimestamp) + return self.getLiveKmlUrl(schema=schema,table=table, useTimestamp=False) # # database methods @@ -189,9 +190,19 @@ else: # TODO: proper quoting for names qstr += ' ORDER BY "%s"'%sortBy.replace('"','') - - data = self.executeSQL(qstr,idList) - + bad_luck=True + bl_counter=0 + while (bad_luck): + try: + data = self.executeSQL(qstr,idList) + bad_luck=False + bl_counter=bl_counter+1 + except: + if (bl_counter<100): + bad_luck=True + else: + bad_luck=False + fieldMap = self.getFieldNameMap(data['fields']) try: geomstr='select astext(st_simplify(transform(the_geom,4326),0.02)) from "%s"."%s"'%(schema,table) @@ -361,7 +372,7 @@ coord_string+=x_coord+','+y_coord+','+'0 ' if coord_string != '': kmlPlace['LinearRing']=coord_string - kmlPlace['LineColor']=colorField + kmlPlace['lineColor']='#'+colorField+'_'+geomField kmlData.append(kmlPlace) #logging.debug("kmlData=%s"%(repr(kmlData))) return kmlData diff -r 57f0dfaf5949 -r 7c5d825a0083 gis_gui/blocks/layer.js --- a/gis_gui/blocks/layer.js Tue Sep 06 12:53:17 2011 +0200 +++ b/gis_gui/blocks/layer.js Thu Sep 08 13:04:48 2011 +0200 @@ -124,7 +124,7 @@ paramstr += "&connect_line="+params.connect_line; } var layerurl = "../db/RESTdb/db/public/" + escape(params.table) + "?" + paramstr; - //alert(layerurl); + console.debug("layerurl: ",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)+")"); diff -r 57f0dfaf5949 -r 7c5d825a0083 gis_gui/blocks/map.js --- a/gis_gui/blocks/map.js Tue Sep 06 12:53:17 2011 +0200 +++ b/gis_gui/blocks/map.js Thu Sep 08 13:04:48 2011 +0200 @@ -215,7 +215,7 @@ // render layer if (google != null) { var newMarker=new google.maps.KmlLayer(kmlURL); - console.debug("new marker layer=",newMarker); + console.debug("new marker layer no",i,"=",newMarker); console.debug(" map=",map); newMarker.setMap(map); console.debug("Map-Update finished"); diff -r 57f0dfaf5949 -r 7c5d825a0083 zpt/GIS_schema_table.zpt --- a/zpt/GIS_schema_table.zpt Tue Sep 06 12:53:17 2011 +0200 +++ b/zpt/GIS_schema_table.zpt Thu Sep 08 13:04:48 2011 +0200 @@ -2,8 +2,8 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> diff -r 57f0dfaf5949 -r 7c5d825a0083 zpt/KML_schema_table.zpt --- a/zpt/KML_schema_table.zpt Tue Sep 06 12:53:17 2011 +0200 +++ b/zpt/KML_schema_table.zpt Thu Sep 08 13:04:48 2011 +0200 @@ -100,28 +100,79 @@ + + + + + + + + + @@ -134,11 +185,11 @@ + Border-Line ERD-0815: ERD-0815 - - #red_line + #red_line 1 1