Skip to content

Commit

Permalink
Merge pull request #18 from kartoza/issue_476
Browse files Browse the repository at this point in the history
Fix headers GGMN attribute table
  • Loading branch information
dimasciput authored Feb 23, 2022
2 parents 276e9d8 + 54250f2 commit 2f5649e
Show file tree
Hide file tree
Showing 66 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.12-kartoza
2.0.13-kartoza
20 changes: 11 additions & 9 deletions geonode_mapstore_client/client/js/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,27 +126,29 @@ window.initMapstore2Api = function(config, resolve) {
let layerAttributes = {};
let layerAttributeFetched = 0;

if (currentUrl.includes('groundwater-well') || currentUrl.includes('well-and-monitoring-data')) {
if (currentUrl.includes('groundwater-well') || currentUrl.includes('well-and-monitoring-data') || currentUrl.includes('view/ggmn')) {
axios.get(uuidUrl, {}).then((response) => {
setConfigProp('viewparams', `uuid:${response.data['uuid']}`);
if (response.data['extent']) {
setConfigProp('groundwater_extent', response.data['extent']);
ms2_config.map.maxExtent = ol.proj.transformExtent(response.data.extent, 'EPSG:4326', 'EPSG:3857');
}
const layers = ms2_config.map.layers || [];
layers.forEach((_layer, index) => {
let attributesUrl = `/api/layer/${_layer.name}/attributes`;
for (let _layer of layers) {
if (!_layer.id || !_layer.id.toLowerCase().includes('groundwater_well')) {
continue;
}
let layerName = _layer.name;
layerName = layerName.replace('groundwater:Groundwater_Well_GGMN', 'groundwater:Groundwater_Well');
let attributesUrl = `/api/layer/${layerName}/attributes`;
axios.get(attributesUrl, {}).then((_response) => {
layerAttributes[_layer.name] = _response.data;
}).catch((error) => {
}).finally(() => {
layerAttributeFetched += 1;
if (layerAttributeFetched === layers.length) {
setConfigProp('layerattributes', layerAttributes);
_initMapstore2Api(config, resolve);
}
setConfigProp('layerattributes', layerAttributes);
_initMapstore2Api(config, resolve);
});
});
}
});
} else {
_initMapstore2Api(config, resolve);
Expand Down
2 changes: 1 addition & 1 deletion geonode_mapstore_client/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "geonode-mapstore-client",
"version": "2.0.12-kartoza",
"version": "2.0.13-kartoza",
"description": "MapStore 2 Api bundle specific to geonode framework",
"main": "api.js",
"eslintConfig": {
Expand Down
2 changes: 1 addition & 1 deletion geonode_mapstore_client/client/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
geonode-mapstore-client-v2.0.12-kartoza-51ea37d569d09c0cfe1ef519856afe79209d001d
geonode-mapstore-client-v2.0.13-kartoza-7dd3f28dd859221e3c840831bcfaac9037b75f69
4 changes: 2 additions & 2 deletions geonode_mapstore_client/static/mapstore/dist/gn-geostory.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions geonode_mapstore_client/static/mapstore/dist/gn-home.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion geonode_mapstore_client/static/mapstore/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
geonode-mapstore-client-v2.0.12-kartoza-51ea37d569d09c0cfe1ef519856afe79209d001d
geonode-mapstore-client-v2.0.13-kartoza-7dd3f28dd859221e3c840831bcfaac9037b75f69

0 comments on commit 2f5649e

Please sign in to comment.