(()=>{"use strict";$(document).ready((function(){$("#map-projects .thumbnail a.liz-project-show-desc").each((function(t,r){$(r).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 r=$("#lizmap-modal");r.html($(t).html()).modal("show");var e=r.find("span.proj").text(),n=r.find("span.bbox").text();return lizMap.loadProjDefinition(e,(function(t){var e=OpenLayers.Bounds.fromString(n);e.transform(t,"EPSG:4326");var a=lizMap.map.getExtent().transform(lizMap.map.getProjection(),"EPSG:4326");if(e.containsBounds(a)){var o=r.find("a.liz-project-view"),i=o.attr("href");o.attr("href",OpenLayers.Util.urlAppend(i,"#"+a))}})),!1})),$("#map-projects .thumbnail a.liz-project-view").click((function(){var t=$(this);const r=new URLSearchParams(t.attr("href").split("?")[1]);var e=t.parent().parent().find(".liz-project-desc"),n=e.find("span.proj").text(),a=e.find("span.bbox").text();return function(t,r,e,n){var a=t.replace(/^\s+|\s+$/g,"");a in Proj4js.defs?n(a):$.get(globalThis.lizUrls.wms,{repository:r,project:e,SERVICE:"WMS",REQUEST:"GetProj4",authid:a},(function(t){Proj4js.defs[a]=t,new OpenLayers.Projection(a),n(a)}))}(n,r.get("repository"),r.get("project"),(function(r){var e=OpenLayers.Bounds.fromString(a);e.transform(r,"EPSG:4326");var n=lizMap.map.getExtent().transform(lizMap.map.getProjection(),"EPSG:4326");e.containsBounds(n)?window.location=OpenLayers.Util.urlAppend(t.attr("href"),"#"+n):window.location=t.attr("href")})),!1}))}))})();
//# sourceMappingURL=map-projects.js.map