-
-
Notifications
You must be signed in to change notification settings - Fork 146
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 Bing Maps #4150
Conversation
Thanks for tackling this ! Just a note for now :
This is fragile and will be broken IMHO. (or a dev in the plugin must be done, but I don't think it's the way to go) In the QGS file of your PR : <layer-tree-layer source="type=xyz&zmin=1&zmax=18&url=https://ecn.t3.tiles.virtualearth.net/tiles/a{q}.jpeg?g%3D0%26dir%3Ddir_n'" checked="Qt::Checked" patch_size="-1,-1" name="Bing Satellite" providerKey="wms" legend_exp="" expanded="1" legend_split_behavior="0" id="Bing_Satellite_9ceaa33e_9c61_4fd0_b607_68ffd5614d88"> QGIS is checking if the |
I agree with you and I think this is the most tricky part. Indeed, this is the main reason I've created a draft :)
Thanks for checking this! Surely the Thanks |
I've changed the logic using the |
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.
LGTM from the user point of view
The URL checks looks better like this.
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.
Good PR, thanks for the detailed description.
Only a question about the exposed bing key
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.
Is-it a typo ?
TL;DR
Enabling Bing Maps to be loaded as baselayers in LWC through OpenLayers dedicated implementation by importing Bing Maps in QGIS project from QuickMapServices QGIS Plugin
DETAILS
In previous versions of LWC (i.e. 3.6) it was possible to add a defined set of external layers (including Bing) by flagging the corresponding option in the plugin's
base-layer
panel and without adding any layer to the project. Then the plugin updates thecfg
accordingly by setting the corresponding properties in the option section of the cfg:Now, since the direction is to rely on the QGIS project, in newer versions this panel has become deprecated and the above properties that defines these external layers are no longer written in
cfg
file.Furthermore, following the update of the OpenLayers library, some of this external layers are not longer supported (e.g. Google Maps) by the lib itself.
In the "Bing" specific case, the current version of OpenLayers offers supports for rendering Bing tiles.
This implementation allows LWC to recognize the
QMS Bing Maps
from QGIS project, read the correspondingBing Api Key
from thecfg
and instantiate with these options the Bing OpenLayers classNOTES
This functionality relies for now on the external
url
assigned to the layer by QMS when it is added on QGIS project. This url is set in theurl
property of theexternalAccess
object in thecfg
response.I guess this object was only kept for backwards compatibility since the properties listed are no longer written to the
cfg
file.I've extended this default configuration with a new
QMSExternalLayer object
, to keep things clearly separated (and hopefully maintainable).urls of Bing maps currently supported:
Bing Map
, aliasbing-road
in the LWC < 3.7 configuration. url =https://ecn.dynamic.t0.tiles.virtualearth.net/comp/CompositionHandler/{q}?mkt=en-us&it=G,VE,BX,L,LA&shading=hill
Bing Satellite
, aliasbing-aerial
in the LWC < 3.7 configuration. url =https://ecn.t3.tiles.virtualearth.net/tiles/a{q}.jpeg?g=0&dir=dir_n
.You can check this functionality in the
bing_basemap.qgs
project included in this PR.Thanks
Related to #4030
Funded by Faunalia