diff --git a/qgis2leaf_exec.py b/qgis2leaf_exec.py index cd29698..b0f1eca 100644 --- a/qgis2leaf_exec.py +++ b/qgis2leaf_exec.py @@ -89,12 +89,10 @@ def qgis2leaf_exec(outputProjectFileName, basemapName, basemapMeta, basemapAddre os.makedirs(miscStore) #lets create a css file for own css: with open(cssStore + 'own_style.css', 'w') as f_css: - text = """ body { padding: 0; margin: 0; - }""" if full == 1: text += """ @@ -103,24 +101,12 @@ def qgis2leaf_exec(outputProjectFileName, basemapName, basemapMeta, basemapAddre width: 100%; padding: 0; margin: 0; - - - - }""" elif full == 0: text += """ - - - - html, body, #map { height: """+str(height)+"""px; width: """+str(width)+"""px; - - - - }""" if opacity_raster == True and full == 1: text += """ @@ -159,7 +145,6 @@ def qgis2leaf_exec(outputProjectFileName, basemapName, basemapMeta, basemapAddre f_css.close() #the index file has an easy beginning. we will store it right away: - canvas = qgis.utils.iface.mapCanvas() outputIndex = outputProjectFileName + os.sep + 'index.html' with open(outputIndex, 'w') as f_html: base = """ @@ -253,6 +238,7 @@ def qgis2leaf_exec(outputProjectFileName, basemapName, basemapMeta, basemapAddre in_raster = str(i.dataProvider().dataSourceUri()) prov_raster = tempfile.gettempdir() + os.sep + 'exp_' + safeLayerName + '_prov.tif' out_raster = dataStore + os.sep + 'exp_' + safeLayerName + '.png' + crsSrc = i.crs() crsDest = QgsCoordinateReferenceSystem(4326) xform = QgsCoordinateTransform(crsSrc, crsDest) @@ -261,7 +247,6 @@ def qgis2leaf_exec(outputProjectFileName, basemapName, basemapMeta, basemapAddre processing.runalg("gdalogr:warpreproject",in_raster,i.crs().authid(),"EPSG:4326","",0,1,0,-1,75,6,1,False,0,False,"",prov_raster) print extentRepNew processing.runalg("gdalogr:translate",prov_raster,100,True,"",0,"",extentRepNew,False,0,0,75,6,1,False,0,False,"",out_raster) - #now determine the canvas bounding box #####now with viewcontrol if extent == 'canvas extent': @@ -302,7 +287,7 @@ def qgis2leaf_exec(outputProjectFileName, basemapName, basemapMeta, basemapAddre middle = """