diff --git a/cypress/integration/manageLayerSources.cy.js b/cypress/integration/manageLayerSources.cy.js
new file mode 100644
index 000000000..d72dffc5c
--- /dev/null
+++ b/cypress/integration/manageLayerSources.cy.js
@@ -0,0 +1,358 @@
+import { EXTENDED_TIMEOUT, getApiBaseUrl } from '../support/util.js'
+
+const MAPS_ADMIN_AUTHORITY_ID = 'F_EXTERNAL_MAP_LAYER_PUBLIC_ADD'
+const MAPS_APP_NAMESPACE = 'DHIS2_MAPS_APP_CORE'
+const MAPS_APP_KEY_MANAGED_LAYER_SOURCES = 'MANAGED_LAYER_SOURCES'
+const LAYER_SOURCES_DEFAULT_MANAGED_LIST = [
+ 'WorldPop/GP/100m/pop_age_sex_cons_unadj_TOTAL',
+ 'WorldPop/GP/100m/pop_age_sex_cons_unadj',
+ 'ECMWF/ERA5_LAND/MONTHLY_AGGR/total_precipitation_sum',
+ 'ECMWF/ERA5_LAND/MONTHLY_AGGR/temperature_2m',
+ 'MODIS/006/MCD12Q1',
+ 'USGS/SRTMGL1_003',
+ 'GOOGLE/Research/open-buildings/v3/polygons',
+]
+const LAYER_SOURCES_DEFAULT_MANAGED = LAYER_SOURCES_DEFAULT_MANAGED_LIST.length
+const LAYER_SOURCES_DEFAULT_STANDARD = 6
+const LAYER_SOURCES_DEFAULT_ALL =
+ LAYER_SOURCES_DEFAULT_MANAGED + LAYER_SOURCES_DEFAULT_STANDARD
+
+context('Manage Layer Sources', () => {
+ it('admin authority is already available for current user', () => {
+ cy.request({
+ method: 'GET',
+ url: `${getApiBaseUrl()}/api/me/authorization/${MAPS_ADMIN_AUTHORITY_ID}`,
+ headers: {
+ 'Content-Type': 'text/plain',
+ },
+ }).then((response) => {
+ expect(response.status).to.eq(200)
+ expect(response.body).to.eq(true)
+ })
+ })
+
+ it('w/ admin authority: check add layer popover and managelayersources modal behavior and content', () => {
+ // Make sure authority request response is not comming from cache
+ cy.intercept(
+ 'GET',
+ '**/me?fields=id%2Cusername%2CdisplayName~rename(name)%2Cauthorities%2Csettings%5BkeyAnalysisDisplayProperty%5D',
+ (request) => {
+ delete request.headers['if-none-match']
+ }
+ ).as('getAuthorization')
+
+ // Visit page
+ cy.visit('/', EXTENDED_TIMEOUT)
+
+ // Opening add layer popover and checking content
+ cy.getByDataTest('add-layer-button').click()
+ cy.getByDataTest('addlayerpopover').should('be.visible')
+ cy.getByDataTest('managelayersources-button').should('be.visible')
+ cy.getByDataTest('managelayersources-button').contains(
+ 'Manage available layer sources'
+ )
+
+ // Opening manage layers modal and checking content
+ cy.getByDataTest('managelayersources-button').click()
+ cy.getByDataTest('addlayerpopover').should('not.exist')
+ cy.getByDataTest('managelayersourcesmodal').should('be.visible')
+ cy.getByDataTest('managelayersourcesmodal-title').should('be.visible')
+ cy.getByDataTest('managelayersourcesmodal-content').should('be.visible')
+ cy.getByDataTest('layersource-checkbox')
+ .its('length')
+ .should('be.gte', 1)
+ cy.getByDataTest('managelayersourcesmodal-actions').should('be.visible')
+ cy.getByDataTest('managelayersourcesmodal-button')
+ .contains('Close')
+ .should('be.visible')
+
+ // Closing manage layers modal
+ cy.getByDataTest('managelayersourcesmodal-button').click()
+ cy.getByDataTest('managelayersourcesmodal').should('not.exist')
+ })
+
+ it('w/ admin authority: add and remove layers', () => {
+ Cypress.Commands.add('waitForLayerContainers', (n) => {
+ cy.getByDataTest('addlayerpopover', EXTENDED_TIMEOUT)
+ .find('[class^="Layer_container"]')
+ .should('have.length', n)
+ })
+ Cypress.Commands.add('waitForCheckbox', (index, assertion) => {
+ cy.getByDataTest('layersource-checkbox', EXTENDED_TIMEOUT)
+ .eq(index)
+ .find('input')
+ .should(assertion)
+ })
+
+ // Replace dataStore with default layer sources visibility list
+ cy.request({
+ method: 'PUT',
+ url: `${getApiBaseUrl()}/api/dataStore/${MAPS_APP_NAMESPACE}/${MAPS_APP_KEY_MANAGED_LAYER_SOURCES}`,
+ headers: {
+ 'Content-Type': 'application/json;charset=UTF-8',
+ },
+ body: LAYER_SOURCES_DEFAULT_MANAGED_LIST,
+ }).then((response) => {
+ expect(response.status).to.eq(200)
+ })
+
+ // Visit page
+ cy.visit('/', EXTENDED_TIMEOUT)
+
+ cy.getByDataTest('add-layer-button').click()
+
+ cy.log('remove one layer')
+ cy.getByDataTest('managelayersources-button').click()
+ cy.waitForCheckbox(0, 'be.checked')
+ cy.getByDataTest('layersource-checkbox').eq(0).click()
+ cy.getByDataTest('managelayersourcesmodal-button').click()
+
+ cy.log('check there is n-1 layers available')
+ cy.getByDataTest('add-layer-button').click()
+ const n1 = LAYER_SOURCES_DEFAULT_ALL - 1
+ cy.waitForLayerContainers(n1).then((elements) => {
+ cy.wrap(elements.length).should('equal', n1)
+ })
+
+ cy.log('verify the checkbox of the first layer is not checked')
+ cy.getByDataTest('managelayersources-button').click()
+ cy.waitForCheckbox(0, 'not.be.checked')
+
+ cy.log('remove one more layer')
+ cy.waitForCheckbox(1, 'be.checked')
+ cy.getByDataTest('layersource-checkbox').eq(1).click()
+ cy.getByDataTest('managelayersourcesmodal-button').click()
+
+ cy.log('check there is n-2 layers available')
+ cy.getByDataTest('add-layer-button').click()
+ const n2 = LAYER_SOURCES_DEFAULT_ALL - 2
+ cy.waitForLayerContainers(n2).then((elements) => {
+ cy.wrap(elements.length).should('equal', n2)
+ })
+
+ cy.log('verify the checkbox of the second layer is not checked')
+ cy.getByDataTest('managelayersources-button').click()
+ cy.waitForCheckbox(1, 'not.be.checked')
+
+ cy.log('add one layer')
+ cy.waitForCheckbox(0, 'not.be.checked')
+ cy.getByDataTest('layersource-checkbox').eq(0).click()
+ cy.getByDataTest('managelayersourcesmodal-button').click()
+
+ cy.log('check there is n-1 layers available')
+ cy.getByDataTest('add-layer-button').click()
+ const n3 = LAYER_SOURCES_DEFAULT_ALL - 1
+ cy.waitForLayerContainers(n3).then((elements) => {
+ cy.wrap(elements.length).should('equal', n3)
+ })
+
+ cy.log('verify the checkbox of the first layer is checked')
+ cy.getByDataTest('managelayersources-button').click()
+ cy.waitForCheckbox(0, 'be.checked')
+ cy.getByDataTest('managelayersourcesmodal-button').click()
+
+ // Restore dataStore with default layer sources visibility list
+ cy.request({
+ method: 'PUT',
+ url: `${getApiBaseUrl()}/api/dataStore/${MAPS_APP_NAMESPACE}/${MAPS_APP_KEY_MANAGED_LAYER_SOURCES}`,
+ headers: {
+ 'Content-Type': 'application/json;charset=UTF-8',
+ },
+ body: LAYER_SOURCES_DEFAULT_MANAGED_LIST,
+ }).then((response) => {
+ expect(response.status).to.eq(200)
+ })
+ })
+
+ it('w/o admin authority: check managelayersources button is hidden', () => {
+ Cypress.Commands.add('waitForLayerContainers', (n) => {
+ cy.getByDataTest('addlayerpopover', EXTENDED_TIMEOUT)
+ .find('[class^="Layer_container"]')
+ .should('have.length', n)
+ })
+
+ // Remove admin authority
+ cy.intercept(
+ 'GET',
+ '**/me?fields=id%2Cusername%2CdisplayName~rename(name)%2Cauthorities%2Csettings%5BkeyAnalysisDisplayProperty%5D',
+ (request) => {
+ delete request.headers['if-none-match']
+ request.continue((response) => {
+ if (response.body.authorities) {
+ response.body.authorities = ['M_dhis-web-mapping']
+ }
+ })
+ }
+ ).as('getAuthorization')
+
+ // Replace dataStore with default layer sources visibility list -1
+ cy.request({
+ method: 'PUT',
+ url: `${getApiBaseUrl()}/api/dataStore/${MAPS_APP_NAMESPACE}/${MAPS_APP_KEY_MANAGED_LAYER_SOURCES}`,
+ headers: {
+ 'Content-Type': 'application/json;charset=UTF-8',
+ },
+ body: LAYER_SOURCES_DEFAULT_MANAGED_LIST.slice(0, -1),
+ }).then((response) => {
+ expect(response.status).to.eq(200)
+ })
+
+ // Visit page
+ cy.visit('/', EXTENDED_TIMEOUT)
+
+ cy.wait('@getAuthorization', EXTENDED_TIMEOUT).then((interception) => {
+ cy.log(interception.response.body.authorities)
+ expect(interception.response.body.authorities).to.deep.equal([
+ 'M_dhis-web-mapping',
+ ])
+
+ // Checks that settings are persisted
+ cy.getByDataTest('add-layer-button').click()
+ const n4 = LAYER_SOURCES_DEFAULT_ALL - 1
+ cy.waitForLayerContainers(n4).then((elements) => {
+ cy.wrap(elements.length).should('equal', n4)
+ })
+
+ // Checks that manage layers modal is not accessible
+ cy.getByDataTest('managelayers-button').should('not.exist')
+ })
+
+ // Restore dataStore with default layer sources visibility list
+ cy.request({
+ method: 'PUT',
+ url: `${getApiBaseUrl()}/api/dataStore/${MAPS_APP_NAMESPACE}/${MAPS_APP_KEY_MANAGED_LAYER_SOURCES}`,
+ headers: {
+ 'Content-Type': 'application/json;charset=UTF-8',
+ },
+ body: LAYER_SOURCES_DEFAULT_MANAGED_LIST,
+ }).then((response) => {
+ expect(response.status).to.eq(200)
+ })
+ })
+
+ it('at start, if dataStore = [], app initializes namespace', () => {
+ Cypress.Commands.add('waitForLayerContainers', (n) => {
+ cy.getByDataTest('addlayerpopover', EXTENDED_TIMEOUT)
+ .find('[class^="Layer_container"]')
+ .should('have.length', n)
+ })
+
+ // Mock empty dataStore
+ cy.intercept('GET', '**/dataStore', (request) => {
+ delete request.headers['if-none-match']
+ request.continue((response) => {
+ response.send([])
+ })
+ }).as('getDataStoreEmpty')
+
+ // Checks app sends namespace initialization request
+ cy.intercept(
+ 'POST',
+ `**/dataStore/${MAPS_APP_NAMESPACE}/${MAPS_APP_KEY_MANAGED_LAYER_SOURCES}`,
+ (request) => {
+ expect(request.body)
+ .to.be.an('array')
+ .that.has.lengthOf(LAYER_SOURCES_DEFAULT_MANAGED)
+ // Mock response (request is not actually sent)
+ request.reply({
+ statusCode: 200,
+ })
+ }
+ ).as('postNamespaceDefault')
+
+ // Visit page
+ cy.visit('/', EXTENDED_TIMEOUT)
+
+ cy.wait('@getDataStoreEmpty', EXTENDED_TIMEOUT).then(() => {
+ cy.wait('@postNamespaceDefault', EXTENDED_TIMEOUT).then(() => {
+ // Verify default layer sources are available
+ cy.getByDataTest('add-layer-button').click()
+ const n0 = LAYER_SOURCES_DEFAULT_ALL
+ cy.waitForLayerContainers(n0).then((elements) => {
+ cy.wrap(elements.length).should('equal', n0)
+ })
+ })
+ })
+ })
+
+ it('at start, if namespace = {}, app re-initializes namespace', () => {
+ Cypress.Commands.add('waitForLayerContainers', (n) => {
+ cy.getByDataTest('addlayerpopover', EXTENDED_TIMEOUT)
+ .find('[class^="Layer_container"]')
+ .should('have.length', n)
+ })
+
+ // Mock object namespace
+ cy.intercept(
+ 'GET',
+ `**/dataStore/${MAPS_APP_NAMESPACE}/${MAPS_APP_KEY_MANAGED_LAYER_SOURCES}`,
+ (request) => {
+ delete request.headers['if-none-match']
+ request.continue((response) => {
+ response.send({ invalid: 'fromat' })
+ })
+ }
+ ).as('getNamespaceObject')
+
+ // Checks app sends namespace re-initialization request
+ cy.intercept(
+ 'PUT',
+ `**/dataStore/${MAPS_APP_NAMESPACE}/${MAPS_APP_KEY_MANAGED_LAYER_SOURCES}`,
+ (request) => {
+ expect(request.body)
+ .to.be.an('array')
+ .that.has.lengthOf(LAYER_SOURCES_DEFAULT_MANAGED)
+ // Mock response (request is not actually sent)
+ request.reply({
+ statusCode: 200,
+ })
+ }
+ ).as('putNamespaceDefault')
+
+ // Visit page
+ cy.visit('/', EXTENDED_TIMEOUT)
+
+ cy.wait('@getNamespaceObject', EXTENDED_TIMEOUT).then(() => {
+ cy.wait('@putNamespaceDefault', EXTENDED_TIMEOUT).then(() => {
+ // Verify default layer sources are available
+ cy.getByDataTest('add-layer-button').click()
+ const n0 = LAYER_SOURCES_DEFAULT_ALL
+ cy.waitForLayerContainers(n0).then((elements) => {
+ cy.wrap(elements.length).should('equal', n0)
+ })
+ })
+ })
+ })
+
+ it('at start, if "invalid_source_id" in namespace, app ignores id', () => {
+ Cypress.Commands.add('waitForLayerContainers', (n) => {
+ cy.getByDataTest('addlayerpopover', EXTENDED_TIMEOUT)
+ .find('[class^="Layer_container"]')
+ .should('have.length', n)
+ })
+
+ // Mock "invalid_source_id" in namespace
+ cy.intercept(
+ 'GET',
+ `**/dataStore/${MAPS_APP_NAMESPACE}/${MAPS_APP_KEY_MANAGED_LAYER_SOURCES}`,
+ (request) => {
+ delete request.headers['if-none-match']
+ request.continue((response) => {
+ response.send([...response.body, 'invalid_source_id'])
+ })
+ }
+ ).as('getNamespaceArray')
+
+ // Visit page
+ cy.visit('/', EXTENDED_TIMEOUT)
+
+ cy.wait('@getNamespaceArray', EXTENDED_TIMEOUT).then(() => {
+ // Verify default layer sources are available
+ cy.getByDataTest('add-layer-button').click()
+ const n0 = LAYER_SOURCES_DEFAULT_ALL
+ cy.waitForLayerContainers(n0).then((elements) => {
+ cy.wrap(elements.length).should('equal', n0)
+ })
+ })
+ })
+})
diff --git a/d2.config.js b/d2.config.js
index e68b66bb9..cf16fb1fa 100644
--- a/d2.config.js
+++ b/d2.config.js
@@ -20,6 +20,7 @@ const config = {
},
coreApp: true,
+ dataStoreNamespace: 'DHIS2_MAPS_APP_CORE',
skipPluginLogic: true,
}
diff --git a/docs/maps.md b/docs/maps.md
index 08d3ea349..9d02e1876 100644
--- a/docs/maps.md
+++ b/docs/maps.md
@@ -22,58 +22,58 @@ and groups, or downloaded as an image.
![](resources/images/maps_main.png)
-- The **layer panel** on the left side of the workspace shows an
- overview of the layers for the current map:
+- The **layer panel** on the left side of the workspace shows an
+ overview of the layers for the current map:
- - As layers are added, using the **(+) Add layer** button, they
- are arranged and managed in this panel.
+ - As layers are added, using the **(+) Add layer** button, they
+ are arranged and managed in this panel.
- - The **basemap** card is always shown in the panel. The default available
- basemaps are OpenStreetMap Light (OSM Light) and OpenStreetMap Detailed (OSM Detailed). The default selected basemap is OSM Light, unless a different
- basemap has been configured in the system settings. OSM Detailed contains more map features and place names. If the Bing Maps API key has been added by a system administrator, then there will be an additional 4 basemaps from Bing Maps (Bing replaced Google Maps provided in previous versions). Bing Road and Bing Dark show roads, borders and places. Use the dark version if the colors on your map layers are bright. Bing Aerial and Bing Aerial Labels show satellite and detailed aerial imagery. Switch between them by selecting the desired image.
+ - The **basemap** card is always shown in the panel. The default available
+ basemaps are OpenStreetMap Light (OSM Light) and OpenStreetMap Detailed (OSM Detailed). The default selected basemap is OSM Light, unless a different
+ basemap has been configured in the system settings. OSM Detailed contains more map features and place names. If the Bing Maps API key has been added by a system administrator, then there will be an additional 4 basemaps from Bing Maps (Bing replaced Google Maps provided in previous versions). Bing Road and Bing Dark show roads, borders and places. Use the dark version if the colors on your map layers are bright. Bing Aerial and Bing Aerial Labels show satellite and detailed aerial imagery. Switch between them by selecting the desired image.
- - The small arrow button to the right of the layer panel, at the
- top, allows the panel to be hidden or shown.
+ - The small arrow button to the right of the layer panel, at the
+ top, allows the panel to be hidden or shown.
-- The **File** button near the top left allows you to open and save
- maps. See [using the maps file menu](#using_maps_file_menu) for more detailed information.
+- The **File** button near the top left allows you to open and save
+ maps. See [using the maps file menu](#using_maps_file_menu) for more detailed information.
-- The **Download** button next to the File button allows you to download the current map as a PNG image.
+- The **Download** button next to the File button allows you to download the current map as a PNG image.
-- The **Interpretations** button at top right opens an interpretations
- panel on the right side of the workspace. See [viewing interpretations](#mapsInterpretation) for more information.
+- The **Interpretations** button at top right opens an interpretations
+ panel on the right side of the workspace. See [viewing interpretations](#mapsInterpretation) for more information.
-- The **+** and **-** buttons on the map allow you to zoom in and out
- of the map respectively. The mouse scroll wheel zoom is continuous,
- allowing us to fit the map perfectly to your content.
+- The **+** and **-** buttons on the map allow you to zoom in and out
+ of the map respectively. The mouse scroll wheel zoom is continuous,
+ allowing us to fit the map perfectly to your content.
-- The **rotate map** button (triangle arrows) allows you to
- rotate and tilt the map to enhance the view of your data. Press the button
- (or the Control key on your keyboard) while moving your mouse to change the
- map view. Click to button again to reset the view.
+- The **rotate map** button (triangle arrows) allows you to
+ rotate and tilt the map to enhance the view of your data. Press and hold the button
+ (or hold the Control key on your keyboard) while moving your mouse to change the
+ map view. Click to button again to reset the view.
-- **Fullscreen** (four arrows) allows you to view the map in fullscreen.
- To exit fullscreen click the button again or the escape key on your keyboard.
+- **Fullscreen** (four arrows) allows you to view the map in fullscreen.
+ To exit fullscreen click the button again or the escape key on your keyboard.
-* **Zoom to content** (bounded magnifying glass symbol) automatically
- adjusts the zoom level and map center position to put the data on
- your map in focus.
+- **Zoom to content** (bounded magnifying glass symbol) automatically
+ adjusts the zoom level and map center position to put the data on
+ your map in focus.
-* **Search** (magnifying glass symbol) allows searching for and
- jumping to a location on the map.
+- **Search** (magnifying glass symbol) allows searching for and
+ jumping to a location on the map.
-* The **ruler** button allows you to measure distances and areas on the map.
+- The **ruler** button allows you to measure distances and areas on the map.
-* Right-click on the map to display the longitude and latitude of that
- location.
+- Right-click on the map to display the longitude and latitude of that
+ location.
**Basemaps**
@@ -84,18 +84,18 @@ as:
Along the top of the basemap card from left to right are:
-- The title of the selected basemap
+- The title of the selected basemap
-- An arrow symbol to collapse and expand the basemap card
+- An arrow symbol to collapse and expand the basemap card
In the middle of the basemap card is the list of available basemaps. The
current basemap is highlighted.
Along the bottom of the basemap card is:
-- An eye symbol for toggling the visibility of the layer
+- An eye symbol for toggling the visibility of the layer
-- A slider for modifying the layer transparency
+- A slider for modifying the layer transparency
## Create a new map { #using_maps_create_map }
@@ -109,36 +109,46 @@ Along the bottom of the basemap card is:
3. Select a layer to add to the current map. Possible options are:
- - [Thematic](#using_maps_thematic_layer)
+ - [Thematic](#using_maps_thematic_layer)
- - [Events](#using_maps_event_layer)
+ - [Events](#using_maps_event_layer)
- - [Tracked entities](#using_maps_tracked_entity_layer)
+ - [Tracked entities](#using_maps_tracked_entity_layer)
- - [Facilities](#using_maps_facility_layer)
+ - [Facilities](#using_maps_facility_layer)
- - [Org units](#using_maps_org_unit_layer)
+ - [Org units](#using_maps_org_unit_layer)
- In addition, several layers may be provided by Google Earth
- Engine and other services. The Google Earth Engine layers are available
- if the Google Earth Engine API key has been set up. See [documentation](). Other external layers may be added by the system administrator. Here is the list of available Google Earth Engine layers:
+ In addition, several layers may be provided by [Google Earth
+ Engine](#using_maps_gee) and [other external services](#using_maps_external_map_layers). Various Google Earth Engine layer sources are available
+ if the Google Earth Engine API key has been set up (see [documentation](https://docs.dhis2.org/en/use/user-guides/dhis-core-version-master/configuring-the-system/system-settings.html#system_server_settings:~:text=com/analytics.-,Google%20Maps%20API%20key,-Defines%20the%20API)).
- - Population
+ > **Note**
+ >
+ > The [**Maps app administrator**](#maps_app_administrator) can:
+ >
+ > - Select the sources for Google Earth Engine layers available to other users via the **Manage available layer sources** button.
+ > - Add external layer sources in the Maintenance app.
+
+ Here is the list of default sources for a Google Earth Engine layer:
- - Population age groups
+ - Population
- - Building footprints
+ - Population age groups
- - Elevation
+ - Building footprints
- - Precipitation
+ - Elevation
- - Temperature
+ - Precipitation
- - Landcover
+ - Temperature
- _Labels overlay_ is an [external
- layer](#using_maps_external_map_layers) defined in the Maintenance app.
+ - Landcover
+
+ The single default source for an external layer is:
+
+ - Labels overlay
## Manage thematic layers { #using_maps_thematic_layer }
@@ -159,35 +169,35 @@ as:
Along the top of the thematic card from left to right are:
-- A grab field to allow dragging and re-ordering layers with the mouse
+- A grab field to allow dragging and re-ordering layers with the mouse
-- The title and period associated with the layer
+- The title and period associated with the layer
-- An arrow symbol to collapse and expand the thematic card
+- An arrow symbol to collapse and expand the thematic card
In the middle of the thematic card is a legend indicating the value
ranges displayed on the layer.
Along the bottom of the thematic card from left to right are:
-- An edit (pencil) button to open the layer configuration dialog
+- An edit (pencil) button to open the layer configuration dialog
-- An eye symbol for toggling the visibility of the layer
+- An eye symbol for toggling the visibility of the layer
-- A slider for modifying the layer transparency
+- A slider for modifying the layer transparency
-- A more actions (three dots) button with additional options:
+- A more actions (three dots) button with additional options:
- - A **Show/hide data table** toggle button to show or hide the data table
- associated with the layer
+ - A **Show/hide data table** toggle button to show or hide the data table
+ associated with the layer
- - **Open as chart** will open this thematic data as a chart in the Data Visualizer app
+ - **Open as chart** will open this thematic data as a chart in the Data Visualizer app
- - **Download data** allows you to download the data for this layer in GeoJSON format for use in other mapping software
+ - **Download data** allows you to download the data for this layer in GeoJSON format for use in other mapping software
- - **Edit layer** is the same as edit button above
+ - **Edit layer** is the same as edit button above
- - **Remove layer** will remove this layer from the current map.
+ - **Remove layer** will remove this layer from the current map.
### Create a thematic layer
@@ -198,139 +208,139 @@ layer** selection. This opens the Thematic layer configuration dialog.
![](resources/images/maps_thematic_layer_dialog_DATA.png)
- - Select a data type and then select respectively the group and
- the target element. The available fields depend on the type of
- item selected.
+ - Select a data type and then select respectively the group and
+ the target element. The available fields depend on the type of
+ item selected.
- - Select a value from the **Aggregation type** field for the data
- values to be shown on the map. By default, "By data element" is
- selected. Alternative values are: Count; Average; Sum; Standard
- deviation; Variance; Min; Max. See also [Aggregation
- operators](https://dhis2.github.io/dhis2-docs/master/en/user/html/ch10s05.html#d0e8082).
+ - Select a value from the **Aggregation type** field for the data
+ values to be shown on the map. By default, "By data element" is
+ selected. Alternative values are: Count; Average; Sum; Standard
+ deviation; Variance; Min; Max. See also [Aggregation
+ operators](https://dhis2.github.io/dhis2-docs/master/en/user/html/ch10s05.html#d0e8082).
- - **Only show completed events**: Includes only completed events in the aggregation process.
- This is useful when you want to exclude partial events in indicator calculations. Available
- for indicators, program indictors and event data items.
+ - **Only show completed events**: Includes only completed events in the aggregation process.
+ This is useful when you want to exclude partial events in indicator calculations. Available
+ for indicators, program indictors and event data items.
2. In the **Period** tab
![](resources/images/maps_thematic_layer_dialog_PERIOD.png)
- - select the time span over which the thematic data is mapped.
- You can select either a relative or a fixed period.
+ - select the time span over which the thematic data is mapped.
+ You can select either a relative or a fixed period.
- - Relative period
+ - Relative period
- In the **Period type** field select **Relative**, then
- select one of the relative periods, for example **Last year** or
- **Last 12 months**, in the **Period** field.
+ In the **Period type** field select **Relative**, then
+ select one of the relative periods, for example **Last year** or
+ **Last 12 months**, in the **Period** field.
- A **default relative period for analysis** can be set in the **Systems Settings**
- app.
+ A **default relative period for analysis** can be set in the **Systems Settings**
+ app.
- If you select a relative period covering multiple years/months/weeks/days
- the layer can be displayed as
+ If you select a relative period covering multiple years/months/weeks/days
+ the layer can be displayed as
- - Single (aggregate)
+ - Single (aggregate)
- Show aggregate values for the relative period selected (default).
+ Show aggregate values for the relative period selected (default).
- - Timeline
+ - Timeline
- Includes a timeline allowing you to step through the periods.
- Only one timeline layer can be added to the same map.
+ Includes a timeline allowing you to step through the periods.
+ Only one timeline layer can be added to the same map.
- - Split map views
+ - Split map views
- Show multiple maps allowing you to compare different periods
- side by side. Supported for relative periods with 12 items
- or below. Can not be combined with other layer types.
+ Show multiple maps allowing you to compare different periods
+ side by side. Supported for relative periods with 12 items
+ or below. Can not be combined with other layer types.
- - Fixed period
+ - Fixed period
- In the **Period type** field select period length, then
- select the target in the **Period** field.
+ In the **Period type** field select period length, then
+ select the target in the **Period** field.
- - Start/end dates
+ - Start/end dates
- In the **Period type** field select **Start/end dates**
- and fill in a start date and an end date.
+ In the **Period type** field select **Start/end dates**
+ and fill in a start date and an end date.
3. In the **Org Units** tab:
![](resources/images/maps_thematic_layer_dialog_ORG_UNITS.png)
- - Select the organisation units you want to include in the layer.
- It is possible to select either
+ - Select the organisation units you want to include in the layer.
+ It is possible to select either
- - One or more specific organisation units, organisation unit levels in
- the hierarchy, organisation unit groups, or
+ - One or more specific organisation units, organisation unit levels in
+ the hierarchy, organisation unit groups, or
- - A relative level in the organisation unit hierarchy, with
- respect to the user. By selecting a **User organisation
- unit** the map data will appear differently for users at
- different levels in the organisation unit hierarchy.
+ - A relative level in the organisation unit hierarchy, with
+ respect to the user. By selecting a **User organisation
+ unit** the map data will appear differently for users at
+ different levels in the organisation unit hierarchy.
- - **Use associated geometry**: This dropdown will only show if there
- are any additional geometry available for your organisation units.
- This is typically used to show facility catchment areas.
+ - **Use associated geometry**: This dropdown will only show if there
+ are any additional geometry available for your organisation units.
+ This is typically used to show facility catchment areas.
4. In the **Filter** tab:
![](resources/images/maps_thematic_layer_dialog_FILTER.png)
- - Click **Add Filter** and select an available data item to add a new
- filter to the data set.
+ - Click **Add Filter** and select an available data item to add a new
+ filter to the data set.
- - Select a data dimension from the dropdown box. You can
- reduce the number of dimensions shown by using the search field.
- Click on the name to select a dimension.
+ - Select a data dimension from the dropdown box. You can
+ reduce the number of dimensions shown by using the search field.
+ Click on the name to select a dimension.
- - When a dimension is selected you get a second dropdown with
- dimension items. Check the items you want to include in the
- filter.
+ - When a dimension is selected you get a second dropdown with
+ dimension items. Check the items you want to include in the
+ filter.
- Multiple filters may be added. Click the trash button on the right of
- the filter to remove it.
+ Multiple filters may be added. Click the trash button on the right of
+ the filter to remove it.
5. In the **Style** tab:
![](resources/images/maps_thematic_layer_dialog_STYLE.png)
- - Select either **Choropleth** or **Bubble map**.
+ - Select either **Choropleth** or **Bubble map**.
- - Choropleth will assign a color to each org unit shape according to the data value. This is the recommended technique if the data is normalised (per capita).
+ - Choropleth will assign a color to each org unit shape according to the data value. This is the recommended technique if the data is normalised (per capita).
- - Bubble map will show data values as proportional circles. Use this
- technique if the data is not normalised (absolute numbers). The circles are placed in the center of each org unit.
+ - Bubble map will show data values as proportional circles. Use this
+ technique if the data is not normalised (absolute numbers). The circles are placed in the center of each org unit.
- - Set the **Low radius** and **High radius** for the proportional circles or the point facilities. The circles will be scaled between low and high radius according to the data value. The radius needs to be between 0 and 50 px.
+ - Set the **Low radius** and **High radius** for the proportional circles or the point facilities. The circles will be scaled between low and high radius according to the data value. The radius needs to be between 0 and 50 px.
- - **Show labels**: Allows org unit names and values to be shown on the layer.
- Select between "Name", "Name and value" and "Value" only. Font size, weight, style
- and color can also be modified.
+ - **Show labels**: Allows org unit names and values to be shown on the layer.
+ Select between "Name", "Name and value" and "Value" only. Font size, weight, style
+ and color can also be modified.
- - **Show no data**: By default org units with missing data values will not show on the map.
- Check this box if you want to show them with a color. Click the color to change it.
+ - **Show no data**: By default org units with missing data values will not show on the map.
+ Check this box if you want to show them with a color. Click the color to change it.
- - Select the legend type:
+ - Select the legend type:
- - **Automatic color legend**: the application will create a legend for you based on
- what classification method, number of classes and the color scale you select. Set
- **Classification** to either:
+ - **Automatic color legend**: the application will create a legend for you based on
+ what classification method, number of classes and the color scale you select. Set
+ **Classification** to either:
- - Equal intervals
+ - Equal intervals
- the range of each interval will be (highest data value - lowest data value / number of classes)
+ the range of each interval will be (highest data value - lowest data value / number of classes)
- - Equal counts
+ - Equal counts
- the legend creator will try to distribute the organisation units evenly.
+ the legend creator will try to distribute the organisation units evenly.
- - **Predefined color legend**: Select between the predefined legends.
+ - **Predefined color legend**: Select between the predefined legends.
- - **Single color legend**: Select the color of the bubbles or circles. Only available
- for bubble maps.
+ - **Single color legend**: Select the color of the bubbles or circles. Only available
+ for bubble maps.
6. Click **Add layer**.
@@ -352,49 +362,49 @@ off from the thematic layer card.
The data table displays the data forming the thematic layer.
-- clicking on a up/down arrow button will sort the table based on that column;
- toggling between ascending and descending.
+- clicking on a up/down arrow button will sort the table based on that column;
+ toggling between ascending and descending.
-- entering text or expressions into the filter fields below the titles
- will apply those filters to the data, and the display will adjust
- according to the filter. The filters are applied as follows:
+- entering text or expressions into the filter fields below the titles
+ will apply those filters to the data, and the display will adjust
+ according to the filter. The filters are applied as follows:
- - NAME
+ - NAME
- filter by name containing the given text
+ filter by name containing the given text
- - VALUE
+ - VALUE
- filter values by given numbers and/or ranges, for example:
- 2,\>3&\<8
+ filter values by given numbers and/or ranges, for example:
+ 2,\>3&\<8
- - LEGEND
+ - LEGEND
- filter by legend containing the given text
+ filter by legend containing the given text
- - RANGE
+ - RANGE
- filter by ranges containing the given text
+ filter by ranges containing the given text
- - LEVEL
+ - LEVEL
- filter level by numbers and/or ranges, for example: 2,\>3&\<8
+ filter level by numbers and/or ranges, for example: 2,\>3&\<8
- - PARENT
+ - PARENT
- filter by parent names containing the given text
+ filter by parent names containing the given text
- - ID
+ - ID
- filter by IDs containing the given text
+ filter by IDs containing the given text
- - TYPE
+ - TYPE
- filter by GIS display types containing the given text
+ filter by GIS display types containing the given text
- - COLOR
+ - COLOR
- filter by color names containing the given text
+ filter by color names containing the given text
> **Note**
>
@@ -461,32 +471,32 @@ as:
Along the top of the event card from left to right are:
-- A grab field to allow dragging and re-ordering layers with the mouse
+- A grab field to allow dragging and re-ordering layers with the mouse
-- The title and period associated with the layer
+- The title and period associated with the layer
-- An arrow symbol to collapse and expand the event card
+- An arrow symbol to collapse and expand the event card
In the middle of the event card is a legend indicating the styling of
the layer.
Along the bottom of the event card from left to right are:
-- An edit (pencil) button to open the layer configuration dialog
+- An edit (pencil) button to open the layer configuration dialog
-- An eye symbol for toggling the visibility of the layer
+- An eye symbol for toggling the visibility of the layer
-- A slider for modifying the layer transparency
+- A slider for modifying the layer transparency
-- A more actions (three dots) button with additional options:
+- A more actions (three dots) button with additional options:
- - A **Show/hide data table** toggle button to show or hide the data table associated with the layer
+ - A **Show/hide data table** toggle button to show or hide the data table associated with the layer
- - **Download data** allows you to download the data for this layer in GeoJSON format for use in other mapping software
+ - **Download data** allows you to download the data for this layer in GeoJSON format for use in other mapping software
- - **Edit layer** is the same as edit button above
+ - **Edit layer** is the same as edit button above
- - **Remove layer** will remove this layer from the current map.
+ - **Remove layer** will remove this layer from the current map.
### Create an event layer { #maps_create_event_layer }
@@ -497,115 +507,115 @@ layer** selection. This opens the Events layer configuration dialog.
![](resources/images/maps_event_layer_dialog_DATA.png)
- - Select a program and then select a program stage. The **Stage**
- field is only shown once a program is selected.
+ - Select a program and then select a program stage. The **Stage**
+ field is only shown once a program is selected.
- If there is only one stage available for the selected program,
- the stage is automatically selected.
+ If there is only one stage available for the selected program,
+ the stage is automatically selected.
- - Select a value from the **Coordinate field** for the positions
- shown on the map. By default, "Event location" is selected.
- Depending on the data elements or attributes that belong to a
- program, other coordinates such as "Household position" are
- available.
+ - Select a value from the **Coordinate field** for the positions
+ shown on the map. By default, "Event location" is selected.
+ Depending on the data elements or attributes that belong to a
+ program, other coordinates such as "Household position" are
+ available.
- - By default all events with coordinates are shown on the map.
- Use the **Event status** field to only show events having one
- status: Active, Completed, Schedule, Overdue or Skipped.
+ - By default all events with coordinates are shown on the map.
+ Use the **Event status** field to only show events having one
+ status: Active, Completed, Schedule, Overdue or Skipped.
2. In the **Period** tab
![](resources/images/maps_event_layer_dialog_PERIOD.png)
- - select the time span for when the events took place. You can
- select either a fixed period or a relative period.
+ - select the time span for when the events took place. You can
+ select either a fixed period or a relative period.
- - Relative period
+ - Relative period
- In the **Period** field, select one of the relative periods,
- for example **This month** or **Last year**.
+ In the **Period** field, select one of the relative periods,
+ for example **This month** or **Last year**.
- A **default relative period for analysis** can be set in the
- **Systems Settings** app.
+ A **default relative period for analysis** can be set in the
+ **Systems Settings** app.
- - Fixed period
+ - Fixed period
- In the **Period** field, select **Start/end dates** and fill
- in a start date and an end date.
+ In the **Period** field, select **Start/end dates** and fill
+ in a start date and an end date.
3. In the **Org Units** tab:
![](resources/images/maps_event_layer_dialog_ORG_UNITS.png)
- - Select the organisation units you want to include in the layer.
- It is possible to select either
+ - Select the organisation units you want to include in the layer.
+ It is possible to select either
- - One or more specific organisation units, or
+ - One or more specific organisation units, or
- - A relative level in the organisation unit hierarchy, with
- respect to the user. By selecting a **User organisation
- unit** the map data will appear differently for users at
- different levels in the organisation unit hierarchy.
+ - A relative level in the organisation unit hierarchy, with
+ respect to the user. By selecting a **User organisation
+ unit** the map data will appear differently for users at
+ different levels in the organisation unit hierarchy.
4. In the **Filter** tab:
![](resources/images/maps_event_layer_dialog_FILTER.png)
- - Click ADD FILTER and select an available data item to add a new
- filter to the data set.
+ - Click ADD FILTER and select an available data item to add a new
+ filter to the data set.
- - For data item of type _option set_, you can select any of
- the options from the dropdown box by using the down-wards
- arrow or by start typing directly in the box to filter for
- options.
+ - For data item of type _option set_, you can select any of
+ the options from the dropdown box by using the down-wards
+ arrow or by start typing directly in the box to filter for
+ options.
- - For data item of type _number_, you can select operators like
- equal, not equal, greater than or less than.
+ - For data item of type _number_, you can select operators like
+ equal, not equal, greater than or less than.
- - For data item of type _boolean_ (yes/no), you can check the box
- if the condition should be valid or true.
+ - For data item of type _boolean_ (yes/no), you can check the box
+ if the condition should be valid or true.
- - For data item of type _text_ you will get two choices:
- **Contains** implies that the query will match all values
- which contains your search value, and **Is exact** implies
- that only values which is completely identical to your
- search query will be returned.
+ - For data item of type _text_ you will get two choices:
+ **Contains** implies that the query will match all values
+ which contains your search value, and **Is exact** implies
+ that only values which is completely identical to your
+ search query will be returned.
- Multiple filters may be added. Click the trash button on the right of
- the filter to remove it.
+ Multiple filters may be added. Click the trash button on the right of
+ the filter to remove it.
5. In the **Style** tab:
![](resources/images/maps_event_layer_dialog_STYLE.png)
- - Select **Group events** to group nearby events (cluster), or
- **View all events** to display events individually.
+ - Select **Group events** to group nearby events (cluster), or
+ **View all events** to display events individually.
- - Select a **color** for the event or cluster points.
+ - Select a **color** for the event or cluster points.
- - Select the **radius** (between 1 and 20) for the events.
+ - Select the **radius** (between 1 and 20) for the events.
- - Select **Show buffer** to display visual buffer around each
- event. The radius of the buffer can be modified here. This
- option is only available if you select **View all events**
- above.
+ - Select **Show buffer** to display visual buffer around each
+ event. The radius of the buffer can be modified here. This
+ option is only available if you select **View all events**
+ above.
- - Select a **Style by data element** to colorise the events
- according to a data value. If you also select to group events,
- the culsters will be displayed as small donut charts showing
- the distribution of the data values. The available options vary for
- different data types:
+ - Select a **Style by data element** to colorise the events
+ according to a data value. If you also select to group events,
+ the culsters will be displayed as small donut charts showing
+ the distribution of the data values. The available options vary for
+ different data types:
- - **Option sets**: Select a color for each option in an option
- set. You can set default colors for an option in the
- Maintenance app.
+ - **Option sets**: Select a color for each option in an option
+ set. You can set default colors for an option in the
+ Maintenance app.
- - **Numbers**: You can style a numeric data element in [the same
- way as thematic layers](#using_maps_thematic_layer_style) using
- automatic or predefined legends.
+ - **Numbers**: You can style a numeric data element in [the same
+ way as thematic layers](#using_maps_thematic_layer_style) using
+ automatic or predefined legends.
- - **Booleans**: Select a color for true/yes and another for
- false/no.
+ - **Booleans**: Select a color for true/yes and another for
+ false/no.
6. Click **Add layer**.
@@ -628,37 +638,37 @@ off from the event layer card.
The data table displays the data forming the event layer.
-- clicking on the up/down arrow will sort the table based on that column;
- toggling between ascending and descending.
+- clicking on the up/down arrow will sort the table based on that column;
+ toggling between ascending and descending.
-- entering text or expressions into the filter fields below the titles
- will apply those filters to the data, and the display will adjust
- according to the filter. The filters are applied as follows:
+- entering text or expressions into the filter fields below the titles
+ will apply those filters to the data, and the display will adjust
+ according to the filter. The filters are applied as follows:
- - ID
+ - ID
- filter by event IDs containing the given text
+ filter by event IDs containing the given text
- - ORG UNIT
+ - ORG UNIT
- filter by org unit name containing the given text
+ filter by org unit name containing the given text
- - EVENT TIME
+ - EVENT TIME
- filter by event time containing the given text
+ filter by event time containing the given text
- - TYPE
+ - TYPE
- filter by GIS display types containing the given text
+ filter by GIS display types containing the given text
- - **Style by data element**: If events are styled by a data element
- (e.g. gender) both the data value and the color can be filtered.
+ - **Style by data element**: If events are styled by a data element
+ (e.g. gender) both the data value and the color can be filtered.
- - **Display in reports**: Data elements checked to display in reports will
- be shown in separate columns (see below how to add them).
+ - **Display in reports**: Data elements checked to display in reports will
+ be shown in separate columns (see below how to add them).
- - Numeric data values can be filtered by given numbers, and/or ranges,
- for example: 2,\>3&\<8
+ - Numeric data values can be filtered by given numbers, and/or ranges,
+ for example: 2,\>3&\<8
> **Note**
>
@@ -667,7 +677,7 @@ The data table displays the data forming the event layer.
### Modify information in event data table and popups
-If you have access to the selected program in the maintenance app, you can modify the information displayed in the event pop-up window.
+If you have access to the selected program in the Maintenance app, you can modify the information displayed in the event pop-up window.
![](resources/images/maps_eventlayer_eventinfopopup.png)
@@ -688,19 +698,19 @@ The raw data for event layers can be downloaded in GeoJSON format for more advan
![](resources/images/maps_data_download_dialog.png)
-- In the layer card to the left, click the _more actions_ (three dots) icon and then on **Download data**
+- In the layer card to the left, click the _more actions_ (three dots) icon and then on **Download data**
-- Select the **ID format** to use as the key for Data Element values in the downloaded GeoJSON file. There are three options available:
+- Select the **ID format** to use as the key for Data Element values in the downloaded GeoJSON file. There are three options available:
- - **ID** - Use the unique ID of the data element
- - **Name** - Use the human-friendly name of the data element (translated)
- - **Code** - Use the code of the data element
+ - **ID** - Use the unique ID of the data element
+ - **Name** - Use the human-friendly name of the data element (translated)
+ - **Code** - Use the code of the data element
-- Select whether or not to **Use human-readable keys** for other Event attributes, such as Program Stage, Latitude, Longitude, Event Data, and Organization Unit ID, Name, and Code. When this option is **not** selected these values will be the computer-friendly ID instead of the human-readable (and translated) name.
+- Select whether or not to **Use human-readable keys** for other Event attributes, such as Program Stage, Latitude, Longitude, Event Data, and Organization Unit ID, Name, and Code. When this option is **not** selected these values will be the computer-friendly ID instead of the human-readable (and translated) name.
-- Click the **Download** button to generate and download a GeoJSON file. The data will be requested from the DHIS2 server and processed by the maps application. This operation may take several minutes to complete.
+- Click the **Download** button to generate and download a GeoJSON file. The data will be requested from the DHIS2 server and processed by the maps application. This operation may take several minutes to complete.
-- Once the GeoJSON file has been downloaded it can be imported into most standard GIS software applications.
+- Once the GeoJSON file has been downloaded it can be imported into most standard GIS software applications.
> Note that the downloaded data does not include style information as it is not natively supported by the GeoJSON format. Styles can optionally be recreated in external GIS applications using the attributes of each feature.
@@ -726,29 +736,29 @@ such as:
Along the top of the tracked entity card from left to right are:
-- A grab field to allow dragging and re-ordering layers with the
- mouse.
+- A grab field to allow dragging and re-ordering layers with the
+ mouse.
-- The title and period associated with the layer.
+- The title and period associated with the layer.
-- An arrow symbol to collapse and expand the tracked entity card.
+- An arrow symbol to collapse and expand the tracked entity card.
In the middle of the tracked entity card is a legend indicating the
styling of the layer.
Along the bottom of the tracked entity card from left to right are:
-- An edit (pencil) button to open the layer configuration dialog
+- An edit (pencil) button to open the layer configuration dialog
-- An eye symbol for toggling the visibility of the layer
+- An eye symbol for toggling the visibility of the layer
-- A slider for modifying the layer transparency
+- A slider for modifying the layer transparency
-- A more actions (three dots) button with additional options:
+- A more actions (three dots) button with additional options:
- - **Edit layer** is the same as edit button above
+ - **Edit layer** is the same as edit button above
- - **Remove layer** will remove this layer from the current map.
+ - **Remove layer** will remove this layer from the current map.
### Create a tracked entity layer { #maps_create_tracked_enity_layer }
@@ -760,15 +770,15 @@ configuration dialog.
![](resources/images/maps_tracked_entity_layer_dialog_DATA.png)
- - Select the **Tracked Entity Type** you want to show on the map.
+ - Select the **Tracked Entity Type** you want to show on the map.
- - Select a **Program** where the tracked entities belong.
+ - Select a **Program** where the tracked entities belong.
- - Use the **Program status** field to select the enrollment status of tracked entities
- to include: All, Active, Completed or Cancelled.
+ - Use the **Program status** field to select the enrollment status of tracked entities
+ to include: All, Active, Completed or Cancelled.
- - Set the **Follow up** status of the tracked entity for the given
- program.
+ - Set the **Follow up** status of the tracked entity for the given
+ program.
2. In the **Relationships** tab
@@ -778,50 +788,50 @@ configuration dialog.
>
> Displaying tracked entity relationships in Maps is an experimental feature
- - If a Tracked Entity Type with relationships has been selected, you can select the **Display Tracked Entity relationships** checkbox
+ - If a Tracked Entity Type with relationships has been selected, you can select the **Display Tracked Entity relationships** checkbox
- - Once checked, you can select the type of relationship to display on the map from the dropdown list. Only relationships from the selected Tracked Entity type are available.
+ - Once checked, you can select the type of relationship to display on the map from the dropdown list. Only relationships from the selected Tracked Entity type are available.
3. In the **Period** tab
![](resources/images/maps_tracked_entity_layer_dialog_PERIOD.png)
- - If no program is selected, you can set start and end dates when
- the tracked entities were last updated.
+ - If no program is selected, you can set start and end dates when
+ the tracked entities were last updated.
- - If a program is selected, you can set the period when tracked entities were last
- updated or when they were registered or enrolled in the program.
+ - If a program is selected, you can set the period when tracked entities were last
+ updated or when they were registered or enrolled in the program.
4. In the **Org Units** tab:
![](resources/images/maps_tracked_entity_layer_dialog_ORG_UNITS.png)
- - Select the organisation units you want to include in the layer.
- You have 3 selection modes:
+ - Select the organisation units you want to include in the layer.
+ You have 3 selection modes:
- - **Selected only**: Include tracked entities belonging to
- selected org units only.
+ - **Selected only**: Include tracked entities belonging to
+ selected org units only.
- - **Selected and below**: Included tracked entities in and
- right below selected org units.
+ - **Selected and below**: Included tracked entities in and
+ right below selected org units.
- - **Selected and all below**: Included tracked entities in and
- all below selected org units.
+ - **Selected and all below**: Included tracked entities in and
+ all below selected org units.
5. In the **Style** tab:
![](resources/images/maps_tracked_entity_layer_dialog_STYLE.png)
- - Select a **color** for the tracked entities points and polygons.
+ - Select a **color** for the tracked entities points and polygons.
- - Select the **point size** (radius between 1 and 20) for the
- points.
+ - Select the **point size** (radius between 1 and 20) for the
+ points.
- - Select **Show buffer** to display visual buffer around each
- tracked entity. The buffer distance in meters can be modified
- here.
+ - Select **Show buffer** to display visual buffer around each
+ tracked entity. The buffer distance in meters can be modified
+ here.
- - If a relationship type has been selected on the relationships tab you can select **color**, **point size**, and **line color** for relationships and related tracked entities instances
+ - If a relationship type has been selected on the relationships tab you can select **color**, **point size**, and **line color** for relationships and related tracked entities instances
6. Click **Add/Update layer**.
@@ -860,33 +870,33 @@ as:
Along the top of the facilities card from left to right are:
-- A grab field to allow dragging and re-ordering layers with the mouse
+- A grab field to allow dragging and re-ordering layers with the mouse
-- The **Facilities** title
+- The **Facilities** title
-- An eye symbol for toggling the visibility of the layer
+- An eye symbol for toggling the visibility of the layer
-- An arrow symbol to collapse and expand the facilities card
+- An arrow symbol to collapse and expand the facilities card
In the middle of the facilities card is a legend indicating the group
set representation.
Along the bottom of the facilities card from left to right are:
-- An edit (pencil) button to open the layer configuration dialog
+- An edit (pencil) button to open the layer configuration dialog
-- A slider for modifying the layer transparency
+- A slider for modifying the layer transparency
-- A more actions (three dots) button with additional options:
+- A more actions (three dots) button with additional options:
- - A **Show/hide data table** toggle button to show or hide the data table
- associated with the layer
+ - A **Show/hide data table** toggle button to show or hide the data table
+ associated with the layer
- - **Download data** allows you to download the data for this layer in GeoJSON format for use in other mapping software
+ - **Download data** allows you to download the data for this layer in GeoJSON format for use in other mapping software
- - **Edit layer** is the same as edit button above
+ - **Edit layer** is the same as edit button above
- - **Remove layer** will remove this layer from the current map.
+ - **Remove layer** will remove this layer from the current map.
### Create a facility layer
@@ -897,51 +907,51 @@ layer**selection. This opens the Facility layer configuration dialog.
![](resources/images/maps_facility_layer_dialog_ORG_UNITS.png)
- - Select the organisation unit level(s) and/or group(s) from the
- selection fields on the right hand side.
+ - Select the organisation unit level(s) and/or group(s) from the
+ selection fields on the right hand side.
- - Select the organisation units you want to include in the layer.
- It is possible to select either
+ - Select the organisation units you want to include in the layer.
+ It is possible to select either
- - One or more specific organisation units, or
+ - One or more specific organisation units, or
- - A relative level in the organisation unit hierarchy, with
- respect to the user. By selecting a **User organisation
- unit** the map data will appear differently for users at
- different levels in the organisation unit hierarchy.
+ - A relative level in the organisation unit hierarchy, with
+ respect to the user. By selecting a **User organisation
+ unit** the map data will appear differently for users at
+ different levels in the organisation unit hierarchy.
- - The system administrator can set the default organsation unit
- level containing facilities in the **System Settings** app.
+ - The system administrator can set the default organsation unit
+ level containing facilities in the **System Settings** app.
- - **Use associated geometry**: This dropdown will only show if there
- are any additional geometry available for your organisation units.
- This is typically used to show facility catchment areas.
+ - **Use associated geometry**: This dropdown will only show if there
+ are any additional geometry available for your organisation units.
+ This is typically used to show facility catchment areas.
2. In the **Style** tab:
![](resources/images/maps_facility_layer_dialog_STYLE.png)
- - Select any styling you wish to apply to the facilities.
+ - Select any styling you wish to apply to the facilities.
- - Show labels
+ - Show labels
- Allows labels to be shown on the layer. Font size, weight
- and color can be modified here.
+ Allows labels to be shown on the layer. Font size, weight
+ and color can be modified here.
- - Show buffer
+ - Show buffer
- Allows a visual buffer to be displayed on the layer around
- each facility. The radius of the buffer can be modified
- here. Buffer option is not available if asscoiated geometry is used.
+ Allows a visual buffer to be displayed on the layer around
+ each facility. The radius of the buffer can be modified
+ here. Buffer option is not available if asscoiated geometry is used.
- - Facilities can be styled an **organisation unit group set** using
- different icons. Select a group set from the list of organisation
- unit group sets defined for your DHIS2 instance.
- The system administrator can set the default organsation unit
- group set in the **System Settings** app.
+ - Facilities can be styled an **organisation unit group set** using
+ different icons. Select a group set from the list of organisation
+ unit group sets defined for your DHIS2 instance.
+ The system administrator can set the default organsation unit
+ group set in the **System Settings** app.
- - If no group set is selected, the facilities will be shown as filled
- circles. The color and the circle radius can be changed.
+ - If no group set is selected, the facilities will be shown as filled
+ circles. The color and the circle radius can be changed.
3. Click **Add layer**.
@@ -964,24 +974,24 @@ off from the facility layer card.
The data table displays the data forming the facility layer.
-- clicking on the up/down arrow will sort the table based on that column;
- toggling between ascending and descending.
+- clicking on the up/down arrow will sort the table based on that column;
+ toggling between ascending and descending.
-- entering text or expressions into the filter fields below the titles
- will apply those filters to the data, and the display will adjust
- according to the filter. The filters are applied as follows:
+- entering text or expressions into the filter fields below the titles
+ will apply those filters to the data, and the display will adjust
+ according to the filter. The filters are applied as follows:
- - NAME
+ - NAME
- filter by name containing the given text
+ filter by name containing the given text
- - ID
+ - ID
- filter by IDs containing the given text
+ filter by IDs containing the given text
- - TYPE
+ - TYPE
- filter by GIS display types containing the given text
+ filter by GIS display types containing the given text
> **Note**
>
@@ -1027,30 +1037,30 @@ as:
Along the top of the org unit card from left to right are:
-- A grab field to allow dragging and re-ordering layers with the mouse
+- A grab field to allow dragging and re-ordering layers with the mouse
-- The **Organisation unit** title
+- The **Organisation unit** title
-- An arrow symbol to collapse and expand the org unit card
+- An arrow symbol to collapse and expand the org unit card
Along the bottom of the org unit card from left to right are:
-- An edit (pencil) button to open the layer configuration dialog
+- An edit (pencil) button to open the layer configuration dialog
-- An eye symbol for toggling the visibility of the layer
+- An eye symbol for toggling the visibility of the layer
-- A slider for modifying the layer transparency
+- A slider for modifying the layer transparency
-- A more actions (three dots) button with additional options:
+- A more actions (three dots) button with additional options:
- - A **Show/hide data table** toggle button to show or hide the data table
- associated with the layer
+ - A **Show/hide data table** toggle button to show or hide the data table
+ associated with the layer
- - **Download data** allows you to download the data for this layer in GeoJSON format for use in other mapping software
+ - **Download data** allows you to download the data for this layer in GeoJSON format for use in other mapping software
- - **Edit layer** is the same as edit button above
+ - **Edit layer** is the same as edit button above
- - **Remove layer** will remove this layer from the current map.
+ - **Remove layer** will remove this layer from the current map.
### Create an org unit layer
@@ -1061,47 +1071,47 @@ layer** selection. This opens the org unit layer configuration dialog.
![](resources/images/maps_org_unit_layer_dialog_ORG_UNITS.png)
- - select the organisation unit level(s) and/or group(s) from the
- selection fields on the right hand side.
+ - select the organisation unit level(s) and/or group(s) from the
+ selection fields on the right hand side.
- - Select the organisation units you want to include in the layer.
- It is possible to select either
+ - Select the organisation units you want to include in the layer.
+ It is possible to select either
- - One or more specific organisation units, or
+ - One or more specific organisation units, or
- - A relative level in the organisation unit hierarchy, with
- respect to the user. By selecting a **User organisation
- unit** the map data will appear differently for users at
- different levels in the organisation unit hierarchy.
+ - A relative level in the organisation unit hierarchy, with
+ respect to the user. By selecting a **User organisation
+ unit** the map data will appear differently for users at
+ different levels in the organisation unit hierarchy.
- - **Use associated geometry**: This dropdown will only show if there
- are any additional geometry available for your organisation units.
- This is typically used to show facility catchment areas.
+ - **Use associated geometry**: This dropdown will only show if there
+ are any additional geometry available for your organisation units.
+ This is typically used to show facility catchment areas.
2. In the **Style** tab:
![](resources/images/maps_org_unit_layer_dialog_STYLE.png)
- - select any styling you wish to apply to the org unitss.
+ - select any styling you wish to apply to the org unitss.
- - Labels
+ - Labels
- Allows labels to be shown on the layer. Font style can be
- modified here.
+ Allows labels to be shown on the layer. Font style can be
+ modified here.
- - Boundary color
+ - Boundary color
- Allows the boundary or outline color of the organisation units
- to be changed.
+ Allows the boundary or outline color of the organisation units
+ to be changed.
- - Point radius
+ - Point radius
- Sets the base radius when point type elements, such as
- facilities, are presented on the org unit layer.
+ Sets the base radius when point type elements, such as
+ facilities, are presented on the org unit layer.
- - Organisation units can be styled an **organisation unit group set**
- using different colors. Select a group set from the list of organisation
- unit group sets defined for your DHIS2 instance.
+ - Organisation units can be styled an **organisation unit group set**
+ using different colors. Select a group set from the list of organisation
+ unit group sets defined for your DHIS2 instance.
3. Click **Add layer**.
@@ -1124,32 +1134,32 @@ off from the org unit layer card.
The data table displays the data forming the org unit layer.
-- clicking on a title will sort the table based on that column;
- toggling between ascending and descending.
+- clicking on a title will sort the table based on that column;
+ toggling between ascending and descending.
-- entering text or expressions into the filter fields below the titles
- will apply those filters to the data, and the display will adjust
- according to the filter. The filters are applied as follows:
+- entering text or expressions into the filter fields below the titles
+ will apply those filters to the data, and the display will adjust
+ according to the filter. The filters are applied as follows:
- - NAME
+ - NAME
- filter by name containing the given text
+ filter by name containing the given text
- - LEVEL
+ - LEVEL
- filter level by numbers and/or ranges, for example: 2,\>3&\<8
+ filter level by numbers and/or ranges, for example: 2,\>3&\<8
- - PARENT
+ - PARENT
- filter by parent names containing the given text
+ filter by parent names containing the given text
- - ID
+ - ID
- filter by IDs containing the given text
+ filter by IDs containing the given text
- - TYPE
+ - TYPE
- filter by GIS display types containing the given text
+ filter by GIS display types containing the given text
> **Note**
>
@@ -1208,29 +1218,30 @@ facility. The elevation layer allows you to find the lowest, highest and
mean elevation. Use the landcover layer to see the forest cover, croplands
or urban areas, and calculate the percentage for each organisation unit.
-The following layers are supported:
+The following layer sources are supported and displayed by default:
![](resources/images/maps_ee_layer_types.png)
-- **Population**: Detailed population data from WorldPop showing the estimated
- number of poeple living in an area. Available for yearly periods from 2000 and
- onwards.
+- **Population**: Detailed population data from WorldPop showing the estimated
+ number of people living in an area. Available for 2020.
-- **Population age groups**: Estimated number of people living in an area, grouped
- by age and gender.
+- **Population age groups**: Estimated number of people living in an area, grouped
+ by age and gender. Available for 2020.
-- **Building footprints**: The outlines of buildings derived from high-resolution
- satellite imagery. Only for the continent of Africa.
+- **Building footprints**: The outlines of buildings derived from high-resolution
+ satellite imagery. Only for Sub-Saharan Africa, South and South-East Asia, Latin America and the Caribbean.
-- **Elevation**: Elevation above sea level.
+- **Elevation**: Elevation above sea level.
-- **Precipitation**: The values are in millimeters within 5 days periods. Updated
- monthly, during the 3rd week of the following month. Collected from satellite and weather stations on the ground.
+- **Precipitation**: Accumulated liquid and frozen water, including rain and snow, that falls to the surface. Combines model data with observations from across the world. Available monthly, from 1950.
-- **Temperature**: Land surface temperatures collected from satellite.
- Blank spots will appear in areas with a persistent cloud cover.
+- **Temperature**: Temperature at 2m above the surface. Combines model data with observations from across the world. Available monthly, from 1950.
-- **Land cover**: 17 distinct landcover types collected from satellites by NASA.
+- **Land cover**: 17 distinct landcover types collected from satellites by NASA. Available yearly, between 2001 and 2022.
+
+> **Note**
+>
+> The [**Maps app administrator**](#maps_app_administrator) can show or hide layer sources from other users.
### Create an Earth Engine layer
@@ -1241,82 +1252,80 @@ layer** selection. This opens the layer configuration dialog.
![](resources/images/maps_ee_layer_dialog_DATA.png)
- - For "population age groups" you can select the age/gender **groups**
- you would like to include when aggregating the data.
+ - For "population age groups" you can select the age/gender **groups**
+ you would like to include when aggregating the data.
+
+ - Select the **aggregation methods** you would like to use when calculating
+ values for the selected organisation units (some option might not be available depending on the layer source).
- - Select the **aggregation methods** you would like to use when calculating
- values for the selected organisation units.
+ - **Sum**: Calculates the total number within each organisation unit.
+ Recommended to use for the population layers.
- - **Sum**: Calculates the total number within each organisation unit.
- Recommended to use for the population layers.
+ - **Min**: Returns the minimum value in the layer unit displayed below the
+ selection. For population layers it will be the minimum _people per
+ hectar_. For elevation layer it will return the lowest elevation (meters
+ above sea level).
- - **Min**: Returns the minimum value in the layer unit displayed below the
- selection. For population layers it will be the minimum _people per
- hectar_. For elevation layer it will return the lowest elevation (meters
- above sea level).
+ - **Max**: Returns the maximum value in the layer unit. For population
+ layers it will be the minimum _people per hectar_. For elevation layer it
+ will return the highest elevation for each organisation unit.
- - **Max**: Returns the maximum value in the layer unit. For population
- layers it will be the minimum _people per hectar_. For elevation layer it
- will return the highest elevation for each organisation unit.
+ - **Mean**: Returns the mean value in the layer unit. For population layers
+ it will be the mean _people per hectar_. For precipitation layer it will
+ be the mean rainfall in millimeters across the organisation unit.
- - **Mean**: Returns the mean value in the layer unit. For population layers
- it will be the mean _people per hectar_. For precipitation layer it will
- be the mean rainfall in millimeters across the organisation unit.
+ - **Median**: Returns the mean value in the layer unit. For population layers
+ it will be the median _people per hectar_. For temperature layer it will
+ be the median °C during daytime for the organisation unit.
- - **Median**: Returns the mean value in the layer unit. For population layers
- it will be the median _people per hectar_. For temperature layer it will
- be the median °C during daytime for the organisation unit.
+ - **Standard deviation**: Returns the standard deviation value in the layer
+ unit.
- - **Standard deviation**: Returns the standard deviation value in the layer
- unit.
+ - **Variance**: Returns the variance value in the layer unit.
- - **Variance**: Returns the variance value in the layer unit.
+ - **Special cases**:
+ - For "building footprints": **Count**: Returns the number of buildings within each organisation unit. Note that building counts are only available for smaller organisation unit areas.
+ - For "landcover": **Percentage**, **Hectar**, **Acres**: Return the area covered by each landcover category within each organisation in different units.
2. In the **Period** tab
![](resources/images/maps_ee_layer_dialog_PERIOD.png)
- - Select the period for the data source. The available periods are set by
- data provider. There is only one period for the "population age groups" layer,
- while the "population" layer has yearly data available from 2000 and onwards.
- Precipitation data is available in 5 days periods, and temperature data for
- 8 days periods.
+ - Select the period for the data source. The available periods are set by
+ layer source. Sources are available either montly or yearly others are available at a single point in time.
3. In the **Organisation Units** tab:
![](resources/images/maps_ee_layer_dialog_ORG_UNITS.png)
- - Select the organisation units you where you want to see aggregated data values.
- It is possible to select either
+ - Select the organisation units you where you want to see aggregated data values.
+ It is possible to select either
- - One or more specific organisation units, organisation unit levels in
- the hierarchy, organisation unit groups, or
+ - One or more specific organisation units, organisation unit levels in
+ the hierarchy, organisation unit groups, or
- - A relative level in the organisation unit hierarchy, with
- respect to the user. By selecting a **User organisation
- unit** the map data will appear differently for users at
- different levels in the organisation unit hierarchy.
+ - A relative level in the organisation unit hierarchy, with
+ respect to the user. By selecting a **User organisation
+ unit** the map data will appear differently for users at
+ different levels in the organisation unit hierarchy.
- - **Use associated geometry**: This dropdown will only show if there
- are any additional geometry available for your organisation units.
- This is typically used to calculate values for facility catchment areas.
-
- - **Building footprints**: Building counts are only available for smaller
- organisation unit areas.
+ - **Use associated geometry**: This dropdown will only show if there
+ are any additional geometry available for your organisation units.
+ This is typically used to calculate values for facility catchment areas.
4. In the **Style** tab
![](resources/images/maps_ee_layer_dialog_STYLE.png)
- - Modify the parameters specific to the layer type.
+ - Modify the parameters specific to the layer type.
- - Adjust the legend range, steps and colors, as desired.
+ - Adjust the legend range, steps and colors, as desired.
- - If you select organisation units having a single point coordinate
- (facilities) you can set a radius buffer to calculate the
- data value within. A radius of 5000 meters will aggregate all
- values available within a 5 km distance from a facility. Buffer
- option is not available if associated geometry is used.
+ - If you select organisation units having a single point coordinate
+ (facilities) you can set a radius buffer to calculate the
+ data value within. A radius of 5000 meters will aggregate all
+ values available within a 5 km distance from a facility. Buffer
+ option is not available if associated geometry is used.
5. Click **Add layer**.
@@ -1332,31 +1341,29 @@ off from the layer card.
The data table displays all the aggregated values for the organisation units selected.
-- clicking on the up/down button will sort the table based on that column;
- toggling between ascending and descending.
-
-- entering text or expressions into the filter fields below the titles
- will apply those filters to the data, and the display will adjust
- according to the filter. The filters are applied as follows:
+- Clicking on the up/down button will sort the table based on that column;
+ toggling between ascending and descending.
-- NAME
+- Entering text or expressions into the filter fields below the titles
+ will apply those filters to the data, and the display will adjust
+ according to the filter. The filters are applied as follows:
- filter by org unit name containing the given text
+ - NAME
-- ID
+ filter by name containing the given text
- filter by event IDs containing the given text
+ - ID
-- TYPE
+ filter by IDs containing the given text
- filter by GIS display types containing the given text
+ - TYPE
-- AGGREGATION VALUES
+ filter by GIS display types containing the given text
- there is one column for each of the aggregation types selected
+ - AGGREGATION VALUES ("Sum" and "Mean" in the example above)
- numeric data values can be filtered by given numbers, and/or ranges,
- for example: 2,\>3&\<8
+ there is one column for each of the aggregation types selected
+ numeric data values can be filtered by given numbers, and/or ranges, for example: 2,\>3&\<8
> **Note**
>
@@ -1366,37 +1373,41 @@ The data table displays all the aggregated values for the organisation units sel
![](resources/images/maps_terrain_imagery.png)
-External map layers are represented as either basemaps or overlays. These must be added to the instance by a system administrator.
+External map layers are represented as either basemaps or overlays.
-- Basemaps
+> **Note**
+>
+> The [**Maps app administrator**](#maps_app_administrator) can add external map layers.
+
+- Basemaps
- These are available in the **basemap** card in the layers panel and
- are selected as any other basemap.
+ These are available in the **basemap** card in the layers panel and
+ are selected as any other basemap.
-- Overlays
+- Overlays
- These are available in the **Add layer** selection. Unlike basemaps,
- overlays can be placed above or below any other overlay layers.
+ These are available in the **Add layer** selection. Unlike basemaps,
+ overlays can be placed above or below any other overlay layers.
Overlay layers are represented by additional layer _cards_ in the layer
panel such as:
Along the top of the overlay card from left to right are:
-- A grab field to allow dragging and re-ordering layers with the mouse
+- A grab field to allow dragging and re-ordering layers with the mouse
-- The title of the external map layer
+- The title of the external map layer
-- An arrow symbol to collapse and expand the overlay card
+- An arrow symbol to collapse and expand the overlay card
In the middle of the card is a legend if the layer has one.
Along the bottom of the overlay card from left to right are:
-- A slider for modifying the layer transparency
+- A slider for modifying the layer transparency
-- A delete (trash can) icon to remove the layer from the current
- thematic map.
+- A delete (trash can) icon to remove the layer from the current
+ thematic map.
### GeoJSON external layers
@@ -1518,13 +1529,13 @@ everyone or a user group. To modify the sharing settings:
3. **Users and groups that currently have access**: For each user or group, choose the
access level. The options are:
- - No access: The public won't have access to the map. This setting is only applicable to All users.
+ - No access: The public won't have access to the map. This setting is only applicable to All users.
- - View only
+ - View only
- - View and edit
+ - View and edit
- - Remove access: Remove the access for groups or individuals.
+ - Remove access: Remove the access for groups or individuals.
4. Click **Close** to close the dialog.
@@ -1600,14 +1611,14 @@ write is visible to those people.
4. Change the access level for the users you want to modify:
- - **View and edit**: Everyone can view and edit the object.
+ - **View and edit**: Everyone can view and edit the object.
- - **View only**: Everyone can view the object.
+ - **View only**: Everyone can view the object.
- - **No access**: The public won't have access to the object. This
- setting is only applicable to All users.
+ - **No access**: The public won't have access to the object. This
+ setting is only applicable to All users.
- - **Remove access**: Remove the access for groups or individuals.
+ - **Remove access**: Remove the access for groups or individuals.
5. Click **Close** when sharing settings are updated.
@@ -1619,24 +1630,24 @@ You can download your map as an image by clicking on the Download button in the
![](resources/images/maps_download.png)
-You will enter a "download mode" where you can adjust the map layout before you
+You will enter a "download mode" where you can adjust the map layout before you
download the image. The left column gives you the following options:
-- **Show map name**: Select if you want to include the map name or not. This option
- is only available if the map is saved. To change the name, exit download mode and
- select _File_ > _Rename_.
-- **Show map description**: Select if you want to include the map description or not.
- This option is only available if a map description was added when the map was saved.
- To change the map description, exit download mode and select _File_ > _Rename_.
-- **Show legend**: Select if you want to include the map legend. If the map includes
- more than one layer, you can select the visibility for each legend.
-- **Show overview map**: Select if you want to include an overview map (often named
- inset map). This option will be disabled if there is not enough room for it in the
- right column.
-- **Show north arrow**: Select to include a north arrow on the map. The default
- position is the lower right corner of the map, but you can change it to another
- corner.
-- Click **Download** to download your map.
+- **Show map name**: Select if you want to include the map name or not. This option
+ is only available if the map is saved. To change the name, exit download mode and
+ select _File_ > _Rename_.
+- **Show map description**: Select if you want to include the map description or not.
+ This option is only available if a map description was added when the map was saved.
+ To change the map description, exit download mode and select _File_ > _Rename_.
+- **Show legend**: Select if you want to include the map legend. If the map includes
+ more than one layer, you can select the visibility for each legend.
+- **Show overview map**: Select if you want to include an overview map (often named
+ inset map). This option will be disabled if there is not enough room for it in the
+ right column.
+- **Show north arrow**: Select to include a north arrow on the map. The default
+ position is the lower right corner of the map, but you can change it to another
+ corner.
+- Click **Download** to download your map.
Resize your browser window to change the map dimensions. You can also reposition
both the main map and the overview map.
@@ -1677,7 +1688,21 @@ sites, facilities, villages or towns on the map.
Right-click a point on the map and select **Show longitude/latitude**.
The values display in a pop-up window.
+## Maps app administrator { #maps_app_administrator }
+
+A **Maps** app administrator can be defined by the system administrator assigning the `F_EXTERNAL_MAP_LAYER_PUBLIC_ADD` authority.
+
+The **Maps** app administrator is able to:
+
+- Select the sources for Google Earth Engine layers available to other users via the Manage available layer sources button.
+
+![](resources/images/maps_admin_managesources_button.png)
+
+- Add new external layer sources via the Maintenance app.
+
+![](resources/images/maps_admin_externallayer.png)
+
## See also
-- [Manage
- legends](https://docs.dhis2.org/master/en/user/html/manage_legend.html)
+- [Manage
+ legends](https://docs.dhis2.org/master/en/user/html/manage_legend.html)
diff --git a/docs/resources/images/maps_admin_externallayer.png b/docs/resources/images/maps_admin_externallayer.png
new file mode 100644
index 000000000..267dfb992
Binary files /dev/null and b/docs/resources/images/maps_admin_externallayer.png differ
diff --git a/docs/resources/images/maps_admin_managesources_button.png b/docs/resources/images/maps_admin_managesources_button.png
new file mode 100644
index 000000000..c92099c9b
Binary files /dev/null and b/docs/resources/images/maps_admin_managesources_button.png differ
diff --git a/i18n/en.pot b/i18n/en.pot
index a9bed7e27..96f68640d 100644
--- a/i18n/en.pot
+++ b/i18n/en.pot
@@ -8,6 +8,9 @@ msgstr ""
"POT-Creation-Date: 2024-07-29T08:57:17.532Z\n"
"PO-Revision-Date: 2024-07-29T08:57:17.534Z\n"
+msgid "2020"
+msgstr "2020"
+
msgid "Untitled map, {{date}}"
msgstr "Untitled map, {{date}}"
@@ -320,6 +323,15 @@ msgstr ""
msgid "Unit"
msgstr "Unit"
+msgid "Spatial resolution"
+msgstr "Spatial resolution"
+
+msgid "Temporal resolution"
+msgstr "Temporal resolution"
+
+msgid "Temporal coverage"
+msgstr "Temporal coverage"
+
msgid "Source"
msgstr "Source"
@@ -347,9 +359,6 @@ msgstr "Max should be greater than min"
msgid "Valid steps are {{minSteps}} to {{maxSteps}}"
msgstr "Valid steps are {{minSteps}} to {{maxSteps}}"
-msgid "Unit: {{ unit }}"
-msgstr "Unit: {{ unit }}"
-
msgid "Min"
msgstr "Min"
@@ -359,6 +368,9 @@ msgstr "Max"
msgid "Steps"
msgstr "Steps"
+msgid "Facility buffer"
+msgstr "Facility buffer"
+
msgid "Org Units"
msgstr "Org Units"
@@ -545,6 +557,19 @@ msgstr "Style by group set"
msgid "Indicator group"
msgstr "Indicator group"
+msgid "Manage available layer sources"
+msgstr "Manage available layer sources"
+
+msgid "Configure available layer sources"
+msgstr "Configure available layer sources"
+
+msgid ""
+"Choose which layer sources are available to add to maps. This selection "
+"applies to all users."
+msgstr ""
+"Choose which layer sources are available to add to maps. This selection "
+"applies to all users."
+
msgid "Collapse"
msgstr "Collapse"
@@ -872,9 +897,6 @@ msgstr "Previous year"
msgid "Next year"
msgstr "Next year"
-msgid "Relative"
-msgstr "Relative"
-
msgid "Period type"
msgstr "Period type"
@@ -977,21 +999,181 @@ msgstr "Bing Aerial"
msgid "Bing Aerial Labels"
msgstr "Bing Aerial Labels"
+msgid "Building footprints"
+msgstr "Building footprints"
+
+msgid ""
+"The outlines of buildings derived from high-resolution satellite imagery. "
+"Only for Sub-Saharan Africa, South and South-East Asia, Latin America and "
+"the Caribbean."
+msgstr ""
+"The outlines of buildings derived from high-resolution satellite imagery. "
+"Only for Sub-Saharan Africa, South and South-East Asia, Latin America and "
+"the Caribbean."
+
+msgid "Building counts are only available for smaller organisation unit areas."
+msgstr "Building counts are only available for smaller organisation unit areas."
+
+msgid ""
+"Select a smaller area or single organization unit to see the count of "
+"buildings."
+msgstr ""
+"Select a smaller area or single organization unit to see the count of "
+"buildings."
+
+msgid "Number of buildings"
+msgstr "Number of buildings"
+
+msgid "0.5 meter"
+msgstr "0.5 meter"
+
+msgid "Single point in time"
+msgstr "Single point in time"
+
+msgid "May 2023"
+msgstr "May 2023"
+
+msgid "Elevation"
+msgstr "Elevation"
+
+msgid "Elevation above sea-level."
+msgstr "Elevation above sea-level."
+
+msgid "meters"
+msgstr "meters"
+
+msgid "~30 meters"
+msgstr "~30 meters"
+
+msgid "Febuary 2000"
+msgstr "Febuary 2000"
+
+msgid "Landcover"
+msgstr "Landcover"
+
+msgid "Distinct landcover types collected from satellites."
+msgstr "Distinct landcover types collected from satellites."
+
+msgid "Evergreen Needleleaf forest"
+msgstr "Evergreen Needleleaf forest"
+
+msgid "Evergreen Broadleaf forest"
+msgstr "Evergreen Broadleaf forest"
+
+msgid "Deciduous Needleleaf forest"
+msgstr "Deciduous Needleleaf forest"
+
+msgid "Deciduous Broadleaf forest"
+msgstr "Deciduous Broadleaf forest"
+
+msgid "Mixed forest"
+msgstr "Mixed forest"
+
+msgid "Closed shrublands"
+msgstr "Closed shrublands"
+
+msgid "Open shrublands"
+msgstr "Open shrublands"
+
+msgid "Woody savannas"
+msgstr "Woody savannas"
+
+msgid "Savannas"
+msgstr "Savannas"
+
+msgid "Grasslands"
+msgstr "Grasslands"
+
+msgid "Permanent wetlands"
+msgstr "Permanent wetlands"
+
+msgid "Croplands"
+msgstr "Croplands"
+
+msgid "Urban and built-up"
+msgstr "Urban and built-up"
+
+msgid "Cropland/Natural vegetation mosaic"
+msgstr "Cropland/Natural vegetation mosaic"
+
+msgid "Snow and ice"
+msgstr "Snow and ice"
+
+msgid "Barren or sparsely vegetated"
+msgstr "Barren or sparsely vegetated"
+
+msgid "Water"
+msgstr "Water"
+
+msgid ""
+"The outlines of buildings derived from high-resolution satellite imagery. "
+"Only for the continent of Africa."
+msgstr ""
+"The outlines of buildings derived from high-resolution satellite imagery. "
+"Only for the continent of Africa."
+
+msgid "Nighttime lights"
+msgstr "Nighttime lights"
+
+msgid "light intensity"
+msgstr "light intensity"
+
+msgid ""
+"Light intensity from cities, towns, and other sites with persistent "
+"lighting, including gas flares."
+msgstr ""
+"Light intensity from cities, towns, and other sites with persistent "
+"lighting, including gas flares."
+
msgid "Population"
msgstr "Population"
-msgid "people per hectare"
-msgstr "people per hectare"
+msgid "people per km²"
+msgstr "people per km²"
msgid "Estimated number of people living in an area."
msgstr "Estimated number of people living in an area."
+msgid "people per hectare"
+msgstr "people per hectare"
+
+msgid "Precipitation"
+msgstr "Precipitation"
+
+msgid "millimeter"
+msgstr "millimeter"
+
+msgid ""
+"Precipitation collected from satellite and weather stations on the ground. "
+"The values are in millimeters within 5 days periods. Updated monthly, "
+"during the 3rd week of the following month."
+msgstr ""
+"Precipitation collected from satellite and weather stations on the ground. "
+"The values are in millimeters within 5 days periods. Updated monthly, "
+"during the 3rd week of the following month."
+
+msgid "Temperature MODIS"
+msgstr "Temperature MODIS"
+
+msgid "°C during daytime"
+msgstr "°C during daytime"
+
+msgid ""
+"Land surface temperatures collected from satellite. Blank spots will appear "
+"in areas with a persistent cloud cover."
+msgstr ""
+"Land surface temperatures collected from satellite. Blank spots will appear "
+"in areas with a persistent cloud cover."
+
msgid "Population age groups"
msgstr "Population age groups"
msgid "Estimated number of people living in an area, grouped by age and gender."
msgstr "Estimated number of people living in an area, grouped by age and gender."
+msgid "~100 meters"
+msgstr "~100 meters"
+
msgid "Male 0 - 1 years"
msgstr "Male 0 - 1 years"
@@ -1100,138 +1282,34 @@ msgstr "Female 75 - 79 years"
msgid "Female 80 years and above"
msgstr "Female 80 years and above"
-msgid "Building footprints"
-msgstr "Building footprints"
-
-msgid "Number of buildings"
-msgstr "Number of buildings"
-
-msgid ""
-"The outlines of buildings derived from high-resolution satellite imagery. "
-"Only for the continent of Africa."
-msgstr ""
-"The outlines of buildings derived from high-resolution satellite imagery. "
-"Only for the continent of Africa."
-
-msgid "Building counts are only available for smaller organisation unit areas."
-msgstr "Building counts are only available for smaller organisation unit areas."
-
-msgid ""
-"Select a smaller area or single organization unit to see the count of "
-"buildings."
-msgstr ""
-"Select a smaller area or single organization unit to see the count of "
-"buildings."
-
-msgid "Elevation"
-msgstr "Elevation"
-
-msgid "meters"
-msgstr "meters"
-
-msgid "Elevation above sea-level."
-msgstr "Elevation above sea-level."
-
-msgid "Precipitation"
-msgstr "Precipitation"
-
-msgid "millimeter"
-msgstr "millimeter"
-
-msgid ""
-"Precipitation collected from satellite and weather stations on the ground. "
-"The values are in millimeters within 5 days periods. Updated monthly, "
-"during the 3rd week of the following month."
-msgstr ""
-"Precipitation collected from satellite and weather stations on the ground. "
-"The values are in millimeters within 5 days periods. Updated monthly, "
-"during the 3rd week of the following month."
-
-msgid "Temperature"
-msgstr "Temperature"
-
-msgid "°C during daytime"
-msgstr "°C during daytime"
+msgid "Precipitation monthly"
+msgstr "Precipitation monthly"
msgid ""
-"Land surface temperatures collected from satellite. Blank spots will appear "
-"in areas with a persistent cloud cover."
+"Accumulated liquid and frozen water, including rain and snow, that falls to "
+"the surface. Combines model data with observations from across the world."
msgstr ""
-"Land surface temperatures collected from satellite. Blank spots will appear "
-"in areas with a persistent cloud cover."
-
-msgid "Landcover"
-msgstr "Landcover"
-
-msgid "Distinct landcover types collected from satellites."
-msgstr "Distinct landcover types collected from satellites."
-
-msgid "Evergreen Needleleaf forest"
-msgstr "Evergreen Needleleaf forest"
-
-msgid "Evergreen Broadleaf forest"
-msgstr "Evergreen Broadleaf forest"
-
-msgid "Deciduous Needleleaf forest"
-msgstr "Deciduous Needleleaf forest"
-
-msgid "Deciduous Broadleaf forest"
-msgstr "Deciduous Broadleaf forest"
-
-msgid "Mixed forest"
-msgstr "Mixed forest"
-
-msgid "Closed shrublands"
-msgstr "Closed shrublands"
-
-msgid "Open shrublands"
-msgstr "Open shrublands"
-
-msgid "Woody savannas"
-msgstr "Woody savannas"
-
-msgid "Savannas"
-msgstr "Savannas"
-
-msgid "Grasslands"
-msgstr "Grasslands"
-
-msgid "Permanent wetlands"
-msgstr "Permanent wetlands"
-
-msgid "Croplands"
-msgstr "Croplands"
-
-msgid "Urban and built-up"
-msgstr "Urban and built-up"
-
-msgid "Cropland/Natural vegetation mosaic"
-msgstr "Cropland/Natural vegetation mosaic"
+"Accumulated liquid and frozen water, including rain and snow, that falls to "
+"the surface. Combines model data with observations from across the world."
-msgid "Snow and ice"
-msgstr "Snow and ice"
-
-msgid "Barren or sparsely vegetated"
-msgstr "Barren or sparsely vegetated"
-
-msgid "Water"
-msgstr "Water"
+msgid "~11 kilometers"
+msgstr "~11 kilometers"
-msgid "people per km²"
-msgstr "people per km²"
+msgid "Monthly"
+msgstr "Monthly"
-msgid "Nighttime lights"
-msgstr "Nighttime lights"
+msgid "Febuary 1950 - One month ago"
+msgstr "Febuary 1950 - One month ago"
-msgid "light intensity"
-msgstr "light intensity"
+msgid "Temperature monthly"
+msgstr "Temperature monthly"
msgid ""
-"Light intensity from cities, towns, and other sites with persistent "
-"lighting, including gas flares."
+"Temperature at 2m above the surface. Combines model data with observations "
+"from across the world."
msgstr ""
-"Light intensity from cities, towns, and other sites with persistent "
-"lighting, including gas flares."
+"Temperature at 2m above the surface. Combines model data with observations "
+"from across the world."
msgid "All"
msgstr "All"
@@ -1266,6 +1344,9 @@ msgstr "Equal counts"
msgid "Symbol"
msgstr "Symbol"
+msgid "Relative"
+msgstr "Relative"
+
msgid "Daily"
msgstr "Daily"
@@ -1287,9 +1368,6 @@ msgstr "Weekly (Start Sunday)"
msgid "Bi-weekly"
msgstr "Bi-weekly"
-msgid "Monthly"
-msgstr "Monthly"
-
msgid "Bi-monthly"
msgstr "Bi-monthly"
diff --git a/package.json b/package.json
index c3962c671..6cbb54eee 100644
--- a/package.json
+++ b/package.json
@@ -41,7 +41,7 @@
"@dhis2/app-runtime": "^3.10.5",
"@dhis2/app-runtime-adapter-d2": "^1.1.0",
"@dhis2/app-service-datastore": "^1.0.0-beta.3",
- "@dhis2/maps-gl": "^3.9.2",
+ "@dhis2/maps-gl": "^4.0.0",
"@krakenjs/post-robot": "^11.0.0",
"@reportportal/agent-js-cypress": "git+https://github.com/dhis2/agent-js-cypress.git#develop",
"@reportportal/agent-js-jest": "^5.0.7",
diff --git a/src/actions/layerEdit.js b/src/actions/layerEdit.js
index 27799293c..b810d7895 100644
--- a/src/actions/layerEdit.js
+++ b/src/actions/layerEdit.js
@@ -179,10 +179,10 @@ export const setPeriodName = (periodName) => ({
})
// Set period type (thematic)
-export const setPeriodType = (periodType, clearPeriod = true) => ({
+export const setPeriodType = (periodType, keepPeriod) => ({
type: types.LAYER_EDIT_PERIOD_TYPE_SET,
periodType,
- clearPeriod,
+ keepPeriod,
})
// Set period (event & thematic)
@@ -234,10 +234,10 @@ export const setOrgUnitMode = (mode) => ({
payload: mode,
})
-// Set layer params (EE)
-export const setParams = (params) => ({
- type: types.LAYER_EDIT_PARAMS_SET,
- payload: params,
+// Set layer style (EE)
+export const setStyle = (payload) => ({
+ type: types.LAYER_EDIT_STYLE_SET,
+ payload,
})
// Set collection filter (EE)
@@ -359,6 +359,12 @@ export const setNoDataColor = (color) => ({
payload: color,
})
+// Set period for EE layer
+export const setEarthEnginePeriod = (payload) => ({
+ type: types.LAYER_EDIT_EARTH_ENGINE_PERIOD_SET,
+ payload,
+})
+
// Set feature style
export const setFeatureStyle = (payload) => ({
type: types.LAYER_EDIT_FEATURE_STYLE_SET,
diff --git a/src/actions/layerSources.js b/src/actions/layerSources.js
new file mode 100644
index 000000000..e3f4355ec
--- /dev/null
+++ b/src/actions/layerSources.js
@@ -0,0 +1,19 @@
+import * as types from '../constants/actionTypes.js'
+
+// Initialize visible layerSources
+export const initLayerSources = (newArray) => ({
+ type: types.LAYER_SOURCES_INIT,
+ payload: newArray,
+})
+
+// Add layerSource
+export const addLayerSource = (id) => ({
+ type: types.LAYER_SOURCE_ADD,
+ payload: id,
+})
+
+// Remove layerSource
+export const removeLayerSource = (id) => ({
+ type: types.LAYER_SOURCE_REMOVE,
+ payload: id,
+})
diff --git a/src/components/app/App.js b/src/components/app/App.js
index 65c12df72..d5b33743c 100644
--- a/src/components/app/App.js
+++ b/src/components/app/App.js
@@ -12,10 +12,12 @@ import DetailsPanel from './DetailsPanel.js'
import ModalContainer from './ModalContainer.js'
import './App.css'
import styles from './styles/App.module.css'
+import { useLoadDataStore } from './useLoadDataStore.js'
import { useLoadMap } from './useLoadMap.js'
const App = () => {
useLoadMap()
+ useLoadDataStore()
const [interpretationsRenderCount, setInterpretationsRenderCount] =
useState(1)
diff --git a/src/components/app/useLoadDataStore.js b/src/components/app/useLoadDataStore.js
new file mode 100644
index 000000000..da30328e3
--- /dev/null
+++ b/src/components/app/useLoadDataStore.js
@@ -0,0 +1,71 @@
+import { useDataEngine } from '@dhis2/app-runtime'
+import { useDispatch } from 'react-redux'
+import { initLayerSources } from '../../actions/layerSources.js'
+import { earthEngineLayersDefaultIds } from '../../constants/earthEngineLayers/index.js'
+import {
+ MAPS_APP_NAMESPACE,
+ MAPS_APP_KEY_MANAGED_LAYER_SOURCES,
+} from '../../constants/settings.js'
+
+export const useLoadDataStore = () => {
+ // Keys: MAPS_APP_KEY_MANAGED_LAYER_SOURCES
+ const resourceLayerSourcesVisibility = `dataStore/${MAPS_APP_NAMESPACE}/${MAPS_APP_KEY_MANAGED_LAYER_SOURCES}`
+ const layerSourceDefaultIds = [...earthEngineLayersDefaultIds]
+ const dispatch = useDispatch()
+ const engine = useDataEngine()
+ engine
+ .query({ dataStore: { resource: 'dataStore' } })
+ .then(({ dataStore }) => {
+ if (!dataStore.includes(MAPS_APP_NAMESPACE)) {
+ // Create namespace/key if missing in datastore
+ engine
+ .mutate({
+ resource: resourceLayerSourcesVisibility,
+ type: 'create',
+ data: layerSourceDefaultIds,
+ })
+ .then(() => {
+ dispatch(initLayerSources(layerSourceDefaultIds))
+ })
+ } else {
+ engine
+ .query({
+ layerSourcesVisibility: {
+ resource: resourceLayerSourcesVisibility,
+ },
+ })
+ .then(({ layerSourcesVisibility }) => {
+ if (!Array.isArray(layerSourcesVisibility)) {
+ // Reset namespace/key if integrity has been broken
+ engine
+ .mutate({
+ resource: resourceLayerSourcesVisibility,
+ type: 'update',
+ data: layerSourceDefaultIds,
+ })
+ .then(() => {
+ dispatch(
+ initLayerSources(layerSourceDefaultIds)
+ )
+ })
+ } else {
+ dispatch(initLayerSources(layerSourcesVisibility))
+ }
+ })
+ .catch(() => {
+ // Create key if missing in namespace
+ engine
+ .mutate({
+ resource: resourceLayerSourcesVisibility,
+ type: 'create',
+ data: layerSourceDefaultIds,
+ })
+ .then(() => {
+ dispatch(
+ initLayerSources(layerSourceDefaultIds)
+ )
+ })
+ })
+ }
+ })
+}
diff --git a/src/components/classification/Classification.js b/src/components/classification/Classification.js
index 1b9031abe..5227c6168 100644
--- a/src/components/classification/Classification.js
+++ b/src/components/classification/Classification.js
@@ -68,7 +68,7 @@ Classification.propTypes = {
setClassification: PropTypes.func.isRequired,
setColorScale: PropTypes.func.isRequired,
classes: PropTypes.number,
- colorScale: PropTypes.string,
+ colorScale: PropTypes.array,
method: PropTypes.number,
}
diff --git a/src/components/core/ColorScaleSelect.js b/src/components/core/ColorScaleSelect.js
index ee3d735ac..7498ce974 100644
--- a/src/components/core/ColorScaleSelect.js
+++ b/src/components/core/ColorScaleSelect.js
@@ -14,12 +14,11 @@ const ColorScaleSelect = ({ palette, width, onChange, className }) => {
const [isOpen, setIsOpen] = useState(false)
const anchorRef = useRef()
- const bins = palette.split(',').length
+ const bins = palette.length
const scale = getColorScale(palette)
const onColorScaleSelect = (scale) => {
- const classes = palette.split(',').length
- onChange(getColorPalette(scale, classes))
+ onChange(getColorPalette(scale, bins))
setIsOpen(false)
}
@@ -61,7 +60,7 @@ const ColorScaleSelect = ({ palette, width, onChange, className }) => {
}
ColorScaleSelect.propTypes = {
- palette: PropTypes.string.isRequired,
+ palette: PropTypes.array.isRequired,
onChange: PropTypes.func.isRequired,
className: PropTypes.string,
width: PropTypes.number,
diff --git a/src/components/core/NumberField.js b/src/components/core/NumberField.js
index 1c44e87be..986592bf8 100644
--- a/src/components/core/NumberField.js
+++ b/src/components/core/NumberField.js
@@ -27,7 +27,7 @@ const NumberField = ({
label={label}
value={Number.isNaN(value) ? '' : String(value)}
disabled={disabled}
- onChange={({ value }) => onChange(value)}
+ onChange={({ value }) => onChange(Number(value))}
helpText={helpText}
inputWidth={inputWidth}
/>
diff --git a/src/components/datatable/useTableData.js b/src/components/datatable/useTableData.js
index 7cca5b6f8..47a0c99ad 100644
--- a/src/components/datatable/useTableData.js
+++ b/src/components/datatable/useTableData.js
@@ -148,9 +148,9 @@ const getEarthEngineHeaders = ({ aggregationType, legend, data }) => {
let customFields = []
if (hasClasses(aggregationType) && items) {
- customFields = items.map(({ id, name }) => ({
+ customFields = items.map(({ value, name }) => ({
name,
- dataKey: String(id),
+ dataKey: String(value),
roundFn: getRoundToPrecisionFn(2),
type: TYPE_NUMBER,
}))
diff --git a/src/components/edit/earthEngine/EarthEngineDialog.js b/src/components/edit/earthEngine/EarthEngineDialog.js
index a435d042c..a67af3dee 100644
--- a/src/components/edit/earthEngine/EarthEngineDialog.js
+++ b/src/components/edit/earthEngine/EarthEngineDialog.js
@@ -1,24 +1,18 @@
import i18n from '@dhis2/d2-i18n'
import { NoticeBox } from '@dhis2/ui'
import PropTypes from 'prop-types'
-import React, { useState, useEffect, useCallback } from 'react'
+import React, { useState, useEffect } from 'react'
import { connect } from 'react-redux'
import {
setOrgUnits,
- setFilter,
+ setEarthEnginePeriod,
setBufferRadius,
} from '../../../actions/layerEdit.js'
-import { getEarthEngineLayer } from '../../../constants/earthEngine.js'
import {
DEFAULT_ORG_UNIT_LEVEL,
EE_BUFFER,
NONE,
} from '../../../constants/layers.js'
-import {
- getPeriodFromFilter,
- getPeriods,
- defaultFilters,
-} from '../../../util/earthEngine.js'
import { Help, Tab, Tabs } from '../../core/index.js'
import OrgUnitSelect from '../../orgunits/OrgUnitSelect.js'
import styles from '../styles/LayerDialog.module.css'
@@ -29,84 +23,43 @@ import StyleTab from './StyleTab.js'
const EarthEngineDialog = (props) => {
const [tab, setTab] = useState('data')
- const [periods, setPeriods] = useState()
const [error, setError] = useState()
const {
- layerId,
- datasetId,
- band,
- rows,
- params,
- filter,
+ aggregations,
areaRadius,
+ band,
+ bands,
+ datasetId,
+ defaultAggregations,
+ description,
+ filters,
+ maskOperator,
+ notice,
+ orgUnitField,
orgUnits,
+ rows,
setOrgUnits,
- orgUnitField,
- setFilter,
+ source,
+ sourceUrl,
+ style,
+ period,
+ periodType,
setBufferRadius,
+ setEarthEnginePeriod,
+ unit,
+ resolution,
validateLayer,
onLayerValidation,
} = props
- const dataset = getEarthEngineLayer(layerId)
-
- const {
- description,
- notice,
- periodType,
- bands,
- filters = defaultFilters,
- unit,
- source,
- sourceUrl,
- aggregations,
- } = dataset
-
- const period = getPeriodFromFilter(filter)
-
- const setPeriod = useCallback(
- (period) => setFilter(period ? filters(period) : null),
- [filters, setFilter]
- )
-
const noBandSelected = Array.isArray(bands) && (!band || !band.length)
+ const hasAggregations = !!(aggregations || defaultAggregations)
const hasMultipleAggregations = !aggregations || aggregations.length > 1
const hasOrgUnitField = !!orgUnitField && orgUnitField !== NONE
- // Load all available periods
- useEffect(() => {
- let isCancelled = false
-
- if (periodType) {
- getPeriods(datasetId, periodType)
- .then((periods) => {
- if (!isCancelled) {
- setPeriods(periods)
- }
- })
- .catch((error) =>
- setError({
- type: 'engine',
- message: error.message,
- })
- )
- }
-
- return () => (isCancelled = true)
- }, [datasetId, periodType])
-
- // Set most recent period by default
- useEffect(() => {
- if (filter === undefined) {
- if (Array.isArray(periods) && periods.length) {
- setPeriod(periods[0])
- }
- }
- }, [periods, filter, setPeriod])
-
// Set default org unit level
useEffect(() => {
if (!rows) {
@@ -205,12 +158,30 @@ const EarthEngineDialog = (props) => {
}
/>
)}
-