<div dir="ltr"><div dir="ltr"><div>What version of GeoMoose 3 are you using? (Have you pulled the current dev <br></div><div>version from github or are you using an official release?) Now that I think of it,</div><div>the ability to add legends to print has been added since the last official release.</div><div><br></div><div>If you're working on 3.6.2 (or earlier), that may be why it isn't working.</div><div><br></div><div>Chris</div><input name="virtru-metadata" type="hidden" value="{"email-policy":{"state":"closed","expirationUnit":"days","disableCopyPaste":false,"disablePrint":false,"disableForwarding":false,"enableNoauth":false,"persistentProtection":false,"expandedWatermarking":false,"expires":false,"isManaged":false},"attachments":{},"compose-id":"1","compose-window":{"secure":false}}"></div><br><div class="gmail_quote" style=""><div dir="ltr" class="gmail_attr">On Tue, Nov 17, 2020 at 12:21 AM flavio rigolon <<a href="mailto:flavio.rigolon@gmail.com">flavio.rigolon@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Il giorno lun 16 nov 2020 alle ore 17:12 Christopher Hughes<br>
<<a href="mailto:chughes@co.lincoln.or.us" target="_blank">chughes@co.lincoln.or.us</a>> ha scritto:<br>
><br>
> Hi Flavio,<br>
<br>
Hi Chris and thanks for the answer!<br>
<br>
><br>
> Within that 'letter-landscape-legend' you referenced, there should be a legend element that specifies where the legend appears (as well<br>
> as a legend title and a box around the legend):<br>
><br>
>         {<br>
>             type: 'text',<br>
>             x: 7.6, y: .9,<br>
>             text: 'Legend',<br>
>         },<br>
>         {<br>
>             type: 'legend',<br>
>             x: 7.61, y: 1.0<br>
>         },<br>
>         {<br>
>             type: 'rect',<br>
>             x: 7.6, y: .75,<br>
>             width: 2.4,<br>
>             height: 7,<br>
>             strokeWidth: .01,<br>
>          }<br>
><br>
> You also need to make sure that you're telling it to use custom layouts in the print preview variable (if you haven't already). You can<br>
> try making minor adjustments other than the legend to make sure your custom layout is being used. I've also found it's easier to copy<br>
> the entire example and implement that before making my customizations.<br>
><br>
>  var print_preview = app.add(gm3.components.PrintModal, 'print-preview', {<br>
>    layouts: custom_layouts<br>
>  });<br>
><br>
<br>
Yes, I did it. I copied the entire example you mentioned (that I've<br>
found on the page) and pasted it in the app.js. So I added it to the<br>
var print_preview as you said. I can choose my new layout from the<br>
drop down menu I named "A4-verticale" (so it should be correctly<br>
loaded) but the generated PDF doesn't contain the legend: only the<br>
title, map, scale bar, title legend appear, and a rectangle for legend<br>
frame, but the legend is not there.<br>
I use millimeters (mm) as units so I thought the problem was there<br>
(perhaps my error on positioning the objects) but the same behaviour I<br>
encountered in my local demo site with demo data (after modifying the<br>
app.js for the new layout like above) in which I didn't modify any<br>
units.<br>
<br>
This is my settings in app.js:<br>
<br>
 {<br>
   label: 'A4-verticale',<br>
   orientation: 'portrait',<br>
   page: 'a4',<br>
   units: 'mm',<br>
   elements: [<br>
       {<br>
           type: 'text',<br>
           size: 18, fontStyle: 'bold',<br>
           x: 10, y: 15, text: '{{title}}'<br>
       },<br>
       {<br>
           type: 'map',<br>
           x: 10, y: 18.5,<br>
           width: 160, height: 160<br>
       },<br>
       {<br>
           type: 'rect',<br>
           x: 10, y: 18.5,<br>
           width: 160, height: 160,<br>
           strokeWidth: .1<br>
       },<br>
       {<br>
           type: 'text',<br>
           x: 10, y: 185, text: 'Stampato il {{day}}/{{month}}/{{year}}'<br>
       },<br>
       {<br>
           type: 'text',<br>
           x: 10, y: 190,<br>
           text: 'Legenda',<br>
       },<br>
       {<br>
           type: 'legend',<br>
           x: 10, y: 193<br>
       },<br>
       {<br>
           type: 'rect',<br>
           x: 10, y: 193,<br>
           width: 100, height: 100,<br>
           strokeWidth: .1<br>
       }<br>
<br>
   ]<br>
 }<br>
<br>
and then:<br>
<br>
  var print_preview = app.add(gm3.components.PrintModal, 'print-preview', {<br>
    layouts: custom_layouts<br>
  });<br>
<br>
<br>
Here is a link to the output:<br>
<a href="https://www.dropbox.com/s/nrc15pmplvf5lmv/geomoose_print_test.png?dl=0" rel="noreferrer" target="_blank">https://www.dropbox.com/s/nrc15pmplvf5lmv/geomoose_print_test.png?dl=0</a><br>
<br>
Thanks again for any hints<br>
flavio<br>
_______________________________________________<br>
Geomoose-users mailing list<br>
<a href="mailto:Geomoose-users@lists.osgeo.org" target="_blank">Geomoose-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/geomoose-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/geomoose-users</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><font size="4">Chris Hughes</font><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">GIS Analyst</div><div style="font-size:12.8px"><font size="1">Lincoln County Surveyor Department </font></div><div><font size="1"><span style="font-family:Roboto,arial,sans-serif">880 NE 7th S</span><span style="font-family:Roboto,arial,sans-serif">t</span>. l Newport, OR 97365</font></div><div style="font-size:12.8px"><font size="1">Tel: (541) 574 1283</font></div></div></div></div>