--- a/src/pyams_gis/resources/js/pyams_gis.min.js Wed Jun 07 11:17:25 2017 +0200
+++ b/src/pyams_gis/resources/js/pyams_gis.min.js Wed Jun 21 12:14:58 2017 +0200
@@ -1,1 +1,1 @@
-(function(c,b){var d=b.MyAMS;var a;var e={RPC_ENDPOINT:"/api/gis/json",WGS_SRID:4326,_layersControlAddItem:function(m){var l=c("<div></div>").addClass("inline-group"),i=c("<label></label>").addClass(m.overlay?"checkbox":"radio"),g,j=c("<i></i>"),h,k=this._map.hasLayer(m.layer);if(m.overlay){g=document.createElement("input");g.type="checkbox";g.className="leaflet-control-layers-selector";g.defaultChecked=k}else{g=this._createRadioElement("leaflet-base-layers",k)}g.layerId=a.stamp(m.layer);c(g).addClass(m.overlay?"checkbox":"radio");a.DomEvent.on(g,"click",this._onInputClick,this);h=c("<span></span>").text(" "+m.name);i.append(g);i.append(j);i.append(h);l.append(i);var f=m.overlay?this._overlaysList:this._baseLayersList;c(f).append(l);return l},init:function(g,f,i){var h=g;d.ajax.check(b.L,"/--static--/pyams_gis/js/leaflet-1.0.3"+d.devext+".js",function(j){if(j){a=b.L;a.Control.Layers.prototype._addItem=e._layersControlAddItem;d.getCSS("/--static--/pyams_gis/css/leaflet-1.0.3"+d.devext+".css","leaflet")}d.ajax.post("get-map-configuration.json",{},function(m){var p=h.data();var n={preferCanvas:p.mapLeafletPreferCanvas||false,attributionControl:p.mapLeafletAttributionControl===undefined?m.attributionControl:p.mapLeafletAttributionControl,zoomControl:p.mapLeafletZoomControl===undefined?m.zoomControl:p.mapLeafletZoomControl,crs:p.mapLeafletCrs||d.getObject(m.crs)||b.L.CRS.EPSG3857,center:p.mapLeafletCenter||m.center,zoom:p.mapLeafletZoom||m.zoom};n=c.extend({},n,f);h.trigger("map.init",[h,n,m]);var o=a.map(h.attr("id"),n);if(m.layers){for(var l=0;l<m.layers.length;l++){var k=m.layers[l];h.trigger("map.layer.init",[h,k]);e.getLayer(k).addTo(o)}}else{a.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,id:"osm",attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(o)}if(m.zoomControl&&(p.mapLeafletHideZoomControl!==true)){a.control.scale().addTo(o)}if(m.bounds){o.fitBounds(m.bounds)}h.data("leafmap",o);h.data("leafmap.config",m);h.trigger("map.finishing",[h,o]);if(i){i(o,m)}h.trigger("map.finished",[h,o])})})},getLayer:function(i){var g=d.getObject(i.factory);if(g!==undefined){delete i.factory;var f=[];if(i.dependsOn){for(var h in i.dependsOn){if(!i.dependsOn.hasOwnProperty(h)){continue}if(d.getObject(h)===undefined){f.push(d.getScript(i.dependsOn[h]))}}delete i.dependsOn}if(f.length>0){c.when.apply(c,f)}return g(i)}},factory:{TileLayer:function(g){var f=g.url;delete g.url;return a.tileLayer(f,g)},WMS:function(g){var f=g.url;delete g.url;return a.tileLayer.wms(f,g)},Geoportal:{WMS:function(f){d.getCSS("/--static--/pyams_gis/css/leaflet-gp-3.0.2"+d.devext+".css","geoportal");return a.geoportalLayer.WMS(f)}},ESRI:{Feature:function(f){return a.esri.featureLayer(f)}},Google:function(g){var h=g.apiKey;delete g.apiKey;if(d.getObject("window.google.maps")===undefined){var f=d.getScript("https://maps.googleapis.com/maps/api/js?key="+h);c.when.apply(c,[f])}return a.gridLayer.googleMutant(g)}},callJSON:function(h,f,g){d.ajax.check(c.jsonRPC,d.baseURL+"ext/jquery-jsonrpc"+d.devext+".js",function(){c.jsonRPC.withOptions({endPoint:e.RPC_ENDPOINT,cache:false},function(){c.jsonRPC.request(h,{id:new Date().getTime(),params:f,success:g,error:d.error.show})})})},position:{init:function(){var f=c(".map",c(this));if(f.data("leafmap")===undefined){f.css("height",c(window).height()-200);e.init(f,{},function(o,h){var j=f.data();var p=a.icon({iconUrl:"/--static--/pyams_gis/img/marker-icon.png",iconSize:[25,41],iconAnchor:[13,40]});var k=a.marker();k.setIcon(p);var m=j.mapLeafletFieldname;var g=c('input[name="'+m+'.widgets.longitude"]');var n=c('input[name="'+m+'.widgets.latitude"]');if(g.val()&&n.val()){var l=c('select[name="'+m+'.widgets.projection:list"]');var i={point:{longitude:parseFloat(g.val()),latitude:parseFloat(n.val())},from_projection:l.val()||e.WGS_SRID,to_projection:e.WGS_SRID};e.callJSON("transformPoint",i,function(r){if(!r.error){var q=r.result.point;k.setLatLng({lon:q.longitude,lat:q.latitude});k.addTo(o);o.setView(k.getLatLng(),h.zoom||13)}})}else{k.setLatLng([-90,0]);k.addTo(o)}f.data("marker",k);o.on("click",e.position.onClick)})}},onClick:function(i){var k=i.target.getContainer();var j=c(k).data();var g=j.marker;var m=i.latlng;g.setLatLng(m);var h=j.mapLeafletFieldname;var f=c('select[name="'+h+'.widgets.projection:list"]');var l={point:{longitude:m.lng,latitude:m.lat},from_projection:e.WGS_SRID,to_projection:f.val()};e.callJSON("transformPoint",l,function(o){if(!o.error){var n=o.result.point;c('input[name="'+h+'.widgets.longitude"]').val(n.longitude);c('input[name="'+h+'.widgets.latitude"]').val(n.latitude)}})},changedCoordinate:function(){var h=c(this);var j=c(".map",h.parents("fieldset:first"));if(!j.data("marker")){return}var g=j.data("map-leaflet-fieldname");var i=c('input[name="'+g+'.widgets.longitude"]');var l=c('input[name="'+g+'.widgets.latitude"]');if(i.val()&&l.val()){var f=c('select[name="'+g+'.widgets.projection:list"]');var k={point:{longitude:parseFloat(i.val()),latitude:parseFloat(l.val())},from_projection:f.val(),to_projection:4326};e.callJSON("transformPoint",k,function(n){if(!n.error){var m=n.result.point;var o=j.data("marker");o.setLatLng({lon:m.longitude,lat:m.latitude})}})}},changedProjection:function(h){var n=c(this);var g=c(".map",n.parents("fieldset:first"));var k=g.data("map-leaflet-fieldname");var f=c('input[name="'+k+'.widgets.longitude"]');var m=c('input[name="'+k+'.widgets.latitude"]');if(h.removed){var j=h.removed.id;var l=h.added.id;if(j!==l){if(f.val()&&m.val()){var i={point:{longitude:parseFloat(f.val()),latitude:parseFloat(m.val())},from_projection:j,to_projection:l};e.callJSON("transformPoint",i,function(p){if(!p.error){var o=p.result.point;f.val(o.longitude);m.val(o.latitude)}})}}}else{e.position.changedCoordinate.apply(f)}},clear:function(g){var f=c(this).parents("fieldset:first");c("input",f).val(null)}},area:{init:function(){var f=c(".map",c(this));if(f.data("leafmap")===undefined){f.css("height",c(window).height()-200);e.init(f,{},function(g){a.Draw=a.Draw||{};a.Edit=a.Edit||{};d.ajax.check([a.Draw,a.Draw.Event,a.Map.TouchExtend,a.Edit.SimpleShape],["/--static--/pyams_gis/js/leaflet.Draw"+d.devext+".js","/--static--/pyams_gis/js/leaflet.Draw.Event"+d.devext+".js","/--static--/pyams_gis/js/TouchEvents"+d.devext+".js","/--static--/pyams_gis/js/Edit.SimpleShape"+d.devext+".js"],function(){d.ajax.check(a.Edit.Rectangle,"/--static--/pyams_gis/js/Edit.Rectangle"+d.devext+".js",function(){function h(v,u){var t=new a.FeatureGroup();p=a.rectangle([v,u]);t.addLayer(p);g.addLayer(t);g.fitBounds(p.getBounds());p.editing.enable();f.data("area",p);g.on(a.Draw.Event.EDITMOVE,e.area.changedArea);g.on(a.Draw.Event.EDITRESIZE,e.area.changedArea);g.on(a.Draw.Event.EDITVERTEX,e.area.changedArea)}var l=f.data();var n=l.mapLeafletFieldname;var j=c('input[name="'+n+'.widgets.x1"]');var q=c('input[name="'+n+'.widgets.y1"]');var i=c('input[name="'+n+'.widgets.x2"]');var o=c('input[name="'+n+'.widgets.y2"]');var s,r,p;if(j.val()&&q.val()&&i.val()&&o.val()){var m=c('select[name="'+n+'.widgets.projection:list"]');var k={area:{x1:parseFloat(j.val()),y1:parseFloat(q.val()),x2:parseFloat(i.val()),y2:parseFloat(o.val())},from_projection:m.val(),to_projection:e.WGS_SRID};e.callJSON("transformArea",k,function(t){if(!t.error){var u=t.result.area;s=a.latLng({lon:u.x1,lat:u.y1});r=a.latLng({lon:u.x2,lat:u.y2});h(s,r)}})}else{s=a.latLng({lon:-168,lat:-56.37});r=a.latLng({lon:191.25,lat:83.72});h(s,r)}})})})}},last_event:null,changedArea:function(f){e.area.last_event=f;setTimeout(function(){if(f===e.area.last_event){var k=f.target.getContainer();var j=c(k).data();var i=j.area.getBounds();var h=j.mapLeafletFieldname;var g=c('select[name="'+h+'.widgets.projection:list"]').val();var l={area:{x1:i.getWest(),y1:i.getSouth(),x2:i.getEast(),y2:i.getNorth()},from_projection:e.WGS_SRID,to_projection:g};e.callJSON("transformArea",l,function(m){if(!m.error){var n=m.result.area;c('input[name="'+h+'.widgets.x1"]').val(n.x1);c('input[name="'+h+'.widgets.y1"]').val(n.y1);c('input[name="'+h+'.widgets.x2"]').val(n.x2);c('input[name="'+h+'.widgets.y2"]').val(n.y2)}})}},100)},changedCoordinate:function(){var n=c(this);var f=c(".map",n.parents("fieldset:first"));if(!f.data("area")){return}var j=f.data("map-leaflet-fieldname");var h=c('input[name="'+j+'.widgets.x1"]');var m=c('input[name="'+j+'.widgets.y1"]');var g=c('input[name="'+j+'.widgets.x2"]');var l=c('input[name="'+j+'.widgets.y2"]');if(h.val()&&m.val()&&g.val()&&l.val()){var k=c('select[name="'+j+'.widgets.projection:list"]');var i={area:{x1:parseFloat(h.val()),y1:parseFloat(m.val()),x2:parseFloat(g.val()),y2:parseFloat(l.val())},from_projection:k.val(),to_projection:4326};e.callJSON("transformArea",i,function(o){if(!o.error){var q=o.result.area;var p=f.data("area");p.editing.disable();p.setBounds([a.latLng({lon:q.x1,lat:q.y1}),a.latLng({lon:q.x2,lat:q.y2})]);p.editing.enable()}})}},changedProjection:function(g){var p=c(this);var f=c(".map",p.parents("fieldset:first"));var l=f.data("map-leaflet-fieldname");var i=c('input[name="'+l+'.widgets.x1"]');var o=c('input[name="'+l+'.widgets.y1"]');var h=c('input[name="'+l+'.widgets.x2"]');var n=c('input[name="'+l+'.widgets.y2"]');if(g.removed){var k=g.removed.id;var m=g.added.id;if(k!==m){if(i.val()&&o.val()&&h.val()&&n.val()){var j={area:{x1:parseFloat(i.val()),y1:parseFloat(o.val()),x2:parseFloat(h.val()),y2:parseFloat(n.val())},from_projection:k,to_projection:m};e.callJSON("transformArea",j,function(q){if(!q.error){var r=q.result.area;i.val(r.x1);o.val(r.y1);h.val(r.x2);n.val(r.y2)}})}}}else{e.area.changedCoordinate.apply(i)}},clear:function(g){var f=c(this).parents("fieldset:first");c("input",f).val(null)}}};b.PyAMS_GIS=e})(jQuery,this);
\ No newline at end of file
+(function(c,b){var d=b.MyAMS;var a;var e={RPC_ENDPOINT:"/api/gis/json",WGS_SRID:4326,_layersControlAddItem:function(m){var l=c("<div></div>").addClass("inline-group"),i=c("<label></label>").addClass(m.overlay?"checkbox":"radio"),g,j=c("<i></i>"),h,k=this._map.hasLayer(m.layer);if(m.overlay){g=document.createElement("input");g.type="checkbox";g.className="leaflet-control-layers-selector";g.defaultChecked=k}else{g=this._createRadioElement("leaflet-base-layers",k)}g.layerId=a.stamp(m.layer);c(g).addClass(m.overlay?"checkbox":"radio");a.DomEvent.on(g,"click",this._onInputClick,this);h=c("<span></span>").text(" "+m.name);i.append(g);i.append(j);i.append(h);l.append(i);var f=m.overlay?this._overlaysList:this._baseLayersList;c(f).append(l);return l},init:function(g,f,i){var h=g;d.ajax.check(b.L,"/--static--/pyams_gis/js/leaflet-1.0.3"+d.devext+".js",function(j){if(j){a=b.L;a.Control.Layers.prototype._addItem=e._layersControlAddItem;d.getCSS("/--static--/pyams_gis/css/leaflet-1.0.3"+d.devext+".css","leaflet")}d.ajax.post("get-map-configuration.json",{},function(m){var p=h.data();var n={preferCanvas:p.mapLeafletPreferCanvas||false,attributionControl:p.mapLeafletAttributionControl===undefined?m.attributionControl:p.mapLeafletAttributionControl,zoomControl:p.mapLeafletZoomControl===undefined?m.zoomControl:p.mapLeafletZoomControl,crs:p.mapLeafletCrs||d.getObject(m.crs)||b.L.CRS.EPSG3857,center:p.mapLeafletCenter||m.center,zoom:p.mapLeafletZoom||m.zoom};n=c.extend({},n,f);h.trigger("map.init",[h,n,m]);var o=a.map(h.attr("id"),n);if(m.layers){for(var l=0;l<m.layers.length;l++){var k=m.layers[l];h.trigger("map.layer.init",[h,k]);e.getLayer(k).addTo(o)}}else{a.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,id:"osm",attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(o)}if(m.zoomControl&&(p.mapLeafletHideZoomControl!==true)){a.control.scale().addTo(o)}if(m.bounds){o.fitBounds(m.bounds)}h.data("leafmap",o);h.data("leafmap.config",m);h.trigger("map.finishing",[h,o]);if(i){i(o,m)}h.trigger("map.finished",[h,o])})})},getLayer:function(i){var g=d.getObject(i.factory);if(g!==undefined){delete i.factory;var f=[];if(i.dependsOn){for(var h in i.dependsOn){if(!i.dependsOn.hasOwnProperty(h)){continue}if(d.getObject(h)===undefined){f.push(d.getScript(i.dependsOn[h]))}}delete i.dependsOn}if(f.length>0){c.when.apply(c,f)}return g(i)}},factory:{TileLayer:function(g){var f=g.url;delete g.url;return a.tileLayer(f,g)},WMS:function(g){var f=g.url;delete g.url;return a.tileLayer.wms(f,g)},Geoportal:{WMS:function(f){d.getCSS("/--static--/pyams_gis/css/leaflet-gp-3.0.2"+d.devext+".css","geoportal");return a.geoportalLayer.WMS(f)}},ESRI:{Feature:function(f){return a.esri.featureLayer(f)}},Google:function(g){var h=g.apiKey;delete g.apiKey;if(d.getObject("window.google.maps")===undefined){var f=d.getScript("https://maps.googleapis.com/maps/api/js?key="+h);c.when.apply(c,[f])}return a.gridLayer.googleMutant(g)}},callJSON:function(h,f,g){d.ajax.check(c.jsonRPC,d.baseURL+"ext/jquery-jsonrpc"+d.devext+".js",function(){c.jsonRPC.withOptions({endPoint:e.RPC_ENDPOINT,cache:false},function(){c.jsonRPC.request(h,{id:new Date().getTime(),params:f,success:g,error:d.error.show})})})},position:{init:function(){var f=c(".map",c(this));if(f.data("leafmap")===undefined){f.css("height",c(window).height()-200);e.init(f,{},function(o,h){var j=f.data();var p=a.icon({iconUrl:"/--static--/pyams_gis/img/marker-icon.png",iconSize:[25,41],iconAnchor:[13,40]});var k=a.marker();k.setIcon(p);var m=j.mapLeafletFieldname;var g=c('input[name="'+m+'.widgets.longitude"]');var n=c('input[name="'+m+'.widgets.latitude"]');if(g.val()&&n.val()){var l=c('select[name="'+m+'.widgets.projection:list"]');var i={point:{longitude:parseFloat(g.val()),latitude:parseFloat(n.val())},from_projection:l.val()||e.WGS_SRID,to_projection:e.WGS_SRID};e.callJSON("transformPoint",i,function(r){if(!r.error){var q=r.result.point;k.setLatLng({lon:q.longitude,lat:q.latitude});k.addTo(o);o.setView(k.getLatLng(),h.zoom||13)}})}else{k.setLatLng([-90,0]);k.addTo(o)}f.data("marker",k);o.on("click",e.position.onClick)})}},onClick:function(i){var k=i.target.getContainer();var j=c(k).data();var g=j.marker;var m=i.latlng;g.setLatLng(m);var h=j.mapLeafletFieldname;var f=c('select[name="'+h+'.widgets.projection:list"]');var l={point:{longitude:m.lng,latitude:m.lat},from_projection:e.WGS_SRID,to_projection:f.val()};e.callJSON("transformPoint",l,function(o){if(!o.error){var n=o.result.point;c('input[name="'+h+'.widgets.longitude"]').val(n.longitude);c('input[name="'+h+'.widgets.latitude"]').val(n.latitude)}})},changedCoordinate:function(){var h=c(this);var j=c(".map",h.parents("fieldset:first"));if(!j.data("marker")){return}var g=j.data("map-leaflet-fieldname");var i=c('input[name="'+g+'.widgets.longitude"]');var l=c('input[name="'+g+'.widgets.latitude"]');if(i.val()&&l.val()){var f=c('select[name="'+g+'.widgets.projection:list"]');var k={point:{longitude:parseFloat(i.val()),latitude:parseFloat(l.val())},from_projection:f.val(),to_projection:4326};e.callJSON("transformPoint",k,function(n){if(!n.error){var m=n.result.point;var o=j.data("marker");o.setLatLng({lon:m.longitude,lat:m.latitude})}})}},changedProjection:function(h){var n=c(this);var g=c(".map",n.parents("fieldset:first"));var k=g.data("map-leaflet-fieldname");var f=c('input[name="'+k+'.widgets.longitude"]');var m=c('input[name="'+k+'.widgets.latitude"]');if(h.removed){var j=h.removed.id;var l=h.added.id;if(j!==l){if(f.val()&&m.val()){var i={point:{longitude:parseFloat(f.val()),latitude:parseFloat(m.val())},from_projection:j,to_projection:l};e.callJSON("transformPoint",i,function(p){if(!p.error){var o=p.result.point;f.val(o.longitude);m.val(o.latitude)}})}}}else{e.position.changedCoordinate.apply(f)}},clear:function(g){var f=c(this).parents("fieldset:first");c("input",f).val(null)}},area:{init:function(){var f=c(".map",c(this));if(f.data("leafmap")===undefined){f.css("height",c(window).height()-200);e.init(f,{},function(g){a.Draw=a.Draw||{};a.Edit=a.Edit||{};d.ajax.check([a.Draw,a.Draw.Event,a.Map.TouchExtend,a.Edit.SimpleShape],["/--static--/pyams_gis/js/leaflet.Draw"+d.devext+".js","/--static--/pyams_gis/js/leaflet.Draw.Event"+d.devext+".js","/--static--/pyams_gis/js/TouchEvents"+d.devext+".js","/--static--/pyams_gis/js/Edit.SimpleShape"+d.devext+".js"],function(){d.ajax.check(a.Edit.Rectangle,"/--static--/pyams_gis/js/Edit.Rectangle"+d.devext+".js",function(){function h(w,v){var u=new a.FeatureGroup();q=a.rectangle([w,v]);u.addLayer(q);g.addLayer(u);g.fitBounds(q.getBounds());q.editing.enable();f.data("area",q);g.on(a.Draw.Event.EDITMOVE,e.area.changedArea);g.on(a.Draw.Event.EDITRESIZE,e.area.changedArea);g.on(a.Draw.Event.EDITVERTEX,e.area.changedArea)}var m=f.data();var o=m.mapLeafletFieldname;var j=c('input[name="'+o+'.widgets.x1"]');var r=c('input[name="'+o+'.widgets.y1"]');var i=c('input[name="'+o+'.widgets.x2"]');var p=c('input[name="'+o+'.widgets.y2"]');var t,s,q;if(j.val()&&r.val()&&i.val()&&p.val()){var n=c('select[name="'+o+'.widgets.projection:list"]');var l={area:{x1:parseFloat(j.val()),y1:parseFloat(r.val()),x2:parseFloat(i.val()),y2:parseFloat(p.val())},from_projection:n.val(),to_projection:e.WGS_SRID};e.callJSON("transformArea",l,function(u){if(!u.error){var v=u.result.area;t=a.latLng({lon:v.x1,lat:v.y1});s=a.latLng({lon:v.x2,lat:v.y2});h(t,s)}})}else{var k=f.data("leafmap.config");if(k.bounds){t=a.latLng(k.bounds[0]);s=a.latLng(k.bounds[1])}else{t=a.latLng({lon:-168,lat:-56.37});s=a.latLng({lon:191.25,lat:83.72})}h(t,s)}})})})}},last_event:null,changedArea:function(f){e.area.last_event=f;setTimeout(function(){if(f===e.area.last_event){var k=f.target.getContainer();var j=c(k).data();var i=j.area.getBounds();var h=j.mapLeafletFieldname;var g=c('select[name="'+h+'.widgets.projection:list"]').val();var l={area:{x1:i.getWest(),y1:i.getSouth(),x2:i.getEast(),y2:i.getNorth()},from_projection:e.WGS_SRID,to_projection:g};e.callJSON("transformArea",l,function(m){if(!m.error){var n=m.result.area;c('input[name="'+h+'.widgets.x1"]').val(n.x1);c('input[name="'+h+'.widgets.y1"]').val(n.y1);c('input[name="'+h+'.widgets.x2"]').val(n.x2);c('input[name="'+h+'.widgets.y2"]').val(n.y2)}})}},100)},changedCoordinate:function(){var n=c(this);var f=c(".map",n.parents("fieldset:first"));if(!f.data("area")){return}var j=f.data("map-leaflet-fieldname");var h=c('input[name="'+j+'.widgets.x1"]');var m=c('input[name="'+j+'.widgets.y1"]');var g=c('input[name="'+j+'.widgets.x2"]');var l=c('input[name="'+j+'.widgets.y2"]');if(h.val()&&m.val()&&g.val()&&l.val()){var k=c('select[name="'+j+'.widgets.projection:list"]');var i={area:{x1:parseFloat(h.val()),y1:parseFloat(m.val()),x2:parseFloat(g.val()),y2:parseFloat(l.val())},from_projection:k.val(),to_projection:4326};e.callJSON("transformArea",i,function(o){if(!o.error){var q=o.result.area;var p=f.data("area");p.editing.disable();p.setBounds([a.latLng({lon:q.x1,lat:q.y1}),a.latLng({lon:q.x2,lat:q.y2})]);p.editing.enable()}})}},changedProjection:function(g){var p=c(this);var f=c(".map",p.parents("fieldset:first"));var l=f.data("map-leaflet-fieldname");var i=c('input[name="'+l+'.widgets.x1"]');var o=c('input[name="'+l+'.widgets.y1"]');var h=c('input[name="'+l+'.widgets.x2"]');var n=c('input[name="'+l+'.widgets.y2"]');if(g.removed){var k=g.removed.id;var m=g.added.id;if(k!==m){if(i.val()&&o.val()&&h.val()&&n.val()){var j={area:{x1:parseFloat(i.val()),y1:parseFloat(o.val()),x2:parseFloat(h.val()),y2:parseFloat(n.val())},from_projection:k,to_projection:m};e.callJSON("transformArea",j,function(q){if(!q.error){var r=q.result.area;i.val(r.x1);o.val(r.y1);h.val(r.x2);n.val(r.y2)}})}}}else{e.area.changedCoordinate.apply(i)}},clear:function(g){var f=c(this).parents("fieldset:first");c("input",f).val(null)}}};b.PyAMS_GIS=e})(jQuery,this);
\ No newline at end of file