sourcepole / qgis-openlayers-plugin

Openlayers plugin for QGIS
GNU General Public License v2.0
175 stars 108 forks source link

QGIS 3.2.1 - saving project file creates error when javascript api based layer is loaded #59

Open dtvkoe opened 6 years ago

dtvkoe commented 6 years ago

If the project contains a layer that is based on a javascript API, saving the QGIS project file is not possible anymore.

While pressing on the save button the following python error occurs:

An error has occurred while executing Python code: 

TypeError: writeXml() takes 3 positional arguments but 4 were given 
TypeError: writeXml() takes 3 positional arguments but 4 were given

Python version: 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] 
QGIS version: 3.2.1-Bonn Bonn, 1edf372fb8 

Python Path:
C:/OSGEO4~1/apps/qgis/./python
C:/Users/MYUSER/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/MYUSER/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/OSGEO4~1/apps/qgis/./python/plugins
C:\OSGeo4W64\bin\python36.zip
C:\OSGEO4~1\apps\Python36\DLLs
C:\OSGEO4~1\apps\Python36\lib
C:\OSGeo4W64\bin
C:\OSGEO4~1\apps\Python36
C:\OSGEO4~1\apps\Python36\lib\site-packages
C:\OSGEO4~1\apps\Python36\lib\site-packages\win32
C:\OSGEO4~1\apps\Python36\lib\site-packages\win32\lib
C:\OSGEO4~1\apps\Python36\lib\site-packages\Pythonwin
C:/Users/MYUSER/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\MYUSER\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins
D:/Daten/QGIS

QGIS remembers the project file as saved but after opening the project file again a javascript api based layer is gone.

I've encountered this problem when loading "Google Streets" and "Bing Roads" layer.

This problem doesn't occur when adding layers like "OpenStreetMap" which are not javascript base.

I also don't have this problem when using QGIS 2.18.22.

rizwanbpatel commented 5 years ago

Issue is occurring on QGis 3.4* version as well - Specifically working with the

OpenLayers Plugin - Bing Roads

An error has occurred while executing Python code: 

TypeError: writeXml() takes 3 positional arguments but 4 were given 
TypeError: writeXml() takes 3 positional arguments but 4 were given

Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] 
QGIS version: 3.4.1-Madeira Madeira, 383851c597 

Python Path:
C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python
C:/Users/nomd/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/nomd/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins
C:\PROGRA~1\QGIS3~1.4\bin\python37.zip
C:\PROGRA~1\QGIS3~1.4\apps\Python37\DLLs
C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib
C:\PROGRA~1\QGIS3~1.4\bin
C:\PROGRA~1\QGIS3~1.4\apps\Python37
C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages
C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\win32
C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\Pythonwin
C:/Users/nomd/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/nomd/qgis
oponcea commented 5 years ago

I can confirm this for 3.6 under Ubuntu 18.04 as well. It looks like the problem originates in the OpenLayer plugin.

An error has occurred while executing Python code: 

TypeError: writeXml() takes 3 positional arguments but 4 were given 
TypeError: writeXml() takes 3 positional arguments but 4 were given

Python version: 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0] 
QGIS version: 3.6.2-Noosa Noosa, 656500e 

Python Path:
/usr/share/qgis/python
/home/ovidiu/.local/share/QGIS/QGIS3/profiles/default/python
/home/ovidiu/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib/python36.zip
/usr/lib/python3.6
/usr/lib/python3.6/lib-dynload
/usr/local/lib/python3.6/dist-packages
/usr/lib/python3/dist-packages
/home/ovidiu/.local/share/QGIS/QGIS3/profiles/default/python
void32 commented 5 years ago

I have seen this as well with QGIS 3.6.2-Noosa on Windows 10.

twingkle commented 4 years ago

I have this problem with QGIS 3.10.7 on Window 10 too.