ESM
import { getAssetPath, setAssetPath } from "@arcgis/map-components/index.js";Functions
| Name | Return Type | Object |
|---|---|---|
| | ||
| |
getAssetPath
Function
Get a resolved path from where an asset can be loaded.
- Signature
-
getAssetPath (suffix: string): string
setAssetPath
Function
Used to manually set the base path where package assets (like localization and icons) can be found.
By default, the package assets are loaded from
https://js.arcgis.com/<version>/<simplified-package-name>/. We are hosting
our assets on a CDN (Content Delivery Network) to ensure fast and reliable
access. It is CORS-enabled, so you can load the assets from any domain. This
is the recommended way to load the assets and avoid bundling them with your
application.
However, if you need to host the assets locally, you can copy them manually
as part of your build process and use setAssetPath to customize where the
browser will load the assets from.
- Signature
-
setAssetPath (path: URL | string): void