diff --git a/client/eqwc.js b/client/eqwc.js index 85c7797e..375aa33c 100644 --- a/client/eqwc.js +++ b/client/eqwc.js @@ -8,7 +8,7 @@ b.add)this.totalLength=Math.max(a,this.data.length+c.length),this.add(c);else{th b.callback.call(b.scope||this,[],b,!1,a)},loadData:function(a,b){this.isPaging(Ext.apply({},this.lastOptions?this.lastOptions.params:null,this.baseParams));var c=this.reader.readRecords(a);this.loadRecords(c,{add:b},!0)},getTotalCount:function(){return this.allData?this.allData.getCount():this.totalLength||0},sortData:function(){var a=this.hasMultiSort?this.multiSortInfo:this.sortInfo,b=a.direction||"ASC",c=a.sorters,d=[];this.hasMultiSort||(c=[{direction:b,field:a.field}]);for(var a=0,e=c.length;a< e;a++)d.push(this.createSortFunction(c[a].field,c[a].direction));if(d.length){var f="DESC"==b.toUpperCase()?-1:1,c=function(a,b){var c=d[0].call(this,a,b);if(1=d?e=25:250=d?e=50:1E3=d?e=100:2500=d?e=250:5E3=d?e=500:12E3=d?e=1E3:25E3=d?e=2E3:5E4=d?e=5E3:1E5=d?e=1E4:5E5=d?e=5E4:1E6=d?e=1E5:5E6=d?e=25E4:1E7=d?e=25E5:5E7=d?e=5E6:1E8=d?e=25E5:5E7=d?e=5E6:1E8

'+printingObjectDataAlternativeString1[lang]+a+printingObjectDataAlternativeString2[lang]})).show(),Ext.getBody().unmask());this.fireEvent("print",this,a)}}); QGIS.SearchComboBox=Ext.extend(Ext.form.ComboBox,{map:null,highlightLayerName:null,highlightLayer:null,hasReverseAxisOrder:!1,url:null,geomUrl:null,hideTrigger:!1,minChars:2,queryDelay:50,displayField:"label",forceSelection:!0,searchtables:null,srs:null,initComponent:function(){this.emptyText=searchFieldDefaultTextString[lang];this.triggerConfig={tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger x-form-clear-trigger"};this.on("keyUp",this.keyUpHandler);this.on("afterrender",this.afterrenderHandler); this.on("beforeselect",this.beforeselectHandler);this.store=new Ext.data.JsonStore({proxy:new Ext.data.ScriptTagProxy({url:this.url,method:"GET",callbackParam:"cb",nocache:!1,autoAbort:!0}),baseParams:{searchtables:this.getSearchTables(),srs:this.srs},root:"results",fields:"searchtable searchtext displaytext bbox showlayer selectable".split(" ")});this.tpl=(new Ext.XTemplate('

','',"","","{displaytext}",'', @@ -104,29 +104,29 @@ this.addEvents("featureselected");this.addEvents("featureselectioncleared")},onS (this.submitGetFeatureInfo(),b.el.mask(pleaseWaitString[lang],"x-mask-loading")):b.activate(Ext.getCmp("table_"+this.queryLayer)):(this.submitGetFeatureInfo(),b.el.mask(pleaseWaitString[lang],"x-mask-loading")):this.submitForm()}},submitGetFeatureInfo:function(){var a=this.wmsFilter,b=wmsLoader.layerTitleNameMapping[this.queryLayer],c=!0;if(""==a){var a=[],d=this.form.getForm().getFieldValues(),e;for(e in d){var f=this.form.getForm().findField(e);if(d[e]){var g=f.initialConfig.filterOp?f.initialConfig.filterOp: "=";valueQuotes=f.isXType("numberfield")?"":"'";valueExtra=-1"}},{xtype:"actioncolumn",id:"actions",width:40,align:"right",items:[{iconCls:"action-icon action-down",tooltip:layerOrderPanelLayerSettingsTooltipString[lang],getClass:function(a,c,d){return"layerOptions_"+this.escapeString(d.get("layer"))},handler:function(a,c,d,e){c=this.escapeString(this.store.getAt(c).get("layer"));d=Ext.select("img.layerOptions_"+c).first();d.toggleClass("action-down");d.toggleClass("action-up");Ext.select("#opacitySlider_"+c).first().parent("tr").toggle(); this.resizeOpacitySlider(c,a.getWidth())},scope:this},{iconCls:"action-icon action-visible",tooltip:layerOrderPanelVisibilityChangeTooltipString[lang],getClass:function(a,c,d){return"layerOptions_"+this.escapeString(d.get("layer"))},handler:function(a,c,d){a=this.escapeString(this.store.getAt(c).get("layer"));a=Ext.select("img.layerOptions_"+a).first().next();a.toggleClass("action-visible");a.toggleClass("action-invisible");c=this.store.getAt(c);this.fireEvent("layerVisibilityChange",c.get("layer"))}, -scope:this}]}],listeners:{resize:function(b,c,d,e,f){b.doLayout();b=this.getStore().getRange();for(d=0;d";f={layer:"contour",fields:"ele",points:this.locationToWgs().toShortString(),access_token:a.key};break;case "mapzen":b="https://elevation.mapzen.com/height",c="",d="height",e="{height}m "+TR.fiElevation+"",f={json:Ext.util.JSON.encode({range:!1,shape:[{lat:this.locationToWgs().lat, -lon:this.locationToWgs().lon}]}),api_key:a.key}}break;case "address":switch(a.provider.toLowerCase()){case "mapzen":b="https://search.mapzen.com/v1/reverse";c="features";d="properties";e="{label} ("+measureDistanceResultPrefixString[lang].toLowerCase()+" {distance}m)";g="{region}, {country}";k=1E3;f={layers:"address","point.lat":this.locationToWgs().lat,"point.lon":this.locationToWgs().lon,api_key:a.key,size:1};break;case "mapbox":b="https://api.mapbox.com/geocoding/v5/mapbox.places/"+ -this.locationToWgs().lon+","+this.locationToWgs().lat+".json",c="features",d="",e="{place_name}",g="",k=1,f={access_token:a.key,types:"address,neighborhood,place"}}}Ext.Ajax.request({url:b,params:f,method:"GET",scope:this,success:function(b){b=Ext.util.JSON.decode(b.responseText);0";f={layer:"contour",fields:"ele",points:this.locationToWgs().toShortString(),access_token:a.key};break;case "mapzen":b="https://elevation.mapzen.com/height",c="",d="height",e="{height}m "+TR.fiElevation+"",f={json:Ext.util.JSON.encode({range:!1,shape:[{lat:this.locationToWgs().lat, +lon:this.locationToWgs().lon}]}),api_key:a.key}}break;case "address":switch(a.provider.toLowerCase()){case "mapzen":b="https://search.mapzen.com/v1/reverse";c="features";d="properties";e="{label} ("+measureDistanceResultPrefixString[lang].toLowerCase()+" {distance}m)";g="{region}, {country}";l=1E3;f={layers:"address","point.lat":this.locationToWgs().lat,"point.lon":this.locationToWgs().lon,api_key:a.key,size:1};break;case "mapbox":b="https://api.mapbox.com/geocoding/v5/mapbox.places/"+ +this.locationToWgs().lon+","+this.locationToWgs().lat+".json",c="features",d="",e="{place_name}",g="",l=1,f={access_token:a.key,types:"address,neighborhood,place"}}}Ext.Ajax.request({url:b,params:f,method:"GET",scope:this,success:function(b){b=Ext.util.JSON.decode(b.responseText);0this.tolerance||Math.abs(d[1]-c[1])>this.tolerance)this.triggerStart(a);else return;this.fireEvent("mousemove",this,a);this.onDrag(a);this.fireEvent("drag",this,a)}}});Ext.namespace("GeoExt.ux"); GeoExt.ux.GeocodingSearchCombo=Ext.extend(Ext.form.ComboBox,{map:null,highlightLayerName:null,highlightLayer:null,width:350,listWidth:350,zoom:8,minChars:1,queryDelay:50,maxRows:"20",tpl:'
{'+this.displayField+"}
",countryString:"",sources:"",layers:"",hideTrigger:!1,displayField:"name",forceSelection:!0,queryParam:"text",url:"https://search.mapzen.com/v1/search?",initComponent:function(){this.triggerConfig={tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger x-form-clear-trigger"}; this.on("keyUp",this.keyUpHandler);this.on("afterrender",this.afterrenderHandler);this.on("beforeselect",this.beforeselectHandler);GeoExt.ux.GeocodingSearchCombo.superclass.initComponent.apply(this,arguments);this.highlightLayerName&&(this.highlightLayer=this.map.getLayersByName(this.highlightLayerName)[0]);var a={size:this.maxRows,layers:this.layers,api_key:this.key};"undefined"!==typeof this.countryString&&(a["boundary.country"]=this.countryString);"undefined"!==typeof this.sources&&(a.sources= @@ -138,19 +138,19 @@ this.collapse()},checkTrigger:function(){if(this.rendered)this.trigger[Ext.isEmp featureInfoResultLayers.length)if("topMostHit"==identificationMode)c+=featureInfoResultLayers[0];else for(d=0;da&&this.setHeight(a)}}});clickPopup.show();changeCursorInMap("default")}activateGetFeatureInfo(!0)} function showFeatureInfoHover(a){var b=geoExtMap.map;if(identifyToolActive){hoverPopup&&removeHoverPopup();window.DOMParser?xmlDoc=(new DOMParser).parseFromString(a.text,"text/xml"):(xmlDoc=new ActiveXObject("Microsoft.XMLDOM"),xmlDoc.async="false",xmlDoc.loadXML(a.text));var c=xmlDoc.getElementsByTagName("Layer"),d="",e=!1,f=showFeatureInfoLayerTitle;mapThemeSwitcher&&void 0!=mapThemeSwitcher.activeProjectData&&(f=mapThemeSwitcher.activeProjectData.showFeatureInfoLayerTitle);for(var g=c.length-1;-1< -g;--g){for(var k=c[g].getElementsByTagName("Feature"),l=wmsLoader.layerProperties[c[g].getAttribute("name")].displayField||"tooltip",m=0;m'+wmsLoader.layerProperties[c[g].getAttribute("name")].title+""),e=!0);for(var n=k[m].getElementsByTagName("Attribute"),p={},h=0;h"+ -h.replace(/\n/,"
"),attribText=attribText.replace("\n","
"),d+=attribText+"

"),d+='
';else if(tooltipTemplates&&tooltipTemplates.hasOwnProperty(c[g].getAttribute("name")))templateText=tooltipTemplates[c[g].getAttribute("name")].template,h=templateText.replace(/<%(\w*)%>/g,function(a,b){return(p.hasOwnProperty(b)?p[b]:"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}),d+=h+"
";else if(-1!==l.indexOf("[%")){for(var h= -l,s=RegExp(/\[%[^"]*"(.*?)"[^"]*%\]/g),t;t=s.exec(l);)var q=t[1],q=p.hasOwnProperty(q)?p[q]:"",h=h.replace(t[0],q);d+=h+"
"}n&&(n=new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT(p.geometry)),featureInfoHighlightLayer.addFeatures([n]))}k=[];for(m=c[g].firstChild;m;)"Attribute"==m.nodeName&&k.push(m),m=m.nextSibling;for(m=0;m'+wmsLoader.layerProperties[c[g].getAttribute("name")].title+""),e=!0),d+="

"+k[m].getAttribute("name")+ -": "+k[m].getAttribute("value")+"

",d+='
';if("topMostHit"==identificationMode&&e)break}e?(changeCursorInMap("pointer"),clickPopup||(d=d.replace(/
$/,""),hoverPopup=new OpenLayers.Popup.FramedCloud(null,b.getLonLatFromPixel(a.xy),null,d,null,!1,null),hoverPopup.autoSize=!0,hoverPopup.keepInMap=!0,hoverPopup.panMapIfOutOfView=!1,hoverPopup.events.on({click:onHoverPopupClick}),b.addPopup(hoverPopup))):changeCursorInMap("default")}} -function onBeforeGetFeatureInfoClick(a){a.object.layers[0].setVisibility(thematicLayer.getVisibility());activateGetFeatureInfo(!1)}function onBeforeGetExtraFeatureInfoClick(a){0'+a+""));""!=mediaurl&&RegExp(mediaurl,"i").test(a)&&(a=''+a+"");return a} -function parseFIResult(a){if(a.hasChildNodes()){var b=showFeatureInfoLayerTitle;mapThemeSwitcher&&void 0!=mapThemeSwitcher.activeProjectData&&(b=mapThemeSwitcher.activeProjectData.showFeatureInfoLayerTitle);if(a.hasChildNodes()&&"Layer"==a.nodeName){for(var c=!1,d=!1,e="",f=a.firstChild,g=wmsLoader.layerProperties[a.getAttribute("name")].title,k=g+"."+a.firstElementChild.id;f;){if(f.hasChildNodes()&&"Feature"===f.nodeName){var l=f.firstChild;b&&(e+="

"+g+"

");var e=e+"\n

\n \n ", -m=projectData.use_ids?projectData.layers[a.getAttribute("name")].wfs||projectData.add_geom:!1;"guest"==projectData.user&&(m=!1);if(m){var m='",n="";void 0!==Eqwc.plugins.editing&&(n='");e+="'}for(;l;){if("Attribute"== -l.nodeName&&(m=l.getAttribute("name"),n=l.getAttribute("value").replace("NULL",Eqwc.settings.noDataValue),m!==mapInfoFieldName&&(!0==suppressEmptyValues&&""!==n.replace(/^\s\s*/,"").replace(/\s\s*$/,"")||!1==suppressEmptyValues)))if("geometry"===m){var p=new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT(n));p.fid=k;highLightGeometry.push(p);suppressInfoGeometry||(e+="\n ",showFieldNamesInClickPopup&&(e+=""),e+="",c=!0)}else e+="\n ",showFieldNamesInClickPopup&& -"maptip"!==m&&(e+=""),n=createHyperlink(n),e="maptip"==m?e+(""):e+(""),c=!0;l=l.nextSibling}e+="\n \n
"+m+n+'
"+m+":"+n+"
"+m+":"+n+"
"+n+"

"}else"Attribute"===f.nodeName&&(!1==d&&(e+="\n

\n \n "),e+="\n",d=c=!0);f=f.nextSibling}c&&(d&&(e+="\n \n
"+f.getAttribute("name")+""+f.getAttribute("value")+"

"),featureInfoResultLayers.push(e))}else for(a=a.firstChild;a;)parseFIResult(a),a= -a.nextSibling}}function listLayersWithFeatures(a){if(a.hasChildNodes())if("Layer"==a.nodeName)featureInfoResultLayers.push(a.getAttribute("name"));else for(a=a.firstChild;a;)listLayersWithFeatures(a),a=a.nextSibling}function getFeatures(a,b){if(b.hasChildNodes()){if("Layer"==b.nodeName&&b.getAttribute("name")==a)return b.firstChild;for(var c=b.firstChild;c;)getFeatures(a,c),c=c.nextSibling}} +g;--g){for(var l=c[g].getElementsByTagName("Feature"),k=wmsLoader.layerProperties[c[g].getAttribute("name")].displayField||"tooltip",m=0;m'+wmsLoader.layerProperties[c[g].getAttribute("name")].title+""),e=!0);for(var n=l[m].getElementsByTagName("Attribute"),p={},h=0;h"+ +h.replace(/\n/,"
"),attribText=attribText.replace("\n","
"),d+=attribText+"

"),d+='
';else if(tooltipTemplates&&tooltipTemplates.hasOwnProperty(c[g].getAttribute("name")))templateText=tooltipTemplates[c[g].getAttribute("name")].template,h=templateText.replace(/<%(\w*)%>/g,function(a,b){return(p.hasOwnProperty(b)?p[b]:"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}),d+=h+"
";else if(-1!==k.indexOf("[%")){for(var h= +k,s=RegExp(/\[%[^"]*"(.*?)"[^"]*%\]/g),t;t=s.exec(k);)var q=t[1],q=p.hasOwnProperty(q)?p[q]:"",h=h.replace(t[0],q);d+=h+"
"}n&&(n=new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT(p.geometry)),featureInfoHighlightLayer.addFeatures([n]))}l=[];for(m=c[g].firstChild;m;)"Attribute"==m.nodeName&&l.push(m),m=m.nextSibling;for(m=0;m'+wmsLoader.layerProperties[c[g].getAttribute("name")].title+""),e=!0),d+="

"+l[m].getAttribute("name")+ +": "+l[m].getAttribute("value")+"

",d+='
';if("topMostHit"==identificationMode&&e)break}e?(changeCursorInMap("pointer"),clickPopup||(d=d.replace(/
$/,""),hoverPopup=new OpenLayers.Popup.FramedCloud(null,b.getLonLatFromPixel(a.xy),null,d,null,!1,null),hoverPopup.autoSize=!0,hoverPopup.keepInMap=!0,hoverPopup.panMapIfOutOfView=!1,hoverPopup.events.on({click:onHoverPopupClick}),b.addPopup(hoverPopup))):changeCursorInMap("default")}} +function onBeforeGetFeatureInfoClick(a){a.object.layers[0].setVisibility(thematicLayer.getVisibility());activateGetFeatureInfo(!1)}function noFeatureInfoClick(a){activateGetFeatureInfo(!0)}function onHoverPopupClick(a){hoverPopup&&removeHoverPopup();var b=geoExtMap.map;a.xy=b.events.getMousePosition(a);b.events.triggerEvent("click",a)} +function onClickPopupClosed(a){removeClickPopup();Eqwc.settings.enableHoverPopup&&WMSGetFInfoHover.activate();var b=geoExtMap.map;a.xy=b.events.getMousePosition(a);b.events.triggerEvent("mousemove",a)}function removeClickPopup(){clickPopup&&clickPopup.destroy();clickPopup=null}function removeHoverPopup(){geoExtMap.map.removePopup(hoverPopup);hoverPopup.destroy();hoverPopup=null;featureInfoHighlightLayer.removeAllFeatures()} +function showFeatureSelected(a){null==a.layer&&a.fid.split(".");featureInfoHighlightLayer.removeAllFeatures();featureInfoHighlightLayer.addFeatures([a]);geoExtMap.map.zoomToExtent(a.geometry.bounds)}function clearFeatureSelected(){void 0!=thematicLayer.params.SELECTION&&thematicLayer.mergeNewParams({SELECTION:null});featureInfoHighlightLayer.removeAllFeatures()} +function createHyperlink(a){""!=a&&/^((http|https|ftp):\/\/).+\..+/i.test(a)&&(/\'+a+""));""!=mediaurl&&RegExp(mediaurl,"i").test(a)&&(a=''+a+"");return a} +function parseFIResult(a){if(a.hasChildNodes()){var b=showFeatureInfoLayerTitle;mapThemeSwitcher&&void 0!=mapThemeSwitcher.activeProjectData&&(b=mapThemeSwitcher.activeProjectData.showFeatureInfoLayerTitle);if(a.hasChildNodes()&&"Layer"==a.nodeName){var c=!1,d=!1,e="",f=a.firstChild,g=wmsLoader.layerProperties[a.getAttribute("name")].title;b&&(e+="

"+g+"

");for(b=g+"."+a.firstElementChild.id;f;){if(f.hasChildNodes()&&"Feature"===f.nodeName){var l=f.firstChild,e=e+"",k=projectData.use_ids? +projectData.layers[a.getAttribute("name")].wfs||projectData.add_geom:!1;"guest"==projectData.user&&(k=!1);if(k){var k='",m="";void 0!==Eqwc.plugins.editing&&(m='");e+="'}for(;l;){if("Attribute"==l.nodeName&& +(k=l.getAttribute("name"),m=l.getAttribute("value").replace("NULL",Eqwc.settings.noDataValue),k!==mapInfoFieldName&&(!0==suppressEmptyValues&&""!==m.replace(/^\s\s*/,"").replace(/\s\s*$/,"")||!1==suppressEmptyValues)))if("geometry"===k){var n=new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT(m));n.fid=b;highLightGeometry.push(n);suppressInfoGeometry||(e+="\n ",showFieldNamesInClickPopup&&(e+=""),e+="",c=!0)}else e+="\n ",showFieldNamesInClickPopup&& +"maptip"!==k&&(e+=""),m=createHyperlink(m),e="maptip"==k?e+(""):e+(""),c=!0;l=l.nextSibling}e+="\n \n
"+k+m+'
"+k+":"+m+"
"+k+":"+m+"
"+m+"

"}else"Attribute"===f.nodeName&&(!1==d&&(e+="\n

\n \n "),e+="\n",d=c=!0);f=f.nextSibling}c&&(d&&(e+="\n \n
"+getRasterFieldName(g,f.getAttribute("name"))+""+f.getAttribute("value")+"

"),featureInfoResultLayers.push(e))}else for(a=a.firstChild;a;)parseFIResult(a), +a=a.nextSibling}}function listLayersWithFeatures(a){if(a.hasChildNodes())if("Layer"==a.nodeName)featureInfoResultLayers.push(a.getAttribute("name"));else for(a=a.firstChild;a;)listLayersWithFeatures(a),a=a.nextSibling}function getFeatures(a,b){if(b.hasChildNodes()){if("Layer"==b.nodeName&&b.getAttribute("name")==a)return b.firstChild;for(var c=b.firstChild;c;)getFeatures(a,c),c=c.nextSibling}} function updateElevation(a,b,c,d){b=Ext.getCmp("fi_elevation");void 0!=b&&(d=new Ext.Template(d),void 0===a||isNaN(a[c])||null===a[c]||(a[c]!==parseInt(a[c])&&(a[c]=a[c].toFixed(elevationPrecision)),a=d.apply(a),b.update(a)))}function updateAddress(a,b,c,d,e,f){b=Ext.getCmp("fi_address");if(void 0!=b){var g=0;a=""==c||null==c?a:a[c];null!=a.distance&&(g=a.distance,a.distance=g*f);tem=g*f>minimumAddressRange?new Ext.Template(e):new Ext.Template(d);d=tem.apply(a);b.update(d)}} function identifyAction(a,b){var c=b.split(".")[0],d=wmsLoader.layerTitleNameMapping[c];switch(a){case "clear":clearFeatureSelected();break;case "edit":checkEditorState(d)&&prepareEdit(projectData.layers[d])&&editor.attributesForm.requestAndLoadFeature(b);break;case "select":var e=!1;Ext.each(highLightGeometry,function(a,b,c){a.fid===this[1]&&(showFeatureSelected(a),e=!0)},arguments);e||(d=new OpenLayers.Filter.FeatureId({fids:[b]}),(new OpenLayers.Protocol.WFS({version:"1.0.0",url:wmsURI,headers:{"Content-Type":"text/xml; charset=utf-8"}, featureType:c,geometryName:"geometry",filter:d})).read({maxFeatures:1,callback:function(a){if(200==a.priv.status){if(1==a.features.length){a=a.features[0];var b=a.fid.split(".")[0];a.geometry.transform(projectData.layers[wmsLoader.layerTitleNameMapping[b]].crs,projectData.crs);highLightGeometry.push(a);showFeatureSelected(a)}}else Ext.Msg.alert("Get feature error",a.priv.status+" "+a.priv.statusText+"

"+a.priv.responseText)},scope:this}))}};function showLegendAndMetadata(a){var b=wmsLoader.layerTitleNameMapping[a];void 0==legendMetadataWindow&&setupLegendAndMetadataWindow();legendMetadataWindow.setTitle(legendMetadataWindowTitleString[lang]+' "'+a+'"');!1==legendMetadataWindow_active&&legendMetadataWindow.show();var c=projectData.layers[b],d=wmsURI+Ext.urlEncode({SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetLegendGraphics",FORMAT:"image/png",EXCEPTIONS:"application/vnd.ogc.se_inimage",BOXSPACE:1,LAYERSPACE:2,SYMBOLSPACE:1,SYMBOLHEIGHT:2, @@ -181,52 +181,51 @@ this.text)return this.hidden=!0,this.layer.metadata.visible=!1},a);a.layer.metad function postLoading(){function a(a){var b=wmsLoader.projectSettings.capability.layerDrawingOrder;null!=layerOrderPanel&&(b=layerOrderPanel.orderedLayers());if(null!=b){for(var c=[],d=0;db.getKey()&&b.stopPropagation()}),geoExtMap.map.addControl(new OpenLayers.Control.KeyboardDefaults),geoExtMap.map.addControl(new OpenLayers.Control.Navigation),geoExtMap.map.addControl(new OpenLayers.Control.Attribution),geoExtMap.map.addControl(new OpenLayers.Control.ScaleLine), geoExtMap.map.addControl(new OpenLayers.Control.Zoom),coordinateTextField=Ext.getCmp("CoordinateTextField"),geoExtMap.map.events.register("mousemove",this,function(a){a=geoExtMap.map.events.getMousePosition(a);a=geoExtMap.map.getLonLatFromPixel(a);var b=0,c=geoExtMap.map.getScale();400>=c&&(b=1,100>=c&&(b=2));coordinateTextField.setRawValue(a.lon.toFixed(b)+","+a.lat.toFixed(b))}),coordinateTextField.on("specialkey",function(a,b){if(b.getKey()==b.ENTER){var c=a.getValue().split(","),c=new OpenLayers.LonLat(parseFloat(c[0]), -parseFloat(c[1]));geoExtMap.map.setCenter(c)}36b.getKey()&&b.stopPropagation()}),coordinateTextField.on("change",function(a,b,c){a=b.split(",");a=new OpenLayers.LonLat(parseFloat(a[0]),parseFloat(a[1]));geoExtMap.map.setCenter(a)}),navHistoryCtrl=new OpenLayers.Control.NavigationHistory,geoExtMap.map.addControl(navHistoryCtrl));selectedQueryableLayers=a(selectedQueryableLayers);initialLoadDone&&(Eqwc.settings.enableHoverPopup&&geoExtMap.map.removeControl(WMSGetFInfoHover),geoExtMap.map.removeControl(WMSGetFInfo), -geoExtMap.map.removeControl(ExtraFInfo));h=new OpenLayers.Layer.WMS(layerTree.root.firstChild.text,wmsURI,{layers:[],VERSION:"1.3.0"},LayerOptions);ExtraFInfo=new OpenLayers.Control.WMSGetFeatureInfo({layers:[],infoFormat:"text/xml",queryVisible:!0});ExtraFInfo.events.register("beforegetfeatureinfo",this,onBeforeGetExtraFeatureInfoClick);geoExtMap.map.addControl(ExtraFInfo);WMSGetFInfo=new OpenLayers.Control.WMSGetFeatureInfo({layers:[h],infoFormat:"text/xml",queryVisible:!0,vendorParams:{QUERY_LAYERS:selectedQueryableLayers.join(",")}}); -WMSGetFInfo.events.register("getfeatureinfo",this,showFeatureInfo);WMSGetFInfo.events.register("beforegetfeatureinfo",this,onBeforeGetFeatureInfoClick);WMSGetFInfo.events.register("nogetfeatureinfo",this,noFeatureInfoClick);geoExtMap.map.addControl(WMSGetFInfo);Eqwc.settings.enableHoverPopup&&(WMSGetFInfoHover=new OpenLayers.Control.WMSGetFeatureInfo({layers:[h],infoFormat:"text/xml",queryVisible:!0,hover:!0,vendorParams:{QUERY_LAYERS:selectedQueryableLayers.join(",")}}),WMSGetFInfoHover.events.register("getfeatureinfo", -this,showFeatureInfoHover),geoExtMap.map.addControl(WMSGetFInfoHover));initialLoadDone||null==f||(OverviewMapOptions.maxExtent=maxExtent,geoExtMap.map.addControl(new OpenLayers.Control.OverviewMap({size:OverviewMapSize,minRatio:16,maxRatio:64,mapOptions:OverviewMapOptions,maximized:OverviewMapMaximized,layers:[f]})));if(!initialLoadDone){Ext.getCmp("IdentifyTool").toggle(!0);identifyToolActive=!0;activateGetFeatureInfo(!0);f=Ext.getCmp("myTopToolbar");h=new Ext.Button({icon:iconDirectory+"mActionZoomFullExtent.png", -id:"navZoomFullExtent",scale:"medium",map:geoExtMap.map,tooltip:zoomFullViewTooltipString[lang],tooltipType:"qtip",handler:mapToolbarHandler});f.insert(0,h);h=new GeoExt.Action({icon:iconDirectory+"mActionZoomBox.png",id:"navZoomBoxButton",scale:"medium",control:new OpenLayers.Control.ZoomBox({out:!1}),map:geoExtMap.map,tooltip:zoomRectangleTooltipString[lang],tooltipType:"qtip",toggleGroup:"mapTools",enableToggle:!0,allowDepress:!0});f.insert(1,h);geoExtMap.map.zoomBoxActive=!1;Ext.getCmp("navZoomBoxButton").on("toggle", -mapToolbarHandler);h=new GeoExt.Action({icon:iconDirectory+"mActionZoomLast.png",scale:"medium",control:navHistoryCtrl.previous,disabled:!0,tooltip:navigationHistoryBackwardTooltipString[lang],tooltipType:"qtip",id:"zoomLast",hidden:!projectData.zoom_back_forward});f.insert(2,h);h=new GeoExt.Action({icon:iconDirectory+"mActionZoomNext.png",scale:"medium",control:navHistoryCtrl.next,disabled:!0,tooltip:navigationHistoryForwardTooltipString[lang],tooltipType:"qtip",id:"zoomNext",hidden:!projectData.zoom_back_forward}); -f.insert(3,h);if(projectData.geolocation){var s=new GeoExt.Action({icon:iconDirectory+"mActionLocate.png",id:"geoLocate",scale:"medium",control:new OpenLayers.Control.Geolocate({bind:!1,geolocationOptions:{enableHighAccuracy:!0,maximumAge:0,timeout:7E3}}),map:geoExtMap.map,tooltip:showLocationTooltipString[lang],tooltipType:"qtip",enableToggle:!1,allowDepress:!0,handler:mapToolbarHandler});f.insert(13,s);var t=function(a){var b=a.geometry.getCentroid(),c=a.geometry.getBounds(),d=Math.abs((c.right- -c.left)/2),e=0,f="up";window.resizeInterval=window.setInterval(function(){16

{name2}

{postalcode} {locality}, {region}
',layers:projectData.geoCode.layers,sources:projectData.geoCode.sources,maxRows:10, -displayField:"name2",key:projectData.geoCode.key}):new QGIS.SearchComboBox({map:geoExtMap.map,highlightLayerName:"attribHighLight",hasReverseAxisOrder:!1,width:300,searchtables:searchtables,url:searchBoxQueryURL,geomUrl:searchBoxGetGeomURL,srs:projectData.crs.split(":")[1]}),f.insert(f.items.length,qgisSearchCombo);f.doLayout();!0==mapThemeSwitcherActive&&(mapThemeSwitcher=new ThemeSwitcher(Ext.getCmp("MapPanel")),Ext.getCmp("mapThemeButton").show());f=function(a){if("query"in urlParams){for(var b= -null,c=0;ca&&(a=500),geoExtMap.map.zoomToScale(a))}})}};h=projectData.search; -if(null!=h&&0a.gridResultsPageSize&&(l=new Ext.ux.PagingToolbar({pageSize:a.gridResultsPageSize,store:a.store,displayInfo:!1}));var m=a.gridTitle+" ("+a.store.totalCount+")";""a.gridColumns.length&&(n=!0);a.resultsGrid=new Ext.grid.GridPanel({id:f,title:m,itemId:a.gridTitle,closable:a.tabClosable,collapsible:d,collapsed:!1,store:a.store,columns:a.gridColumns, -plugins:[k],sm:new Ext.grid.RowSelectionModel({singleSelect:!0}),autoHeight:e,viewConfig:{forceFit:n,templates:{cell:new Ext.Template('','
{value}
',"")}},bbar:l,listeners:{render:function(a){a.store.on("load",function(c,d,e){1==b.length&&(a.getSelectionModel().selectFirstRow(),a.fireEvent("rowClick",a,0))})},filterupdate:function(){if("object"=== -typeof a.resultsGrid){var b=[],c=wmsLoader.layerTitleNameMapping[a.queryLayer],d=Ext.decode(Ext.encode(a.resultsGrid.filters.getFilterData()));Ext.each(d,function(a){if("string"==a.data.type)b.push('"'+a.field+"\" LIKE '%"+a.data.value+"%'");else if("numeric"==a.data.type){var c="";switch(a.data.comparison){case "gt":c=">";break;case "lt":c="<";break;case "eq":c="="}b.push('"'+a.field+'" '+c+" "+a.data.value)}});thematicLayer.mergeNewParams({FILTER:c+":"+b.join(" AND ")})}}}});!1==l.displayInfo&& +parseFloat(c[1]));geoExtMap.map.setCenter(c)}36b.getKey()&&b.stopPropagation()}),coordinateTextField.on("change",function(a,b,c){a=b.split(",");a=new OpenLayers.LonLat(parseFloat(a[0]),parseFloat(a[1]));geoExtMap.map.setCenter(a)}),navHistoryCtrl=new OpenLayers.Control.NavigationHistory,geoExtMap.map.addControl(navHistoryCtrl));selectedQueryableLayers=a(selectedQueryableLayers);initialLoadDone&&(Eqwc.settings.enableHoverPopup&&geoExtMap.map.removeControl(WMSGetFInfoHover),geoExtMap.map.removeControl(WMSGetFInfo)); +WMSGetFInfo=new OpenLayers.Control.WMSGetFeatureInfo({layers:[thematicLayer],infoFormat:"text/xml",queryVisible:!0,vendorParams:{QUERY_LAYERS:selectedQueryableLayers.join(",")}});WMSGetFInfo.events.register("getfeatureinfo",this,showFeatureInfo);WMSGetFInfo.events.register("beforegetfeatureinfo",this,onBeforeGetFeatureInfoClick);WMSGetFInfo.events.register("nogetfeatureinfo",this,noFeatureInfoClick);geoExtMap.map.addControl(WMSGetFInfo);Eqwc.settings.enableHoverPopup&&(WMSGetFInfoHover=new OpenLayers.Control.WMSGetFeatureInfo({layers:[thematicLayer], +infoFormat:"text/xml",queryVisible:!0,hover:!0,vendorParams:{QUERY_LAYERS:selectedQueryableLayers.join(",")}}),WMSGetFInfoHover.events.register("getfeatureinfo",this,showFeatureInfoHover),geoExtMap.map.addControl(WMSGetFInfoHover));initialLoadDone||null==f||(OverviewMapOptions.maxExtent=maxExtent,geoExtMap.map.addControl(new OpenLayers.Control.OverviewMap({size:OverviewMapSize,minRatio:16,maxRatio:64,mapOptions:OverviewMapOptions,maximized:OverviewMapMaximized,layers:[f]})));if(!initialLoadDone){Ext.getCmp("IdentifyTool").toggle(!0); +identifyToolActive=!0;activateGetFeatureInfo(!0);f=Ext.getCmp("myTopToolbar");h=new Ext.Button({icon:iconDirectory+"mActionZoomFullExtent.png",id:"navZoomFullExtent",scale:"medium",map:geoExtMap.map,tooltip:zoomFullViewTooltipString[lang],tooltipType:"qtip",handler:mapToolbarHandler});f.insert(0,h);h=new GeoExt.Action({icon:iconDirectory+"mActionZoomBox.png",id:"navZoomBoxButton",scale:"medium",control:new OpenLayers.Control.ZoomBox({out:!1}),map:geoExtMap.map,tooltip:zoomRectangleTooltipString[lang], +tooltipType:"qtip",toggleGroup:"mapTools",enableToggle:!0,allowDepress:!0});f.insert(1,h);geoExtMap.map.zoomBoxActive=!1;Ext.getCmp("navZoomBoxButton").on("toggle",mapToolbarHandler);h=new GeoExt.Action({icon:iconDirectory+"mActionZoomLast.png",scale:"medium",control:navHistoryCtrl.previous,disabled:!0,tooltip:navigationHistoryBackwardTooltipString[lang],tooltipType:"qtip",id:"zoomLast",hidden:!projectData.zoom_back_forward});f.insert(2,h);h=new GeoExt.Action({icon:iconDirectory+"mActionZoomNext.png", +scale:"medium",control:navHistoryCtrl.next,disabled:!0,tooltip:navigationHistoryForwardTooltipString[lang],tooltipType:"qtip",id:"zoomNext",hidden:!projectData.zoom_back_forward});f.insert(3,h);if(projectData.geolocation){var s=new GeoExt.Action({icon:iconDirectory+"mActionLocate.png",id:"geoLocate",scale:"medium",control:new OpenLayers.Control.Geolocate({bind:!1,geolocationOptions:{enableHighAccuracy:!0,maximumAge:0,timeout:7E3}}),map:geoExtMap.map,tooltip:showLocationTooltipString[lang],tooltipType:"qtip", +enableToggle:!1,allowDepress:!0,handler:mapToolbarHandler});f.insert(13,s);var t=function(a){var b=a.geometry.getCentroid(),c=a.geometry.getBounds(),d=Math.abs((c.right-c.left)/2),e=0,f="up";window.resizeInterval=window.setInterval(function(){16

{name2}

{postalcode} {locality}, {region}
', +layers:projectData.geoCode.layers,sources:projectData.geoCode.sources,maxRows:10,displayField:"name2",key:projectData.geoCode.key}):new QGIS.SearchComboBox({map:geoExtMap.map,highlightLayerName:"attribHighLight",hasReverseAxisOrder:!1,width:300,searchtables:searchtables,url:searchBoxQueryURL,geomUrl:searchBoxGetGeomURL,srs:projectData.crs.split(":")[1]}),f.insert(f.items.length,qgisSearchCombo);f.doLayout();!0==mapThemeSwitcherActive&&(mapThemeSwitcher=new ThemeSwitcher(Ext.getCmp("MapPanel")),Ext.getCmp("mapThemeButton").show()); +f=function(a){if("query"in urlParams){for(var b=null,c=0;ca&&(a=500), +geoExtMap.map.zoomToScale(a))}})}};h=projectData.search;if(null!=h&&0a.gridResultsPageSize&&(k=new Ext.ux.PagingToolbar({pageSize:a.gridResultsPageSize,store:a.store,displayInfo:!1}));var m=a.gridTitle+" ("+a.store.totalCount+")";""a.gridColumns.length&&(n=!0);a.resultsGrid=new Ext.grid.GridPanel({id:f,title:m,itemId:a.gridTitle,closable:a.tabClosable,collapsible:d,collapsed:!1,store:a.store,columns:a.gridColumns, +plugins:[l],sm:new Ext.grid.RowSelectionModel({singleSelect:!0}),autoHeight:e,viewConfig:{forceFit:n,templates:{cell:new Ext.Template('','
{value}
',"")}},bbar:k,listeners:{render:function(a){a.store.on("load",function(c,d,e){1==b.length&&(a.getSelectionModel().selectFirstRow(),a.fireEvent("rowClick",a,0))})},filterupdate:function(){if("object"=== +typeof a.resultsGrid){var b=[],c=wmsLoader.layerTitleNameMapping[a.queryLayer],d=Ext.decode(Ext.encode(a.resultsGrid.filters.getFilterData()));Ext.each(d,function(a){if("string"==a.data.type)b.push('"'+a.field+"\" LIKE '%"+a.data.value+"%'");else if("numeric"==a.data.type){var c="";switch(a.data.comparison){case "gt":c=">";break;case "lt":c="<";break;case "eq":c="="}b.push('"'+a.field+'" '+c+" "+a.data.value)}});thematicLayer.mergeNewParams({FILTER:c+":"+b.join(" AND ")})}}}});!1==k.displayInfo&& a.resultsGrid.getBottomToolbar().add([{iconCls:"x-clearfilter-icon",tooltip:TR.clearFilter,handler:function(){a.resultsGrid.filters.clearFilters()}},{iconCls:"x-clear-icon",tooltip:TR.clearSelection,handler:clearTableSelection}]);a.resultsGrid.on("rowclick",a.onRowClick,a);a.resultsGrid.on("keypress",function(a){13==a.getKey()&&(a=this.getSelectionModel().last,this.fireEvent("rowclick",this,a))});c.add(a.resultsGrid);c.doLayout();a.resultsGrid.show();a.resultsGrid.collapsible&&a.resultsGrid.expand()}else{c= this.el;"bottom"==this.gridLocation&&(c=Ext.getCmp("BottomPanel").el);c.unmask();Ext.MessageBox.alert(searchPanelTitleString[lang],searchNoRecordsFoundString[lang]);try{Ext.getCmp("SearchPanelResultsGrid").destroy()}catch(p){}a.resultsGrid=null}return!0} function getVisibleLayers(a,b){for(;null!=b;){if(b.attributes.checked)a.push(wmsLoader.layerTitleNameMapping[b.text]);else if(null==b.attributes.checked)for(var c=0;c0) { - evt.object.layers = [geoExtMap.map.getLayersBy('metadata', 'identify')[0]]; - } -} +//function onBeforeGetExtraFeatureInfoClick(evt) { +// var lay = geoExtMap.map.getLayersBy('metadata','identify'); +// +// //WATCH: only first one is used +// if (lay.length>0) { +// evt.object.layers = [geoExtMap.map.getLayersBy('metadata', 'identify')[0]]; +// } +//} // reenable GetFeatureInfo function noFeatureInfoClick(evt) { diff --git a/client/site/js/QGISExtensions.js b/client/site/js/QGISExtensions.js index 7d06fefd..ca013d0e 100755 --- a/client/site/js/QGISExtensions.js +++ b/client/site/js/QGISExtensions.js @@ -1219,12 +1219,14 @@ QGIS.FeatureInfoParser = Ext.extend(Object, { // get bbox of all features var bboxNode = node.getElementsByTagName("BoundingBox")[0]; - this.bbox = { - "minx": parseFloat(bboxNode.getAttribute("minx")), - "miny": parseFloat(bboxNode.getAttribute("miny")), - "maxx": parseFloat(bboxNode.getAttribute("maxx")), - "maxy": parseFloat(bboxNode.getAttribute("maxy")) - }; + if (bboxNode) { + this.bbox = { + "minx": parseFloat(bboxNode.getAttribute("minx")), + "miny": parseFloat(bboxNode.getAttribute("miny")), + "maxx": parseFloat(bboxNode.getAttribute("maxx")), + "maxy": parseFloat(bboxNode.getAttribute("maxy")) + }; + } // get layer features var layerNode = node.getElementsByTagName("Layer")[0]; diff --git a/client/site/js/WebgisInit_functions.js b/client/site/js/WebgisInit_functions.js index 719f69c5..2c6cb5a1 100644 --- a/client/site/js/WebgisInit_functions.js +++ b/client/site/js/WebgisInit_functions.js @@ -608,25 +608,30 @@ function postLoading() { if (Eqwc.settings.enableHoverPopup) geoExtMap.map.removeControl(WMSGetFInfoHover); geoExtMap.map.removeControl(WMSGetFInfo); - geoExtMap.map.removeControl(ExtraFInfo); + //geoExtMap.map.removeControl(ExtraFInfo); } - var fiLayer = new OpenLayers.Layer.WMS(layerTree.root.firstChild.text, wmsURI, { - layers: [], - VERSION: "1.3.0" - }, LayerOptions); - ExtraFInfo = new OpenLayers.Control.WMSGetFeatureInfo({ - layers: [], - infoFormat: "text/xml", - queryVisible: true - }); - //ExtraFInfo.events.register("getfeatureinfo", this, showExtraFeatureInfo); - ExtraFInfo.events.register("beforegetfeatureinfo", this, onBeforeGetExtraFeatureInfoClick); - //ExtraFInfo.events.register("nogetfeatureinfo", this, noExtraFeatureInfoClick); - geoExtMap.map.addControl(ExtraFInfo); + + //TEST, WHY MAKE NEW LAYER + //var fiLayer = new OpenLayers.Layer.WMS(layerTree.root.firstChild.text, wmsURI, { + // layers: [], + // VERSION: "1.3.0" + //}, LayerOptions); + + //test, prepare for GetFeatureInfo call for external layers + //not finished, disabled + //ExtraFInfo = new OpenLayers.Control.WMSGetFeatureInfo({ + // layers: [], + // infoFormat: "text/xml", + // queryVisible: true + //}); + ////ExtraFInfo.events.register("getfeatureinfo", this, showExtraFeatureInfo); + //ExtraFInfo.events.register("beforegetfeatureinfo", this, onBeforeGetExtraFeatureInfoClick); + ////ExtraFInfo.events.register("nogetfeatureinfo", this, noExtraFeatureInfoClick); + //geoExtMap.map.addControl(ExtraFInfo); WMSGetFInfo = new OpenLayers.Control.WMSGetFeatureInfo({ - layers: [fiLayer], + layers: [thematicLayer], infoFormat: "text/xml", queryVisible: true, vendorParams: { @@ -640,7 +645,7 @@ function postLoading() { if (Eqwc.settings.enableHoverPopup) { WMSGetFInfoHover = new OpenLayers.Control.WMSGetFeatureInfo({ - layers: [fiLayer], + layers: [thematicLayer], infoFormat: "text/xml", queryVisible: true, hover: true, @@ -2268,12 +2273,12 @@ function activateGetFeatureInfo(doIt) { // activate/deactivate FeatureInfo if (doIt) { WMSGetFInfo.activate(); - ExtraFInfo.activate(); + //ExtraFInfo.activate(); if (Eqwc.settings.enableHoverPopup) WMSGetFInfoHover.activate(); } else { WMSGetFInfo.deactivate(); - ExtraFInfo.deactivate(); + //ExtraFInfo.deactivate(); if (Eqwc.settings.enableHoverPopup) WMSGetFInfoHover.deactivate(); } diff --git a/version.txt b/version.txt index 1e906ed0..e8455808 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,2 @@ -1.6.0 - Application +1.6.1 - Application 15 - Database