A few things need to be set properly for the grid to appear. The grids work similarly to admin regions in mWater where the color of the grid section is calculated on the basis of the GPS of data belonging within that grid section. For a grid to understand how many communities are inside it, it needs to know the GPS location of each of those communities.
Therefore you must select the appropriate Data Source which must have GPS location data contained within it. Sites have a geolocation as a rule, but not all Surveys, Issues or custom data sources do. You also need to set values for the the Location and Color By Data fields, as well as set minimum and maximum bounds for the color gradation before the grid will show.
Here are the options you can adjust in the order you see them on the page:
Hex and Square tiles
At the top of the layer configuration options you can choose whether to draw the map grid as a set of even-sided hexagons or just as squares.
Grid size - Pixels or meters
You can choose between two different ways of defining size: Either as pixels or as meters. By selecting pixels, you define the size of the grid unit to always be the same amount of pixels no matter the zoom level. Therefore, the closer you zoom, the more detailed the layer will become. The grid hexes or squares will always look the same size on the screen.
If you instead select meters, the grid size will map to the real world and stay the same independent of the zoom level. Therefore from a distant zoom level you will see more grid units, and when you zoom in they will take up more of the screen.
Pixel size
Pixel size: The map gets more detailed as you zoom in
Meter size
Meter size: The tiles are always mapped to the same real-world size
Select the appriopriate location question. This is the field that informs which location data should count towards the map grid
Location and Color by Data
In the Location field, select the geolocation field from the data source which should inform the calculation of the map grid.
For example, if I want to create a layer of hexes which colors each hex according to the range of communities that fall within it, I would simply select the GPS Location question under the Location branch of the data source. I would not want to select the location of a related entity or survey in this case. This means that the decision of whether or not the community counts towards the total belonging to a hex is based on that GPS.
In the Color by Data field, select the dimension you want to aggregate. The simplest option for the example of communities is the number of communities. This will make each hex tile be assigned a color depending on how many community sites fall under it. Note that you can equally well choose another site, such as the population of communities, the average patients in a hospital, or the energy production of a solar panel.
Select the dimension of data you want to aggregate for each tile in Color by Data
The last step before the map grid will show is to set the bounds for each color. This can be done automatically when you set the minimum and maximum bounds, or you can set each interval yourself.
If I set the min to 0 and max to 100, split into 5 bins and leave the defaults of include < 0 and include > 100 on, then I will get 8 levels of colors. The first one will include everything below the minimum boundary, then I will get my 5 bins. Next, there is a bin for all the values that go beyond my maximum. And finally, there is a color for when there is no data in the map grid tile. These can all be individually adjusted, but we recommend using a color scheme which you can change by selecting Change color scheme.
Set the minimum and maximum bounds for the different tile colours
By selecting Custom Ranges you can also set each range individually. Note that a value range includes the lowest element but excludes the highest element. This means that the values 0, 1 and 19.9 all belong in the range 0 - 20. But the value 20 belongs in the range 20 - 40.
Once you have set min and max, or assigned custom ranges, the grid will appear.
Additional options
Next, you can optionally adjust:
- The Fill Opacity or transparency of the layer colours
- The Border Style to either have or not have a line
- The data Filters which work similarly to all other map layers in filtering the dataset you want to look at down to your parameters
- The minimum and maximum zoom levels for users
- The overall Opacity to adjust the borders as well as the colours