I am new to qgis2leaf.

I am getting the


through qgis2leaf plugin. But as one can see i am not getting a color legend. I need to get the colors of bldg_use so that the map becomes readable. I needed to know what exactly to write in the legend_exp column, which i know i should be creating, so that respective colors of bldg_use are seen. I have a fairly basic understanding of html coding.


1: The legend table has the granularity of the layer table. So: one entry in the table per layer. If you define an entry in legend_ico and legend_exp only the first line in the attribute table will be used.

2: legend_ico could contain one path like 'pictures/legend_1.jpg' with a local path for your image. You need to create the image either by hand or place the desired image in the folder you determined. The image should be final in means of it should have the size it will have in the table itself. The above situation would require you to place an image in the export folder in the subfolder 'pictures/'. Another possibility is to place an image on a filehoster and use the web address of it in legend_ico: attribute table in the testfiles of the plugin legend_exp contains the text for the table section: enter image description here

Another possibility for your "categorized" style is to make a screenshot of the legend entry in QGIS and copy it in the desired location after export.

| improve this answer | |
  • Thank you. I will try out your method to see if i get a categorized style showing different colors for different bldg_use. – abhijit ekbote Apr 12 '15 at 2:07
  • Hi, i tried and it almost happened as expected. Only problem was that i think the size of the svg has to be minimal or else it overpowers the webpage. This time i had created a legend for three categories of plot_owner, Government, Trust and Private. The government.svg came out very big and the other two were not to be seen on the page. Is it because the px size of .svg that i have taken is large? – abhijit ekbote Apr 12 '15 at 3:57
  • I have altered my response to be more precise – Riccardo Apr 12 '15 at 5:06
  • Yes thanks again for that, i tried again and have finally succeeded. I reduced the size of the .svg files and had to alter some html code of the index.html It was only including the first .svg and remaining two were absent, so i added them manually in the file and it worked!! Thanks again :) – abhijit ekbote Apr 12 '15 at 12:58
  • please mark the question as answered and maybe also mark my answer as the correct one. – Riccardo Apr 12 '15 at 14:06

Here are the screen shots of the final work. The webpage

enter image description here

and part of the html code which i had to alter

enter image description here

| improve this answer | |

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.