-
-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Add QMS Google Maps Tiles #4357
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition.
So it works if you use QMS AND you set a API key in the plugin right ?
Sorry, I see you description, we will have to warn users about some corner cases. Honestly, for me using Google without an API key is discouraged as it's against Google TOS.
I'm wondering if there should some kind of automatic attribution done ? AS we know there is a Google layer, maybe the attribution on the bottom right corner should be automatically added ? Maybe it's done already ? I'm not sure what the Google TOS about this ?
Anyway, thanks for you work.
Can you rename your commit, like a similar title as your PR ? it will make the git history better. |
Yes, as BingMaps. If you don't specify any KEY in Lizmap plugin, then the Do you think this behavior should be prevented and we should raise an error in this case? IMHO it's up to the user to make this choice
Yes, it is already done Google Maps TOS is quite restrictive and some aspect are rather unclear IMHO. For example, take this paragraph extracted from https://cloud.google.com/maps-platform/terms: (e) No Use With Non-Google Maps. To avoid quality issues and/or brand confusion, Customer will not use the Google Maps Core Services with or near a non-Google Map in a Customer Application. For example, Customer will not (i) display or use Places content on a non-Google map, (ii) display Street View imagery and non-Google maps on the same screen, or (iii) link a Google Map to non-Google Maps content or a non-Google map. I don't fully understand this point: there are a lot of cases (over 90% I guess?) where "Customer WILL USE the Google Maps Core Services with or near a non-Google Map" and they also paying to use these API. If this is not allowed, I'm wondering about the utility of integrate a Google Maps in any Costumer Application. My idea is that Google wants to avoid being associated to any improper use of their maps and to do so it has inserted a general clause and then possibly enforced it in case there were disputes of some kind. I don't think that Lizmap fits into this case. |
0e1bc73
to
41554dc
Compare
Maybe a new employee in an organization is not aware about publication rule and push a project with a Google layer and/or the Lizmap system administrator (provider) want to be clear about TOS used on his own server. Would it be possible to have a config in the In [tosCheckExternalTiles:default]
;google=yes
;bing=no |
Ok for adding a configuration for this, but instead of storing it in the file We should mark this option as sensitive, hidden when the flag Editing can be done with https://github.com/3liz/lizmap-web-client/blob/master/lizmap/modules/admin/controllers/config.classic.php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mind84 Later, we will forward this new flag in the JSON metadata to make the plugin aware about these layers. |
Hi @Gustry ! For now I have added the additional configuration in the Lizmap admin panel in the existing Any suggestion about labes or options placement would be appreciated :) @mdouchin they are also marked as sensitive, so when the corresponding flag is enabled, they do not appear in the config interface. So, this will probably be a very silly question, but I want to be sure about the logic after this point. If, say, Thanks! |
Sorry, I missed your question. I would say yes, to "remove the layer" on the server side, so the frontend won't be aware. Later, we will be able to forward these values in the JSON metadata from the server : like "authorized_external_providers" : ["google", "bing"],` I can plan a dev on the Lizmap plugin side. |
I think we should indeed remove the layer from the baselayer list. I a not sure though that removing it only from Side question : what about if the layer is not in the baselayers group, but anywhere else ? Not sure this PR should tackle it, but we should think about it too. |
Hi @mdouchin, @rldhont, @nboisteault, I'm working on it, but several questions arose during the process.
If I remove the layer from the config then Lizmap throws an error in console, eg: "externalAccess": {
"crs": "EPSG:3857",
"format": "",
"type": "xyz",
"url": "",<----------------
"zmax": "20",
"zmin": "0",
"disabled": true <-----------------------------------
} This way, also the url is hidden from the client (not a big achievement but it's better IHMO)
Generally speaking, TOS has nothing to do with the Api Key This is my proposal (eg for Google, extended to Bing end so on):
Please let me know if I completely misinterpreted the request. Thanks |
We should have a simple way to disable any group or layer to be displayed in the layer tree & the map. cc @rldhont @nboisteault |
I don't think the logic was correct.
But maybe, the first PR is to do the PHP config file |
@Gustry , Side question:
The overall logic is pretty simple, but I'm not very familiar with the Lizmap plugin server code. How can I enable/disable the Thanks |
I just pushed again on the PR. Can you have a look to the We can merge if you want, so you would have a zip on https://packages.3liz.org/pub/lizmap_server-qgis-plugin/unstable/ or on custom QGIS repository https://packages.3liz.org/pub/server-plugins-repository/unstable/ |
Ok! For me it's clear. Sys admin can set environmental variables (e.g. configured in docker compose or whatever) to enable/disable the Api Key check. Side note on TOS: Providing the API key in the request does not guarantee compliance with the TOS. I only point this out because from the
No rush for me at all, can wait for an official stable release Thanks! |
Yes it's the purpose. I was wondering if just a single variable would be OK, because I don't think there is a use case to enable just one and the other one. But let's go like this.
Yes true, I will see how I will rephrase on that. I will merge, so the ZIP will be available. Maybe after in the documentation docs.lizmap.com |
Backports ? |
For me, yes Thanks! |
Cool :) |
yep, I'll keep you updated |
Nice thanks. Because in your case, you fall back on #4029 which was "fixed" with a fix on the plugin side 3liz/lizmap-plugin#540 but I didn't expect the Thanks for this patch anyway ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice !
LGTM
What do you think about adding a very basic test loading google_basemap.qgs
and just testing no error is raised, or the expected google layer is present ? by using the new helper gotoMap
?
It seems the new project is not used for automatic testing.
Yes I could add a basic test, of course it will not be capable to test the whole functionality but its better than nothing Thanks |
No sure, we do not want to test the OpenLayers Google class :) Just that the map load correctly, and there isn't any JS error when loading the map. |
Thanks @nboisteault Do you still approve the PR ? I personally see :
So I'm in favor of merging. I will let @rldhont choose |
Since release 9.0, OpenLayers has introduced support form Google Maps Tiles.
This PR relies basically on the same logic of this one #4150
If a valid
Google Api Key
is provided in the Lizmap plugin, then the application uses the OL dedicated class to get tiles from the Google endpoint and the API key is used to issue requests.If no key is provided, then these tiles are treated as a
generic WMTS external layer
and the application get the tiles directly from the default URI set by QMS QGIS plugin. In this case it is not guaranteed that the tiles will work.Maps supported:
TEST NOTES
For now testing is manually. In the test repository there is a
google_basemap.qgs
project. You can configure the Lizmap plugin by adding your ownGoogle Api Key
and then check the functionality.Funded by Faunalia