format ArcGIS Online Portal Item by adding extra properties to it (e.g. thumbnailUrl, itemIconUrl, agolItemUrl and etc).
formatItem(options:FormatItemOptions) : AgolItem
import {
getItem
} from "@esri/arcgis-rest-portal";
import {
IItem
} from "@esri/arcgis-rest-types";
import {
formatItem,
AgolItem
} from '@vannizhang/arcgis-rest-helper';
getItem("ae7")
.then((item:IItem)=>{
const formattedItem:AgolItem = formatItem({
item
})
});
Parameter | Type | Default | Note |
---|---|---|---|
options | FormatItemOptions |
Property | Type | Note |
---|---|---|
item | IItem | |
agolHost optional |
Text | default value is "https://www.arcgis.com" |
thumbnailWidth optional |
number | default value is 200 |
AgolItem
Formatted ArcGIS Online Portal Item.
import {
AgolItem
} from '@vannizhang/arcgis-rest-helper';
Properties
Property | Type |
---|---|
created | number |
id | string |
modified | number |
numViews | number |
owner | string |
size | number |
tags | string[] |
title | string |
type | string |
protected | boolean |
categories | string[] |
culture | string |
description | string |
documentation | string |
extent | number[] |
properties | any |
snippet | string |
spatialReference | ISpatialReference |
typeKeywords | string[] |
url | string |
isSubscriberContent | boolean |
isPremiumContent | boolean |
isAuthoritative | boolean |
thumbnailUrl | string |
agolItemUrl | string |
itemIconUrl | string |
typeDisplayName | string |