Zum Hauptinhalt gehen

Kommentare

2 Kommentare

  • Sebastian Mariendal Kristensen

    you can allready do this.

    In the viewer json file at the rightclickmenu module you can make a batch run of two commands in one.
    {
    "text" : "Draw a cirkel by radius",
    "description": "Draws a cirkel by radius",
    "batch": [
    { "command" : "PanToPoint",
    "commandParameter" : "{{context}}"
    },
    {
    "command" : "RunWorkflowById",
    "commandParameter" : "{Basis-CirkelFromPoint}"
    }
    ]

    }

    Ind the workflow you listen for the extent changed event and then get the extent and take the mappoint from this.

    Then you have the point the user right clicked :-)

    0
  • Permanently deleted user
    Great suggestion Sebastion,

    I didn't think to batch the commands together, rather I passed the geometry of {{context}} into an argument named 'inArgs' (which is of type MapPoint) for the workflow 'zoomToPoint':
                      {
                      "text": "Zoom to neighborhood level",
                      "description": "",
                      "command": "RunWorkflowWithArguments",
                      "commandParameter": {
                        "workflowId": "zoomToPoint",
                        "inArgs": "{{context}}"
                      },
    Then, I ran the pan to point command using inArgs as the geometry and zoom to scale of 1128.

    This is beneficial if someone needs to run a query or something within the workflow but with the batch, as you describe, I can just do the following without a call to workflow:
                     {
                      "text": "Zoom to neighborhood level",
                      "description": "",
                      "batch":[
                          {
                            "command": "PanToPoint",
                            "commandParameter":"{{context}}"
                          },
                          {
                            "command":"ZoomToScale",
                            "commandParameter":1128
                          }
                      },

    Thanks


    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.