Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #316 from onaio/handle-geo-points-from-superset
Browse files Browse the repository at this point in the history
Handle geo points from superset
  • Loading branch information
KipSigei authored Jul 23, 2019
2 parents 18d93d7 + 87c1aad commit 33c4563
Show file tree
Hide file tree
Showing 4 changed files with 2,415 additions and 2,405 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"dependencies": {
"@babel/runtime": "^7.4.3",
"@onaio/superset-connector": "^0.0.9",
"@onaio/superset-connector": "^0.0.13",
"babel-core": "v6.25.0",
"babel-loader": "^7.1.2",
"babel-polyfill": "^6.26.0",
Expand Down
13 changes: 12 additions & 1 deletion src/map/prepareLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,18 @@ function readData(mapId, layer, dispatch, doUpdateTsLayer) {
res => res,
) // pass in callback func to process response
.then((data) => {
layerObj.source.data = superset.processData(data); // assign processed data to layerObj
const processedData = superset.processData(data);
let parsedData;
if (layerObj.source.type === 'geojson') {
parsedData = csvToGEOjson(layerObj, processedData);
} else {
parsedData = [...processedData];
}

layerObj.source.data = Array.isArray(parsedData)
? [...parsedData]
: { ...parsedData };

if (layerObj.aggregate && layerObj.aggregate.type) {
layerObj.source.data = aggregateFormData(layerObj);
}
Expand Down
Loading

0 comments on commit 33c4563

Please sign in to comment.