(()=>{"use strict";$(document).ready((function(){console.log("map-projects"),$("#map-projects .thumbnail a.liz-project-show-desc").each((function(t,a){$(a).attr("onclick","")})),$("#map-projects .thumbnail a.liz-project-show-desc").click((function(){var t=$(this).attr("href");t=t.replace("link-projet-","liz-project-modal-");var a=$("#lizmap-modal");a.html($(t).html()).modal("show");var r=a.find("span.proj").text(),e=a.find("span.bbox").text();return lizMap.loadProjDefinition(r,(function(t){var r=OpenLayers.Bounds.fromString(e);r.transform(t,"EPSG:4326");var o=lizMap.map.getExtent().transform(lizMap.map.getProjection(),"EPSG:4326");if(r.containsBounds(o)){var n=a.find("a.liz-project-view"),i=n.attr("href");n.attr("href",OpenLayers.Util.urlAppend(i,"#"+o))}})),!1})),$("#map-projects .thumbnail a.liz-project-view").click((function(){var t=$(this),a=t.parent().parent().find("div.liz-project");if(a.length<1)return!1;var r=(a=a[0]).dataset.lizmapRepository,e=a.dataset.lizmapProject,o=a.dataset.lizmapProj,n=a.dataset.lizmapBbox;return function(t,a,r,e){var o=t.replace(/^\s+|\s+$/g,"");o in Proj4js.defs?e(o):$.get(globalThis.lizUrls.wms,{repository:a,project:r,SERVICE:"WMS",REQUEST:"GetProj4",authid:o},(function(t){Proj4js.defs[o]=t,new OpenLayers.Projection(o),e(o)}))}(o,r,e,(function(a){var r=OpenLayers.Bounds.fromString(n);r.transform(a,"EPSG:4326");var e=new OpenLayers.Bounds(lizMap.mainLizmap.state.map.extent).transform(lizMap.map.getProjection(),"EPSG:4326");r.containsBounds(e)?window.location=OpenLayers.Util.urlAppend(t.attr("href"),"#"+e.toArray().map((t=>t.toFixed(6))).join()):window.location=t.attr("href")})),!1}))}))})();
//# sourceMappingURL=map-projects.js.map