インタラクティブなマップ レイヤー でデータを更新します
インタラクティブマップ レイヤーでは、次のように機能を更新できます。
- 認可トークンを取得します。
- API ベースの URL を取得するには、 api-lookup API を使用します。
interactive
API を使用して、インタラクティブなマップ レイヤーレコードを更新します。
認可トークン を取得します
HTTP 要求の認可トークン を取得します。 詳細については、『 Identity & Access Management Guide 』を参照してください。
API ベースの URL を取得します
API ルックアップサービスを使用 interactive
して、削除する ID を持つインタラクティブなマップ レイヤーを含むカタログの API の API エンドポイントを取得します。
手順については 、『 API Lookup 開発者ガイド』を参照してください。
データを更新します
インタラクティブマップ レイヤーでフィーチャーを作成、更新、または削除するには、次のリクエストを使用できます
POST /<Base path for the interactive API from the API Lookup Service>/layers/<Layer ID>/features
ボディを使用します
{
"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"
}
}
]
}
レスポンス
{
"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"
}
}
]
}
レイヤー内のフィーチャーを部分的に更新します
このリクエストには、追加、更新、または削除する機能のプロパティのみが含まれています。
- プロパティが最新バージョンのフィーチャーにまだ存在しない場合は、追加されます。
- プロパティに最新バージョンのフィーチャーの別の値が含まれている場合、その値はリクエストの値に更新されます
- リクエストのプロパティ値が null の場合、プロパティはフィーチャオブジェクトから削除されます
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>
パッチリクエストには、次のようなボディが必要です。
{
"type": "Feature",
"id": "string",
"geometry":
{
"type": "string"
},
"properties":
{
"@ns:com:here:xyz":
{}
},
"bbox":
[
-100.1,
-1.1,
100.1,
1.1
]
}
レスポンス
{
"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"
}
}
]
}
注
バージョン対応のインタラクティブマップ レイヤー を使用している場合、任意のコンテンツに対する更新によってレイヤーのバージョン番号が自動的に増分されます。