Map Dropdown Menus
Configure a map with drop down menus
Advanced, requires some coding
Here is an example of map drop downs from Congo Mines clicking on Mining Permits opens the menu and the user can choose to turn the layer on or off, or click to view more information about the layer.
To configure map drop downs, edit the map and then open to the Map Settings section at bottom of left column, then click the Advanced Settings button
Location of Map Settings section in the map maker
Click to open Advanced Settings code
The Advanced Settings code editor will open
To add drop down menus to the map you will need to add a categories array to the JSON code and then add an object entry for each drown down (category) menu you want to add.
Each menu has:
    a name, specified as language codes (English is required, you can add as many additional languages as you need)
    a list of layers specified using the layer ID. The layer ID can found in the URL for the a layer
To get started you can copy the following into the code editor:
1
{
2
"categories": [
3
{
4
"name": {
5
"en": "My Dropdown"
6
},
7
"layers": [
8
]
9
}
10
]
11
}
Copied!
Here is a full example for the map above:
1
{
2
"categories": [
3
{
4
"name": {
5
"en": "Mines and infrastructure",
6
"fr": "Mines et infrastructures"
7
},
8
"layers": [
9
95,
10
96,
11
97,
12
106
13
]
14
},
15
{
16
"name": {
17
"en": "Mining Permits",
18
"fr": "Droits miniers"
19
},
20
"layers": [
21
107,
22
108
23
]
24
},
25
{
26
"name": {
27
"en": "Concessions",
28
"fr": "Concessions"
29
},
30
"layers": [
31
76,
32
100
33
]
34
},
35
{
36
"name": {
37
"en": "ETDs",
38
"fr": "ETDs"
39
},
40
"layers": [
41
86,
42
87,
43
90,
44
92
45
]
46
}
47
]
48
}
Copied!
Finding the layer ID for a layer
When you are done, click save on the Advanced Settings code editor, and then save your map.
Last modified 3yr ago
Copy link