How to add custom graphics to export map api
Hi there,
I'm looking for a way to add custom graphics to an export map from Workflow 5 to Reporting 5. One of the recent GeoCortex videos on youtube (https://www.youtube.com/watch?v=yOmWAsHbhp0&index=46&list=PLTjPVjeiNQigDLcr7yi_xrzzmFfzFwOoH) shows exactly what I want, but does not explain the last bit that I'm actually interested in: how does one define a custom graphic in the export map api?
Thanks in advance!
-
Hi Yannick,
The workflow that got demoed at the end of the video is available here:
https://latitudegeo.maps.arcgis.com/home/item.html?id=372b530f934c4e24900ba62f55039e94
The part you're interested in seems like it's mostly in the DisplayForm named "Run Report", at the end of the workflow. The text element has a load event with a subworkflow that handles the export request and generating the report. The exact request that's sent for the export is:
={ "f":"pjson", "outputFormat": "PNG", "bbox": $mapExtent2.extent.xmin + "," + $mapExtent2.extent.ymin + "," + $mapExtent2.extent.xmax + "," + $mapExtent2.extent.ymax, "layers": $exportLayers.result, "layerDefinitions": {"3":{"7":$layerDefinition.result}}, "graphics":$masterMarkup.result, "imageWidth": "900", "imageHeight": "500", "scale": 18056 }$masterMarkup.result comes from a Get Feature Geometry activity, so it's just a geometry object
0 -
Thanks Amanda!
I still had to search quite a bit in the example workflow, but I found what I was looking for. The $masterMarkup.result, thus the "graphics" is created as follows:
={"layers": [{ "elements": [{ "geometry":$getFeatureGeometry.geometry, "symbol": { "color": [255, 73, 73,100], "outline": {"color":[255, 73, 73, 255], "width": 2, "type": "esriSLS", "style": "esriSLSSolid"}, "type": "esriSFS", "style": "esriSFSSolid" } }] }] }Put this in a 'create value', call it 'masterMarkup', and you're there ;)
0 -
I had a similar question and the person doing that video demo (Patrick Fingler of Latitude) also pointed me to this post titled 'Parameters example for using the REST export map
' https://support.geocortex.com/essentialsGSCForum?sub-nav=forum&main-nav=essentials&#!/feedtype=SINGLE_QUESTION_DETAIL&criteria=ALLQUESTIONS&id=90660000000CkAPAA0 for more info on this. You do need to first log in with a Geocortex support account to see that link.
0
Please sign in to leave a comment.
Comments
3 comments