lizMap.events.on({lizmappopupdisplayed:function(){"qgisServerPlugins"in lizMap.config&&"atlasprint"in lizMap.config.qgisServerPlugins&&"printTemplates"in lizMap.config&&0!=lizMap.config.printTemplates.length&&$("div.lizmapPopupDiv").each((function(){if(0!=$(this).find("a.lizmap-atlasprint-link").length)return!0;if(0==$(this).find("input.lizmap-popup-layer-feature-id").length)return!0;var t=$(this).find("input.lizmap-popup-layer-feature-id:first").val().split("."),i=t[0],a=t[1],e=t[0].split(/[0-9]/)[0];for(var l in lizMap.config.printTemplates){var n=lizMap.config.printTemplates[l];if("atlas"in n&&i==n.atlas.coverageLayer){var s=OpenLayers.Util.urlAppend(lizUrls.wms,OpenLayers.Util.getParameterString(lizUrls.params));s+="&SERVICE=WMS",s+="&VERSION=1.3.0&REQUEST=GetPrintAtlas",s+="&FORMAT=pdf",s+="&EXCEPTIONS=application/vnd.ogc.se_inimage&TRANSPARENT=true",s+="&DPI=100",s+="&TEMPLATE="+n.title,s+="&LAYER="+e,s+="&EXP_FILTER=$id IN ("+a+")";let t="";const i=["lizmap_user","lizmap_user_groups"];for(const a of n.labels)i.includes(a.id)||(a.htmlState?t+=`<textarea class="atlasprint-custom-labels" cols="15" data-print-id="${a.id}" name="${a.id}" placeholder="${a.text}">${a.text}</textarea>`:t+=`<input type="text" class="atlasprint-custom-labels" size="15" data-print-id="${a.id}" name="${a.id}" placeholder="${a.text}" value="${a.text}">`);const l=""===t?"":`<div class="toggle-custom-labels-view"><button><i class="icon-cog" title="${lizDict["print.customLabels.tooltip"]}"></i></button><div>${t}</div></div>`;$(this).append('<a class="lizmap-atlasprint-link" data-href="'+s+'" href="'+s+'" target="_blank" title="'+lizDict["attributeLayers.toolbar.btn.data.export.title"]+" "+n.title+'"><span class="icon"></span>'+n.title+"</a>"+l+"<br>"),$(".toggle-custom-labels-view > button").click((function(){$(this).next().toggle()})),$(".atlasprint-custom-labels").on("input",(function(){const t=$(this).parents(".toggle-custom-labels-view").prev();let i="";$(".atlasprint-custom-labels").each((function(){i+="&"+$(this).data("print-id")+"="+encodeURIComponent($(this).val())})),t.attr("href",t.data("href")+i)})),$(this).find("a.lizmap-atlasprint-link, .toggle-custom-labels-view button i").tooltip()}}}))}});
//# sourceMappingURL=popupQgisAtlas.js.map