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
VectorAnalysisMap (ZonesMap) zonesMapGeojson
attribute must be in the WGS84 (EPSG:4326) projection and follow the GeoJson specification.
The expected geojson
type is FeatureCollection
with MultiPolygon
.
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
orIRRIGATION
. 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.
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>.
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 arezones
andthumbnail
.The attribute
hexColorCodes
describes the hex color codes to set.
The number of colors in hexColorCodes
must represent the exact number of existing zones.
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> looks like.
Last updated