From 964a9aaed9296e966ceeba4bf4326b916c3eb248 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Mon, 30 Oct 2023 09:40:35 +0100 Subject: [PATCH] # Netgis HOTFIX * fixes bug where map client would not parse config.json properly resulting in failed client start --- templates/map/client/netgis.min.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/templates/map/client/netgis.min.js b/templates/map/client/netgis.min.js index 6dffc74d..faf870f6 100644 --- a/templates/map/client/netgis.min.js +++ b/templates/map/client/netgis.min.js @@ -13,9 +13,8 @@ netgis.Attribution.prototype.load=function(){this.root=document.createElement("s this.client.on(netgis.Events.LAYER_HIDE,this.onLayerHide.bind(this));this.client.on(netgis.Events.EDIT_FEATURES_CHANGE,this.onEditFeaturesChange.bind(this))};netgis.Attribution.prototype.update=function(){var a="© "+this.items.join(", ");this.appendix&&(a+=", "+this.appendix);this.root.innerHTML=a}; netgis.Attribution.prototype.onContextUpdate=function(a){this.layers=[];for(var b=0;bZeichnungsfl\u00e4che: "+netgis.util.formatArea(a.area,!0)+"":null;this.update()};netgis=netgis||{}; -netgis.Client=function(a,b){this.build="20220826";this.debug=!1;netgis.util.isString(a)&&(a=document.getElementById(a));this.container=a;this.editable=!0;this.root=null;this.modules=[];this.callbacks={};this.config=this.createDefaultConfig();this.create();if(netgis.util.isDefined(b))if(netgis.util.isString(b)){var c=this;netgis.util.request(b,function(a){a=JSON.parse(a);netgis.util.merge(c.config,a);c.createModules();c.load();c.invoke(netgis.Events.CONTEXT_UPDATE,c.config);c.hideLoader()})}else netgis.util.merge(this.config,b), -this.createModules(),this.load(),this.invoke(netgis.Events.CONTEXT_UPDATE,this.config),this.hideLoader();else this.createModules(),this.load(),this.invoke(netgis.Events.CONTEXT_UPDATE,this.config),this.hideLoader();this.initModules(b);this.initConfig(b);this.initEvents();this.setMode(netgis.Modes.VIEW)};netgis.Client.Layers=Object.freeze({PARCEL_DISTRICTS:"parcel-districts",PARCEL_FIELDS:"parcel-fields",PARCEL_FEATURES:"parcel-features",EDIT_LAYER:"edit-layer",PREVIEW_LAYER:"preview-layer"}); -netgis.Client.prototype.initElements=function(){}; +netgis.Client=function(a,b){this.build="20220826";this.debug=!1;netgis.util.isString(a)&&(a=document.getElementById(a));this.container=a;this.editable=!0;this.root=null;this.modules=[];this.callbacks={};this.config=this.createDefaultConfig();this.create();if(netgis.util.isDefined(b))if(netgis.util.isString(b)){var c=this;netgis.util.request(b,function(a){a=JSON.parse(a);netgis.util.merge(c.config,a);c.applyConfig(c.config)})}else netgis.util.merge(this.config,b),this.applyConfig(this.config);else this.applyConfig(this.config)}; +netgis.Client.Layers=Object.freeze({PARCEL_DISTRICTS:"parcel-districts",PARCEL_FIELDS:"parcel-fields",PARCEL_FEATURES:"parcel-features",EDIT_LAYER:"edit-layer",PREVIEW_LAYER:"preview-layer"});netgis.Client.prototype.applyConfig=function(a){this.createModules();this.load();this.invoke(netgis.Events.CONTEXT_UPDATE,a);this.hideLoader();this.initModules(a);this.initConfig(a);this.initEvents();this.setMode(netgis.Modes.VIEW)};netgis.Client.prototype.initElements=function(){}; netgis.Client.prototype.initModules=function(a){this.map=new netgis.MapOpenLayers(a);this.map.attach(this.root);this.controls=new netgis.Controls;this.controls.attach(this.root);this.layerPanel=new netgis.Panel("Inhalte");this.layerPanel.attach(this.root);this.layerTree=new netgis.Tree;this.layerTree.container.style.position="absolute";this.layerTree.container.style.width="100%";this.layerTree.container.style.top="12mm";this.layerTree.container.style.bottom="6mm";this.layerTree.container.style.overflow= "auto";this.layerTree.attach(this.layerPanel.container);this.toolboxPanel=new netgis.Panel("Werkzeuge");this.toolboxPanel.attach(this.root);this.toolbox=new netgis.Toolbox(a);this.toolbox.attach(this.toolboxPanel.container);this.searchPlace=new netgis.SearchPlace(a);this.searchPlace.attach(this.root);this.parcelPanel=new netgis.Panel("Flurst\u00fccks-Suche");this.parcelPanel.container.style.minWidth="92mm";this.parcelPanel.attach(this.root);this.searchParcel=new netgis.SearchParcel(a);this.searchParcel.attach(this.parcelPanel.container)}; netgis.Client.prototype.initConfig=function(a){var b=[],c=a.folders;if(c){for(var d=0;d