GeoPard Tutorials
Ask or search…
K

39. Mutation: Set custom color schemas to selected "GeoMaps"

Set custom color schemas to data layers: "ZonesMaps", "SoilDatasets".
Support for other data layers ("YieldDataset", "TopographyMaps", "SatelliteImages") is coming.
Update all attributes of the "GeoMap":
1
mutation UpdateGeoMaps {
2
setGeoMaps(input: {
3
geoMaps: [{
4
fieldUuid: "<placeholder_of_field_uuid>",
5
soilDatasetUuid: "<placeholder_of_soildataset_uuid>",
6
shortName: "<origin_geomap_short_name>",
7
classes: [
8
11.288999557495117,
9
31.641000747680664,
10
42.30500030517578,
11
56.132999420166016,
12
105.81999969482422
13
],
14
description: "<some_text_about_geomap>",
15
fullName: "<geomap_full_name>",
16
hexColorCodes: [
17
"#ca0020",
18
"#f4a582",
19
"#f7f7f7",
20
"#92c5de",
21
"#0571b0"
22
]
23
}, {
24
fieldUuid: "<placeholder_of_field_uuid>",
25
vectorAnalysisMapUuid: "<placeholder_of_vectoranalysismap_uuid>",
26
shortName: "<origin_geomap_short_name>",
27
classes: [
28
11.788000106811523,
29
26.854999542236328,
30
33.84000015258789,
31
41.20100021362305,
32
50.124000549316406,
33
63.90299987792969,
34
86.70500183105469,
35
105.81999969482422
36
],
37
description: "<some_text_about_geomap>",
38
fullName: "<geomap_full_name>",
39
hexColorCodes: [
40
"#b2182b",
41
"#ef8a62",
42
"#fddbc7",
43
"#f7f7f7",
44
"#d1e5f0",
45
"#67a9cf",
46
"#2166ac"
47
]
48
}]
49
}) {
50
shortName
51
fullName
52
description
53
classes
54
hexColorCodes
55
url
56
}
57
}
Update only color schemas of the "GeoMap":
1
mutation UpdateGeoMaps {
2
setGeoMaps(input: {
3
geoMaps: [{
4
fieldUuid: "<placeholder_of_field_uuid>",
5
soilDatasetUuid: "<placeholder_of_soildataset_uuid>",
6
shortName: "<origin_geomap_short_name>",
7
classes: [
8
-6.5,
9
100,
10
162.60000610351562,
11
245.8000030517578,
12
493.29998779296875
13
],
14
hexColorCodes: [
15
"#ca0020",
16
"#f4a582",
17
"#f7f7f7",
18
"#92c5de",
19
"#0571b0"
20
]
21
}, {
22
fieldUuid: "<placeholder_of_field_uuid>",
23
vectorAnalysisMapUuid: "<placeholder_of_vectoranalysismap_uuid>",
24
shortName: "<origin_geomap_short_name>",
25
hexColorCodes: [
26
"#b2182b",
27
"#ef8a62",
28
"#fddbc7",
29
"#f7f7f7",
30
"#d1e5f0",
31
"#67a9cf",
32
"#2166ac"
33
]
34
}]
35
}) {
36
shortName
37
fullName
38
description
39
classes
40
hexColorCodes
41
url
42
}
43
}
IMPORTANT points to learn how to use the mutation:
  1. 1.
    Attributes fieldUuid, soilDatasetUuid/vectorAnalysisMapUuid, and shortName are mandatory to identify the correct "GeoMap" to amend. All these three attributes together reflect the uniqueness of "GeoMap".
  2. 2.
    Either soilDatasetUuid or vectorAnalysisMapUuid attribute must be used per single "GeoMap" input.
  3. 3.
    Value of shortName must be the same as the origin in the "GeoMap". It is not editable.
  4. 4.
    Attributes fullName, description, hexColorCodes are editable for "ZonesMaps" and can be amended. The changes are not applied if the attribute is not mentioned.
  5. 5.
    Attributes fullName, description, classes, hexColorCodes are editable for "SoilDatasets" and can be amended. The changes are not applied if the attribute is not mentioned.
  6. 6.
    Arrays classes and hexColorCodes must have exactly the same length as the origin in "GeoMap".
  7. 7.
    The length of "GeoMaps" arrays in the request and the response must be the same. If not, some "GeoMaps" were not edited successfully.