=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js 2016-01-05 13:43:20 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js 2016-01-08 10:30:35 +0000 @@ -3168,7 +3168,7 @@ // sort util.array.sort(organisationUnits, levelOrder, 'le'); - for (var i = 0, ou, gpid = '', gppg = ''; i < organisationUnits.length; i++) { + for (var i = 0, ou, gpid = '', gppg = '', type; i < organisationUnits.length; i++) { ou = organisationUnits[i]; // grand parent @@ -3186,10 +3186,23 @@ } } + //TODO improve + if (parseInt(ou.ty) === 1) { + type = 'Point'; + } + else { + if (ou.co.substring(0, 4) === '[[[[') { + type = 'MultiPolygon'; + } + else { + type = 'Polygon'; + } + } + geojson.features.push({ type: 'Feature', geometry: { - type: parseInt(ou.ty) === 1 ? 'Point' : 'MultiPolygon', + type: type, coordinates: JSON.parse(ou.co) }, properties: {