/** * Arcade expression added to the pop-up. */ export type PopupExpressionInfo = { /** * The Arcade expression. */ expression: string; /** * Unique identifier for the expression. */ name: string; /** * Return type of the Arcade expression, can be a number or string. */ returnType: 'number' | 'string'; /** * Title of the expression. */ title: string; }; export type PopupFieldInfo = { /** * A string containing the field alias. This can be overridden by the web map author. Not applicable to Arcade expressions as title is used instead. This property is deprecated when used with popupInfo.fieldInfos. */ label: string; /** * A string containing the field name as defined by the service. */ fieldName: string; /** * A Boolean determining whether the field is visible in the popup window. */ visible: boolean; /** * A string determining what type of input box editors see when editing the field. Applies only to string fields. Not applicable to Arcade expressions. */ stringFieldOption: 'richtext' | 'textarea' | 'textbox'; /** * Used in a 1:many or many:many relationship to compute the statistics on the field to show in the popup. */ statisticType: 'avg' | 'count' | 'max' | 'min' | 'sum' | 'stddev' | 'var'; }; /** * Defines an image or a chart to be displayed in a popup window. * @see https://developers.arcgis.com/web-map-specification/objects/mediaInfo/ */ export type PopupMediaInfo = { /** * A string providing the alternate text for the media. */ altText?: string; /** * A string caption describing the media. */ caption?: string; /** * Refresh interval of the layer in minutes. Non-zero value indicates automatic layer refresh at the specified interval. * Value of 0 indicates auto refresh is not enabled. If the property does not exist, it's equivalent to having a value of 0. * Only applicable when type is set to image. */ refreshInterval?: number; /** * A string title for the media. */ title?: string; /** * Type of media to display. */ type: 'image' | 'piechart' | 'barchart' | 'columnchart' | 'linechart'; /** * The value object contains information for popup windows about how images should be retrieved or charts constructed. * @see https://developers.arcgis.com/web-map-specification/objects/value/ */ value: { /** * Used with charts. An optional array of colors where each color sequentially corresponds to a field in the fields property. */ colors?: number[][]; /** * Used with charts. An array of strings, with each string containing the name of a field to display in the chart. */ fields?: string[]; /** * Used with images. A string containing a URL to be launched in a browser when a user clicks the image. */ linkURL?: string; /** * Used with charts. An optional string containing the name of a field. The values of all fields in the chart will be normalized (divided) by the value of this field. */ normalizeField?: string; /** * Used with images. A string containing the URL to the image. */ sourceURL?: string; /** * String value indicating the tooltip for a chart specified from another field. */ tooltipField?: string; }; }; /** * Configures attachments in popup elements. * @see https://developers.arcgis.com/web-map-specification/objects/popupElement_attachments/ */ export type PopupElementAttachments = { /** * The type of popup element. Valid value of this property is `attachments` */ type: 'attachments'; /** * An optional string value indicating what the element represents. */ title?: string; /** * An optional string value describing the element in detail. */ description?: string; /** * An array of strings used to identify attachment(s). When attachments are displayed, this property is used to query attachments using an exact match on the keywords provided. */ attachmentKeywords?: string[]; /** * An array of strings representing MIME types. When attachments are displayed, this property is used to query attachments based on MIME type. * Valid values: application, audio, image, model, text, and video. */ attachmentTypes?: string[]; /** * This property applies to elements of type attachments. A string value indicating how to display the attachment. * If list is specified, attachments show as links. If preview is specified, attachments expand to the width of the pop-up. * The default auto setting allows applications to choose the most suitable default experience. */ displayType?: 'list' | 'auto' | 'preview'; /** * Array of orderByField objects indicating the display order for the attachments, and whether they should be sorted in ascending 'asc' or descending 'desc' order. */ orderByFields?: { field: string; order: 'asc' | 'desc'; }[]; }; /** * A pop-up element defined by an arcade expression. * * @see https://developers.arcgis.com/web-map-specification/objects/popupElement_expression/ */ export type PopupElementExpression = { type: 'expression'; /** * An Arcade expression that defines the pop-up element content. * @see https://developers.arcgis.com/web-map-specification/objects/popupElementExpressionInfo/ */ expressionInfo: { /** * The Arcade expression. */ expression: string; /** * Return type of the Arcade expression, the expected return is always dictionary. * Valid value of this property dictionary */ returnType: 'dictionary'; /** * Title of the expression. */ title?: string; }; }; /** * A pop-up element that displays field/value pairs in a table format. * @see https://developers.arcgis.com/web-map-specification/objects/popupElement_fields/ */ export type PopupElementFields = { /** * Specifies the type of element. Valid value of this property fields */ type: 'fields'; /** * An optional string value indicating what the element represents. */ title?: string; /** * An optional string value describing the element in detail. */ description?: string; /** * It is an array of fieldInfo objects representing a field/value pair displayed as a table within the popupElement. */ fieldInfos?: PopupFieldInfo[]; }; /** * Configures media in popup elements. * @see https://developers.arcgis.com/web-map-specification/objects/popupElement_media/ */ export type PopupElementMedia = { /** * Valid value of this property media */ type: 'media'; /** * An optional string value indicating what the element represents. */ title?: string; /** * An optional string value describing the element in detail. */ description?: string; /** * An array of mediaInfo objects representing an image or chart for display. * If no mediaInfos property is provided, the popupElement will display whatever is specified in the popupInfo.mediaInfos property. */ mediaInfos: PopupMediaInfo[]; }; /** * Configures text in popup elements. * @see https://developers.arcgis.com/web-map-specification/objects/popupElement_text/ */ export type PopupElementText = { /** * The type of popup element. Valid value of this property is `text` */ type: 'text'; /** * String value indicating the text to be displayed within the popupElement. * If no text property is provided, the popupElement will display whatever is set in the popupInfo.description property. */ text: string; }; /** * Configures relationships in popup elements. * * @see https://developers.arcgis.com/web-map-specification/objects/popupElement_relationship/ */ export type PopupElementRelationship = { /** * The type of popup element. Valid value of this property is `relationship` */ type: 'relationship'; /** * An optional string value indicating what the element represents. */ title?: string; /** * An optional string value describing the element in detail. */ description?: string; /** * A string containing the identifier of the relationship as defined in the service layer's relationshipDefinitions property. */ relationshipId: string; /** * An integer that indicates the maximum number of records to display. */ displayCount?: number; /** * A string that defines how the related records should be displayed. * Valid value of this property list */ displayType?: 'list'; /** * Array of orderByField objects indicating the display order for the related records, and whether they should be sorted in ascending 'asc' or descending 'desc' order. */ orderByFields?: { field: string; order: 'asc' | 'desc'; }[]; }; /** * Configures utility network associations in popup elements. * https://developers.arcgis.com/web-map-specification/objects/popupElement_utilityNetworkAssociations/ */ export type PopupElementUtilityNetworkAssociations = { /** * String value indicating which type of element to use. * Valid value of this property utilityNetworkAssociations */ type: 'utilityNetworkAssociations'; /** * An optional string value indicating what the element represents. */ title?: string; /** * An optional string value describing the element in detail. */ description?: string; /** * An integer that indicates the maximum number of features to display per layer */ displayCount?: number; /** * array of objects that define the type of associations to display in the pop-up. */ associationTypes?: { /** * The type of associations to display in the pop-up. */ type: 'attachment' | 'connectivity' | 'container' | 'structural' | 'content'; /** * The id of the asset group to filter utility network assocations */ associatedAssetGroup: number; /** * The id of the asset type to filter utility network assocations */ associatedAssetType: number; /** * The id of the source to filter utility network assocations */ associatedNetworkSourceId: number; }[]; }; /** * Defines the look and feel of popup windows when a user clicks or queries a feature. * * @see https://developers.arcgis.com/web-map-specification/objects/popupInfo/ */ export type PopupInfo = { /** * A string that appears at the top of the popup window as a title. */ title?: string; /** * A string that appears in the body of the popup window as a description. * A basic subset of HTML may also be used to enrich the text. The supported HTML for ArcGIS Online can be seen in the Supported HTML page (https://doc.arcgis.com/en/arcgis-online/reference/supported-html.htm). */ description?: string; /** * List of Arcade expressions added to the pop-up. */ expressionInfos?: PopupExpressionInfo[]; /** * Array of fieldInfo information properties. This information is provided by the service layer definition. * When the description uses name/value pairs, the order of the array is how the fields display in the editable Map Viewer popup and the resulting popup. */ fieldInfos?: PopupFieldInfo[]; /** * Array of various mediaInfo to display. Can be of type image, piechart, barchart, columnchart, or linechart. * The order given is the order in which is displays. */ mediaInfo?: PopupMediaInfo[]; /** * Popup elements allow users to author popups, using multiple elements such as field lists, rich text (HTML), media (charts and images), and attachments and also control the order in which they appear. * Elements can also be used to allow navigating relationships, or can also be defined using Arcade to support dynamic configurations. * * @see https://developers.arcgis.com/web-map-specification/objects/popupElement/ */ popupElements?: PopupElementAttachments[] | PopupElementExpression[] | PopupElementFields[] | PopupElementMedia[] | PopupElementRelationship[] | PopupElementText[] | PopupElementUtilityNetworkAssociations[]; /** * Indicates whether attachments will be loaded for feature layers that have attachments. */ showAttachments?: boolean; /** * Indicates whether popup will display information about when and who last edited the feature. * Applicable only to layers that have been configured to keep track of such information. */ showLastEditInfo?: boolean; /** * Additional options that can be defined for the popup layer. */ layerOptions?: { /** * Indicates whether or not only the topmost raster should be displayed. */ returnTopmostRaster?: boolean; /** * Indicates whether or not the NoData records should be displayed. */ showNoDataRecords?: boolean; }; }; /** * Options for reducing the number of features in the view by aggregating them to clusters or bins. * This is a visualization-only feature intended solely for reducing the visual complexity of many overlapping features to a few aggregate features that communicate patterns of density. * @see https://developers.arcgis.com/web-map-specification/objects/featureReduction/ */ export type FeatureReduction = { /** * Type of feature reduction. */ type: 'cluster' | 'bin'; /** * Indicates whether to disable viewing popups defined for the clusters. */ disablePopup?: boolean; /** * Defines the popup used to describe aggregate data in the selected bin. */ popupInfo?: PopupInfo; }; /** * Object representing the data of an individual Feature Layer in a Feature Layer item in ArcGIS Online. * * @see https://developers.arcgis.com/web-map-specification/objects/featureLayer/ */ export type FeatureLayerData = { /** * Unique identifier of the feature layer within the feature service. */ id: number; /** * A user-friendly string title for the layer that can be used in a table of contents. */ title: string; /** * The degree of transparency applied to the layer on the client side, where 0 is full transparency and 1 is no transparency. */ opacity?: number; /** * Boolean property determining whether the layer is initially visible in the web map. */ visibility?: boolean; /** * Labels will display if this property is set to true and the layer also has a labelingInfo property associated with it. This property can get stored in the web map config and in the item/data. */ showLabels?: boolean; /** * Refresh interval of the layer in minutes. Non-zero value indicates automatic layer refresh at the specified interval. Value of 0 indicates auto refresh is not enabled. */ refreshInterval?: number; /** * A popupInfo object defining the content of popup window when you click a feature on the map. */ popupInfo?: PopupInfo; /** * Indicates whether popups are disabled for the layer. */ disablePopup?: boolean; /** * A layerDefinition object defining the attribute schema and drawing information for the layer. */ layerDefinition?: { /** * An object defining how to aggregate dense data to clusters or bins. * This is a visualization-only feature intended solely for reducing the * visual complexity of many overlapping features to a few aggregate * features that communicate patterns of density. * This is not intended to be used for analytical purposes. */ featureReduction?: FeatureReduction; [key: string]: any; }; }; /** * Object representing the data of a Feature Layer item in ArcGIS Online. */ export type FeatureLayerItemData = { layers: FeatureLayerData[]; tables: FeatureLayerData[]; }; /** * Object representing the data of an Imagery Service Layer item in ArcGIS Online. * * @see https://developers.arcgis.com/web-map-specification/objects/imageServiceLayer/ */ export type ImageryLayerItemData = { id: string; /** * String indicating the layer type. Valid value of this property ArcGISImageServiceLayer */ layerType: 'ArcGISImageServiceLayer'; /** * The degree of transparency applied to the layer on the client side, where 0 is full transparency and 1 is no transparency. */ opacity?: number; /** * Boolean property determining whether the layer is initially visible in the web map. */ visibility?: boolean; /** * Refresh interval of the layer in minutes. Non-zero value indicates automatic layer refresh at the specified interval. Value of 0 indicates auto refresh is not enabled. */ refreshInterval?: number; /** * The algorithm used for interpolation. Valid values: RSP_BilinearInterpolation RSP_CubicConvolution RSP_Majority RSP_NearestNeighbor */ interpolation?: 'RSP_BilinearInterpolation' | 'RSP_CubicConvolution' | 'RSP_Majority' | 'RSP_NearestNeighbor'; /** * URL of the imagery service. */ url: string; /** * A user-friendly string title for the layer that can be used in a table of contents. */ title: string; /** * A popupInfo object defining the content of popup window when you click a feature on the map. */ popupInfo?: PopupInfo; /** * Boolean property indicating whether to ignore popups defined by the service item. */ disablePopup?: boolean; }; /** * Represents the data of a Map Service Layer item in ArcGIS Online. * * @see https://developers.arcgis.com/web-map-specification/objects/mapServiceLayer/ */ export type MapServiceLayerItemData = { /** * A unique identifying string for the layer. */ id: string; /** * URL of the imagery service. */ url: string; /** * A user-friendly string title for the layer that can be used in a table of contents. */ title: string; /** * The degree of transparency applied to the layer on the client side, where 0 is full transparency and 1 is no transparency. */ opacity?: number; /** * Boolean property determining whether the layer is initially visible in the web map. */ visibility?: boolean; /** * Refresh interval of the layer in minutes. Non-zero value indicates automatic layer refresh at the specified interval. Value of 0 indicates auto refresh is not enabled. */ refreshInterval?: number; /** * String indicating the layer type. Valid value of this property ArcGISMapServiceLayer */ layerType: 'ArcGISMapServiceLayer'; /** * An array of layer objects defining the styling, geometry, and attribute information for the features. */ layers: { /** * The layer id, as a numeric value. */ id: number; /** * The name of the layer as defined by the service. */ name?: string; /** * Indicates whether to allow a client to ignore the popups defined on the layer. The popupInfo object could be saved in the map or item. */ disablePopup?: boolean; /** * A popupInfo object defining the popup window content for the layer. */ popupInfo?: PopupInfo; }[]; }; /** * Type representing an individual layer within a Map Service Layer item. */ export type MapServiceLayerData = MapServiceLayerItemData['layers'][number]; /** * Represents the different types of layers that can be included in a web map. * * @see https://developers.arcgis.com/web-map-specification/objects/operationalLayers/ */ export type WebmapOperationalLayerType = 'ArcGISFeatureLayer' | 'GeoJSON' | 'GroupLayer' | 'ArcGISImageServiceLayer' | 'ArcGISImageServiceVectorLayer' | 'ArcGISMapServiceLayer' | 'MediaLayer' | 'ArcGISTiledImageServiceLayer' | 'ArcGISTiledMapServiceLayer' | 'VectorTileLayer' | 'WebTiledLayer' | 'WMS' | 'WFS'; /** * Represents the different types of basemap layers that can be included in a web map. * * @see https://developers.arcgis.com/web-map-specification/objects/baseMapLayer/ */ export type WebmapBaseMapLayerType = 'ArcGISImageServiceLayer' | 'ArcGISImageServiceVectorLayer' | 'ArcGISTiledMapServiceLayer' | 'OpenStreetMap' | 'ArcGISTiledImageServiceLayer' | 'ArcGISTiledMapServiceLayer' | 'VectorTileLayer' | 'WebTiledLayer' | 'WMS' | 'BingMapsAerial' | 'BingMapsHybrid' | 'BingMapsRoad'; /** * Represents an operational layer in a web map. * * @see https://developers.arcgis.com/web-map-specification/objects/operationalLayers/ */ export type WebmapOperationalLayer = { /** * Unique string identifier for the layer within the web map. */ id: string; /** * Type of the operational layer. */ layerType: WebmapOperationalLayerType; /** * URL of the layer's service. */ url?: string; /** * Indicates whether the layer is visible in the web map. */ visibility?: boolean; /** * Opacity of the layer in the web map, ranging from 0 (fully transparent) to 1 (fully opaque). */ opacity?: number; /** * Title of the layer in the web map. */ title?: string; /** * Item ID of the layer's source item in ArcGIS Online or Enterprise. */ itemId?: string; /** * URL to the layer's style information. */ styleUrl?: string; /** * Layer definition object containing additional properties and settings for the layer. */ layerDefinition?: { /** * An object defining how to aggregate dense data to clusters or bins. * This is a visualization-only feature intended solely for reducing the * visual complexity of many overlapping features to a few aggregate * features that communicate patterns of density. * This is not intended to be used for analytical purposes. */ featureReduction?: FeatureReduction; [key: string]: any; }; /** * A popupInfo object defining the content of popup window when you click a feature/pixel on the map. */ popupInfo?: PopupInfo; /** * Indicates whether to allow a client to ignore popups defined by the service item. */ disablePopup?: boolean; /** * For GroupLayer, an array of nested operational layers contained within the group. */ layers: WebmapOperationalLayer[]; }; /** * Represents a basemap layer in a web map. * * @see https://developers.arcgis.com/web-map-specification/objects/baseMapLayer/ */ export type WebmapBaseMapLayer = { /** * Unique string identifier for the basemap layer within the web map. */ id: string; /** * Type of the basemap layer. */ layerType?: WebmapBaseMapLayerType; /** * URL of the basemap layer's service. */ url?: string; /** * Indicates whether the basemap layer is visible in the web map. */ visibility?: boolean; /** * Opacity of the basemap layer in the web map, ranging from 0 (fully transparent) to 1 (fully opaque). */ opacity?: number; /** * Title of the basemap layer in the web map. */ title?: string; /** * Item ID of the basemap layer's source item in ArcGIS Online or Enterprise. */ itemId?: string; /** * URL to the basemap layer's style information. */ styleUrl?: string; }; /** * Represents the web map data structure in JSON format. * * The web map data lists the basemap, operational layers, and bookmarks to be used in the web map. It also contains information about popup windows and layer styling overrides to be used in the web map. * * @see https://developers.arcgis.com/web-map-specification/objects/webmap/ */ export type WebmapData = { /** * Operational layers contain your business data. They are used to make thematic maps. * * @see https://developers.arcgis.com/web-map-specification/objects/operationalLayers/ */ operationalLayers: WebmapOperationalLayer[]; /** * basemap of the web map * @see https://developers.arcgis.com/web-map-specification/objects/baseMap/ */ baseMap: { /** * An array of baseMapLayer objects defining the basemaps used in the web map. */ baseMapLayers: WebmapBaseMapLayer[]; /** * Required string title for the basemap that can be used in a table of contents. It takes the title of the first baseMapLayer in the array. */ title?: string; }; }; /** * Layer data by item ID. The key is the item ID and the value is the item data returned from the REST API. * Note that not all layers in the webmap will have an associated item, so this object may contain fewer entries than the total number of layers in the webmap. */ export type WebmapLayerDataByItemId = { [itemId: string]: any; };