Types
import type { ScreenPoint, LogInterceptor } from "@arcgis/core/core/types.js";

Type definitions

ScreenPoint

Type definition
Since
ArcGIS Maps SDK for JavaScript 4.11

Point on the screen (x, y) in the DOM/CSS coordinate space. In this space, the origin is at the top/left corner and device pixel ratio scale is not taken into account (i.e. 1px in this space may make up multiple physical pixels).

x

Property
Type
number
Since
ArcGIS Maps SDK for JavaScript 5.0

The x coordinate in pixels.

y

Property
Type
number
Since
ArcGIS Maps SDK for JavaScript 5.0

The y coordinate in pixels.

Example
const sourcePoint = { x: 80, y: 1732 }

LogInterceptor

Type definition
Since
ArcGIS Maps SDK for JavaScript 5.0

A custom log interceptor function.

In 5.x, the module parameter uses esri.-style module identifiers (for example esri.layers.FeatureLayer) even when using the ESM build.

In 6.0, this will change to @arcgis/core/-style module identifiers (for example @arcgis/core/layers/FeatureLayer).

Parameters

ParameterTypeDescriptionRequired
level
"error" | "warn" | "info"

The level of the message.

module

The module from which the log message originated.

args
any[]

Arguments of any type to be logged.

Returns
boolean

Return true to indicate the log message has been handled and should no longer be processed (neither by other interceptors nor by the default handler which logs messages to the console).

Example
// Only show error messages, not warnings nor info messages
esriConfig.log.level = "error";
esriConfig.log.interceptors.push(function(level, module, ...args) {
// Send all messages to a REST end-point
request(loggingUrl, {
method: "post",
body: {
level: level,
module: module,
details: JSON.stringify(args)
}
});
// Return false so that the default log handler still writes log messages to the console
return false;
});