Update data in an interactive map layer

You can update the features in an interactive map layer as follows:

  1. Obtain an authorization token.
  2. Use the api-lookup API to get API base URLs.
  3. Use the interactive API to update interactive map layer records.

Obtain an authorization token

Obtain an authorization token for your HTTP requests. For more information, see the Identity & Access Management Guide.

Get API base URLs

Use the API Lookup service to get the API endpoints for the interactive API of the catalog containing the interactive map layer with ids you want to delete.

For instructions, see the API Lookup Developer's Guide.

Update data

To create, update or delete features in an interactive map layer you can use the following request

POST /<Base path for the interactive API from the API Lookup Service>/layers/<Layer ID>/features

with the body

{
    "type": "FeatureCollection",
    "features":
    [
      {
        "type": "Feature",
        "geometry":
          {
            "type": "Point",
            "coordinates":
            [
              -2.960847,
              53.430828
            ]
          },
          "properties":
          {
            "@ns:com:here:xyz":
            {
            },
            "name": "Anfield",
            "amenity": "Football Stadium",
            "capacity": 54074,
            "popupContent": "Home of Liverpool Football Club"
          }
        }
    ]
}

Response

{
    "type": "FeatureCollection",
    "features":
    [
      {
        "type": "Feature",
        "id": "BfiimUxHjj",
        "geometry":
        {
          "type": "Point",
          "coordinates":
          [
            -2.960847,
            53.430828
          ]
        },
        "properties":
        {
          "name": "Anfield",
          "@ns:com:here:xyz":
          {
            "createdAt": 1517504700726,
            "updatedAt": 1517504700726
          },
          "amenity": "Football Stadium",
          "capacity": 54074,
          "popupContent": "Home of Liverpool Football Club"
        }
      }
  ]
}

Partially update features in a layer

This request contains only the feature properties you want to add, update or delete.

  • If the property does not yet exist in the latest version of the feature it is added.
  • If the property has another value of the latest version of the feature it is updated to the value in the request
  • If the property value is null in the request, the property is deleted from the feature object
PATCH /<Base path for the interactive API from the API Lookup Service>/layers/<Layer ID>/features?id=<Feature ID 1>,<Feature ID 2>,<Feature ID 3>

A PATCH request needs a body looking something like this:

{
    "type": "Feature",
    "id": "string",
    "geometry":
    {
      "type": "string"
    },
    "properties":
    {
       "@ns:com:here:xyz":
       {}
    },
    "bbox":
    [
      -100.1,
      -1.1,
      100.1,
      1.1
    ]
}

Response

{
  "type": "FeatureCollection",
  "features":
  [
    {
      "type": "Feature",
      "id": "BfiimUxHjj",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -2.960847,
          53.430828
        ]
      },
      "properties": {
        "name": "Anfield",
        "@ns:com:here:xyz": {
          "createdAt": 1517504700726,
          "updatedAt": 1517504700726
        },
        "amenity": "Football Stadium",
        "capacity": 54074,
        "popupContent": "Home of Liverpool Football Club"
      }
    }
  ]
}

Note

When using a version enabled interactive map layer, updates to any content will automatically increment the version number of a layer.

results matching ""

    No results matching ""