How to pass dynamic parameters when requesting a data API

Updated at:

You can pass dynamic parameters when requesting a data API to enable filter interaction between a Tab List widget and the choropleth layer of a basic flat map.

Preview动态传参

Procedure

  1. Log on to the DataV console.

  2. Select a visualization application and click Edit to open the canvas editor.

  3. Add a Tab List widget and a Basic Flat Map widget to the canvas.

  4. Click the Tab List widget, select the Data panel, and modify the static data.

    [
      {
        "id": 1,
        "content": "610000"
      },
      {
        "id": 2,
        "content": "330000"
      },
      {
        "id": 3,
        "content": "320000"
      }
    ]
  5. Click the choropleth layer of the Basic Flat Map widget. On the Data panel, for the Geo-border GeoJSON API, set Data Source to API and enter the URL.image

    https://geo.datav.aliyun.com/areas_v3/bound/geojson?code=:code
  6. In the Layers panel, select all widgets, right-click, and select Export to Blueprint Editor.

  7. Connect the widgets.image

  8. Configure the processing method for the serial data processing node.

    return { code: data.content };
  9. Click the image icon in the upper-right corner of the page to preview the results.动态传参