AddView (POST)

This action route is responsible for saving a map view.

Parameters

Name Type Description Required?
viewName String Name for the new view **true**
viewDescription String Description for the new view false
viewData JSON View state (uses handler.getCurrentState() if not given) false
viewIsPublic Boolean If true, view is public (defaults to false) false
pubDomain String Publication domain false

Response

Success

{
  "id": "<id of the new view>",
  "oldId": -1,
  "height": "?",
  "pubDomain": "<publication domain>",
  "description": "<description of the new view>",
  "width": "?",
  "name": "<name of the new view>",
  "states": "<array of states>",
  "uuid": "<user id>",
  "lang": "<language>"
}

Error

{
  "error" : "message"
}

Examples

Example query for Paikkatietoikkuna

http://www.paikkatietoikkuna.fi/web/fi/kartta?p_p_id=Portti2Map_WAR_portti2mapportlet&p_p_lifecycle=2&action_route=AddView

With POST params:

{
  "currentViewId": 1
  "viewData": {
    "mapfull": {
      "state": {
        "north":6674344,
        "east":384200,
        "zoom":0,
        "srs":"EPSG:3067",
        "selectedLayers": [
          {"id":"base_35","opacity":100},
          {"id":276,"opacity":80}
        ]
      }
    },
    "toolbar": {
      "state": {
        "selected": {
          "id":"select",
          "group":"basictools"
        }
      }
    },
    "search": {
      "state": {}
    },
    "layerselector2": {
      "state": {
        "tab":"Aiheittain",
        "filter":"sotka",
        "groups":[]
      }
    },
    "maplegend": {
      "state":{}
    },
    "metadataflyout": {

    },
    "printout": {
      "state":{}
    },
    "statsgrid": {
      "state": {
        "indicators": [
          {"indicator":7,"year":"2012","gender":"total"}
        ],
        "currentColumn":"indicator72012total",
        "methodId":"1",
        "numberOfClasses":5,
        "manualBreaksInput":""
      }
    }
  },
  "viewName": "foo",
  "viewDescription": ""
}

Response:

{
  "id": 957,
  "oldId": -1,
  "height": 0,
  "pubDomain": "",
  "description": null,
  "width": 0,
  "name": null,
  "states": [],
  "uuid": null,
  "lang": "fi"
}

Last modified: Fri Mar 15 2024 14:11:33 GMT+0200 (Eastern European Standard Time)