87. Mutation: Save Custom VectorAnalysisMap (ZonesMap)

Below are details on how to save a Custom ZonesMap with a custom color schema.

1. Save ZonesMap geometries

triangle-exclamation

Mutation saveVectorAnalysisMap overview:

  • The attribute fieldUuid is a linkage to the existing Field.

  • The attribute name describes the name of the ZonesMap.

  • The attribute type is an enum value representing the operation type. It can be any value from GENERAL , SPRAYING, SEEDING, FERTILIZING or IRRIGATION. It is optional.

  • The key attribute with all details including rates for VRA is zonesMapGeojson as an escaped JSON string.

    • Zone number is mentioned in properties >> zone.

    • Rates are going to be incorporated into properties >> attributes.

The properties attribute is a JSON object that is extended with zone, rates, ratesHeaders, ratesPrices and ratesUnits details. An explanation of how to assign rates is HERE.

 {
    \"zone\":1,
    \"attributes\":{
        \"rates\":[100],
        \"ratesHeaders\":[\"Product1\"],
        \"ratesPrices\":[0],
        \"ratesUnits\":[\"KG_HA\"]
    }
}

Sample mutation without defined rates:

Default representation without assigned color schema looks like. The user ZonesMap >> geoMaps >> url is similar to https://api.geopard.tech/geo/map/reflect?TRANSPARENT=true&VIEWPARAMS=uuid:4a3929a5-c166-41d7-b547-da1511a9fa1d&LAYERS=custom_zone_map_view&SRS=EPSG:3857&STYLES=default_zonesmap&HEIGHT=64&BBOX=1160638.4354309493,6959157.496681602,1160983.0667152018,6959632.459385279&geopardApiKey=<your_geopard_api_key>arrow-up-right.

2. Assign custom color schema

Mutation setGeoMaps overview:

  • The attribute fieldUuid is a linkage to the existing Field.

  • The attribute vectorAnalysisMapUuid is a linkage to the just saved ZonesMap (VectorAnalysisMap) from the first step.

  • The attribute shortName describes the style to amend. Options for ZonesMap are zones and thumbnail.

  • The attribute hexColorCodes describes the hex color codes to set.

triangle-exclamation

An explanation of how to save custom colors is HERE and how to apply custom colors on the fly is HERE.

Sample mutation:

As a result, the visual representation from the ZonesMap >> geoMaps >> url similar to https://api.geopard.tech/geo/map/reflect?TRANSPARENT=true&VIEWPARAMS=uuid:9799e2eb-06d2-4a42-8f47-38655abf11e1&LAYERS=custom_zone_map_view&SRS=EPSG:3857&STYLES=default_zonesmap&HEIGHT=64&BBOX=1160638.4354309493,6959157.496681602,1160983.0667152018,6959632.459385279&env=c1:#ffffbf;c2:#66bd63;c3:#f46d43&geopardApiKey=<your_geopard_api_key>arrow-up-right looks like.

Last updated

Was this helpful?