3liz / qgis-lizmap-server-plugin

QGIS Server plugin for Lizmap
GNU General Public License v2.0
6 stars 6 forks source link

Explain how to Fix the "Missing API key" error in QGIS projects #83

Closed abodsalas closed 2 months ago

abodsalas commented 2 months ago

I can see that I'm supposed to:

Either add the API key for this provider Or remove the layer. Or disable these API checks using environment variables on the server side of the Lizmap server plugin.

I wish to do the third option. In the server's plugin I see that I have to change "STRICT_BING_TOS_CHECK and STRICT_GOOGLE_TOS_CHECK" to "FALSE".

What are the detailed instructions that I have to do, in order to change these Eniroment Variables, considering I'm installing Lizmap using the Docker Compose installation?

QGIS Version: 3.28.13 Lizmap Version 3.6.14 QGIS Lizmap Plugin: 4.3.19

mind84 commented 2 months ago

Hi @abodsalas,

if you use the Docker compose stack there is an environment section under the QGIS server container definition (usually the map container). Simply add STRICT_BING_TOS_CHECK: false and STRICT_GOOGLE_TOS_CHECK: false under this section.

Restart the container

Gustry commented 2 months ago

Thanks @mind84

abodsalas commented 2 months ago

Thank you so much mind84.

Here is what I did, in case anyone has the same issue.....

git clone https://github.com/3liz/lizmap-docker-compose.git
cd lizmap-docker-compose
nano docker-compose.yml

Search for the "map:" container, and add the text suggested by mind84:

...
...
...
  map:
    image: 3liz/qgis-map-server:${QGIS_VERSION_TAG}
    environment:
      STRICT_BING_TOS_CHECK: false
      STRICT_GOOGLE_TOS_CHECK: false
      PGSERVICEFILE: /srv/etc/pg_service.conf
      PGSPASSFILE: /srv/etc/pgpass.conf
...
...
etc

Then i did my usual docker compose up -d

And it worked.

In QGIS I usually use the basemaps that Klas Karlsson has made available by running his python script at: https://raw.githubusercontent.com/klakar/QGIS_resources/master/collections/Geosupportsystem/python/qgis_basemaps.py

Thanks again....

Andrés Bodini Salas