Skip to content

Commit

Permalink
fix for issues generated from api cleanup commit
Browse files Browse the repository at this point in the history
  • Loading branch information
slarosa committed Dec 31, 2012
1 parent 98e9c27 commit 90ef576
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions python/plugins/osm/OsmDatabaseManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,22 +168,22 @@ def layerRemoved(self,layerID):
key=dbFileName.toLatin1().data()

# remove map layers that belong to dbFileName database
if key in self.lineLayers.keys() and layer.id()==self.lineLayers[key].getLayerID():
if key in self.lineLayers.keys() and layer.id()==self.lineLayers[key].id():
del self.lineLayers[key]

elif key in self.pointLayers.keys() and layer.id()==self.pointLayers[key].id():
del self.pointLayers[key]
if key in self.lineLayers.keys():
if self.lineLayers[key]:
lineLayID=self.lineLayers[key].id()
self.mapReg.removeMapLayer(lineLayID,True)
self.mapReg.removeMapLayers([lineLayID],True)

elif key in self.polygonLayers.keys() and layer.id()==self.polygonLayers[key].id():
del self.polygonLayers[key]
if key in self.pointLayers.keys():
if self.pointLayers[key]:
pointLayID=self.pointLayers[key].id()
self.mapReg.removeMapLayer(pointLayID,True)
self.mapReg.removeMapLayers([pointLayID],True)

if key in self.dbConns.keys():
del self.dbConns[key]
Expand All @@ -202,7 +202,7 @@ def removeAllOsmLayers(self):
continue

if layer.type()==QgsMapLayer.VectorLayer and layer.dataProvider().name()=="osm":
QgsMapLayerRegistry.instance().removeMapLayer(layer.id(),True)
QgsMapLayerRegistry.instance().removeMapLayers([layer.id()],True)

self.dbConns={} # map dbFileName->sqlite3ConnectionObject
self.pointLayers={}
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/osm/OsmDownloadDlg.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(self, plugin):
# check whether the extent needs to be projected back to WGS84
mapRenderer = plugin.canvas.mapRenderer()
if mapRenderer.hasCrsTransformEnabled():
crsMap=mapRenderer.destinationSrs()
crsMap=mapRenderer.destinationCrs()
crsWgs84=QgsCoordinateReferenceSystem(4326)
xform=QgsCoordinateTransform(crsMap, crsWgs84)
currentExtent=xform.transformBoundingBox(currentExtent)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/osm/OsmFeatureDW.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def projectionChanged(self):

renderer = self.plugin.canvas.mapRenderer()
if renderer.hasCrsTransformEnabled():
self.coordXform = QgsCoordinateTransform(renderer.destinationSrs(), QgsCoordinateReferenceSystem(4326))
self.coordXform = QgsCoordinateTransform(renderer.destinationCrs(), QgsCoordinateReferenceSystem(4326))
else:
self.coordXform = None

Expand Down
6 changes: 3 additions & 3 deletions python/plugins/osm/OsmLoadDlg.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def onOK(self):

if self.chkCustomRenderer.isChecked():
self.setCustomRenderer(polygonLayer)
QgsMapLayerRegistry.instance().addMapLayer(polygonLayer)
QgsMapLayerRegistry.instance().addMapLayers([polygonLayer])

# add line layer
lineLayer = QgsVectorLayer(self.fname+"?type=line"+observer + tag + style, basename+" lines", "osm")
Expand All @@ -206,7 +206,7 @@ def onOK(self):

if self.chkCustomRenderer.isChecked():
self.setCustomRenderer(lineLayer)
QgsMapLayerRegistry.instance().addMapLayer(lineLayer)
QgsMapLayerRegistry.instance().addMapLayers([lineLayer])

# add point layer
pointLayer = QgsVectorLayer(self.fname+"?type=point"+observer + tag + style, basename+" points", "osm")
Expand All @@ -220,7 +220,7 @@ def onOK(self):

if self.chkCustomRenderer.isChecked():
self.setCustomRenderer(pointLayer)
QgsMapLayerRegistry.instance().addMapLayer(pointLayer)
QgsMapLayerRegistry.instance().addMapLayers([pointLayer])

# remember layers
self.polygonLayer=polygonLayer
Expand Down

0 comments on commit 90ef576

Please sign in to comment.