OpenLayers plugin in QGIS 2.4 is not working properly when not loaded in first place.

If I add an OSM map with the plugin immediately when opening QGIS, all goes well. But when I call the plugin after having added some other layer before, I have these trace-backs:

An error has occurred while executing Python code:

Traceback (most recent call last):
File "/home/username/.qgis2/python/plugins/openlayers_plugin/openlayers_layer.py", line 134, in pageLoaded
File "/home/username/.qgis2/python/plugins/openlayers_plugin/openlayers_layer.py", line 184, in setup_map
olSize = QSize(int(olWidth), int(olHeight))
OverflowError: cannot convert float infinity to integer

1 Answer 1


The openlayers plugin requires the project CRS to be set to EPSG:3857. If OL is the first layer, it sets the project CRS successfully. In your case, setting the CRS seems to fail.

So set the project CRS manually to EPSG:3857 before adding an Openlayers plugin background.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.