Is there a way to change the comma shown in the image below to |

The attribution section of a Leaflet map

I used the QGIS plugin QGIS2WEb to create the Leaflet map and wanted to link to the source of the information.

Currently, in the HTML code I have used the attribution format like so:

var overlay_GoogleHybrid_0 = L.tileLayer('https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}', {
        opacity: 1.0,
        attribution:'<a href="https://google.com" target="_blank">Base Layer Map info &copy; Google</a>',

I am also unsure if this is the correct method of referencing the Google Hybrid layer I am using (Obtained using the Quick Map Services plugin).


The short answer is no, because that comma is generated by Leaflet itself:

prefixAndAttribs.push(attribs.join(', '));


The long answer is that, with work, the "qgis2web" part could be moved into the attribution's prefix (ie before the pipe symbol) - in fact that would be quite a good idea, but requires development of the qgis2web plugin itself. Individual layer attributions would still be comma-separated, though.

  • Ok thanks for the quick reply, would be a decent addition as it looks a bit odd without it. Nov 12 '18 at 16:47
  • 1
    I've made this change to qgis2web master branch. It will be part of the next release of the plugin. Nov 13 '18 at 10:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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