[Qgis-user] QGIS web map - add author name
Jeroen Hovens
mail at groenebij.nl
Fri Jun 15 07:56:53 PDT 2018
Hi Yossi,
I have two solutions for this, both are about editing the index.html file, in a webmap based on Leaflet (I do not know if OpenLayer produces a different index.html)
You could add your name at the bottom-right copyright/source line by adding text to the following line:
var hash = new L.Hash(map);
map.attributionControl.addAttribution('<a href="https://github.com/tomchadwin/qgis2web" target="_blank">qgis2web</a> Map created by YourName');
Or you could add a textbox by adding the following section to the end of the index.html, but before the line setBounds();
var author = new L.Control({position:'bottomright'});
author.onAdd = function (map) {
this._div = L.DomUtil.create('div', 'info');
this.update();
return this._div;
};
author.update = function () {
this._div.innerHTML = 'Map created by Yourname’;
};
author.addTo(map);
Greetings,
Jeroen
Van: Qgis-user <qgis-user-bounces at lists.osgeo.org> Namens Yossi Rokni
Verzonden: donderdag 31 mei 2018 08:16
Aan: qgis-user at lists.osgeo.org
Onderwerp: [Qgis-user] QGIS web map - add author name
Hi,
I created my first web map in QGIS, using the good instructions in this web page:
<https://www.qgistutorials.com/en/docs/web_mapping_with_qgis2web.html> https://www.qgistutorials.com/en/docs/web_mapping_with_qgis2web.html
I want to add my name as a fixed text at the bottom of the map.
Is it possible to do it by updating the file qgis2web.js or any other way?
I am not familiar with java script - it would be great if you could provide me the relevant java script command that I need to add into qgis2web.js.
Some more details:
I use QGIS version 2.18 (I tried using QGIS 3.0, but I couldn't create a web map in this version).
I created the web map using qgis2web plugin.
Thanks
Yossi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20180615/34592c8b/attachment.html>
More information about the Qgis-user
mailing list