|
1 | 1 | # arcgis-js-api |
2 | 2 |
|
| 3 | +A minified, unbuilt version of the [ArcGIS Maps SDK for JavaScript](https://developers.arcgis.com/javascript/) AMD modules. |
| 4 | + |
| 5 | +| :warning: Repository Archive Notice | |
| 6 | +| :-----------------------------------------| |
| 7 | +| This repository will be archived at 4.26 (Early 2023) and then removed in a future release. All versions will continue to be available for install on NPM: https://www.npmjs.com/package/arcgis-js-api | |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | +For an overview of the SDK, visit the [developer documentation](https://developers.arcgis.com/javascript/latest/key-features/) site. |
| 12 | + |
| 13 | +You can install these modules with [npm](https://npmjs.org/) and then use them directly in a framework such as [React](https://reactjs.org/), [Vue.js](https://vuejs.org) or [Angular](https://cli.angular.io/). Or, you can also create your own custom builds with [Webpack](https://webpackjs.org) or [rollup.js](https://rollupjs.org/guide/en/). |
| 14 | + |
| 15 | +The SDK includes [TypeScript](https://www.typescriptlang.org/) type definitions. The `.d.ts` declaration files are bundled with the install. |
| 16 | + |
| 17 | +Sample applications can be found at [github.com/jsapi-resources/](https://github.com/Esri/jsapi-resources/tree/master/esm-samples). |
| 18 | + |
| 19 | +## Get started |
| 20 | + |
| 21 | +Install the modules into your project: |
| 22 | + |
| 23 | +``` |
| 24 | +npm install @arcgis/core |
| 25 | +``` |
| 26 | + |
| 27 | +## Configure CSS |
| 28 | + |
| 29 | +Set the CSS to the same version as the installed SDK modules. You can verify the installed SDK version by running `npm list @arcgis/core`. If you are working with local assets skip to the *Manage assets locally* section. |
| 30 | + |
| 31 | +The first example shows importing CSS for production SDK version `4.25.0`: |
| 32 | + |
| 33 | +*index.css* |
| 34 | + |
| 35 | +```css |
| 36 | +@import "https://js.arcgis.com/4.25/@arcgis/core/assets/esri/themes/light/main.css"; |
| 37 | +``` |
| 38 | + |
| 39 | +The second example shows importing CSS for `next` SDK version `4.19.0-next.20210324`: |
| 40 | + |
| 41 | +*index.css* |
| 42 | + |
| 43 | +```css |
| 44 | +@import "https://cdn.jsdelivr.net/npm/@arcgis/core@4.25.0-next.20220921/assets/esri/themes/light/main.css"; |
| 45 | +``` |
| 46 | + |
| 47 | +## Working with assets |
| 48 | + |
| 49 | +The default configuration for local builds is for the SDK to automatically pull assets from a CDN at runtime, there is no need for additional configuration. The assets include styles, images, web workers, wasm and localization files. Production versions of the SDK's assets are hosted on the ArcGIS CDN, and `next` builds (e.g. `4.25.0-next.20220921`) use assets hosted on the jsDelivr CDN. |
| 50 | + |
| 51 | +### Manage assets locally |
| 52 | + |
| 53 | +If you need to manage the assets locally, copy them into your project from `/node_modules/@arcgis/core/assets`, and then set `config.assetsPath` to insure requests for assets are resolved correctly. A simple way to accomplish this is to configure an npm script that runs during your build process. For example, use npm to install `ncp` and configure a script in package.json to copy the folder. |
| 54 | + |
| 55 | +**Important:** Every time you upgrade the SDK, be sure to recopy the new version of the assets to your project. This ensures the assets stay synchronized. |
| 56 | + |
| 57 | +Here’s a React example: |
| 58 | +======= |
3 | 59 | A minified, unbuilt version of the [ArcGIS API for JavaScript](https://developers.arcgis.com/javascript/) AMD modules. |
4 | 60 |
|
5 | 61 | If you are starting a new project, we recommend using [@arcgis/core](https://developers.arcgis.com/javascript/latest/es-modules/) ES modules. |
@@ -42,18 +98,18 @@ Or, add a reference to the declaration file in the `include` of your `tsconfig.j |
42 | 98 |
|
43 | 99 | ## Requirements |
44 | 100 |
|
45 | | -Use of the ArcGIS API for JavaScript is subject to the terms described in the product-specific [terms of use.](https://www.esri.com/en-us/legal/terms/product-specific-scope-of-use) Learn more about licensing [here](https://developers.arcgis.com/javascript/latest/licensing/). |
| 101 | +Use of the ArcGIS Maps SDK for JavaScript is subject to the terms described in the product-specific [terms of use.](https://www.esri.com/en-us/legal/terms/product-specific-scope-of-use) Learn more about licensing [here](https://developers.arcgis.com/javascript/latest/licensing/). |
46 | 102 |
|
47 | 103 |
|
48 | 104 | ## Resources |
49 | 105 |
|
50 | | -* [ArcGIS for JavaScript](https://developers.arcgis.com/javascript/) |
51 | | -* [http://blogs.esri.com/esri/arcgis/tag/javascript/](https://blogs.esri.com/esri/arcgis/tag/javascript/) |
52 | | -* [twitter@ArcGISDevs](https://twitter.com/ArcGISDevs) |
| 106 | +- [ArcGIS Maps SDK JavaScript](https://developers.arcgis.com/javascript/) |
| 107 | +- [http://blogs.esri.com/esri/arcgis/tag/javascript/](https://blogs.esri.com/esri/arcgis/tag/javascript/) |
| 108 | +- [twitter@ArcGISJSAPI](https://twitter.com/ArcGISJSAPI) |
53 | 109 |
|
54 | 110 | ## Issues |
55 | 111 |
|
56 | | -- General questions about using these modules or the ArcGIS API for JavaScript? See the [Esri developer community](https://community.esri.com/t5/arcgis-api-for-javascript/ct-p/arcgis-api-for-javascript). |
| 112 | +- General questions about using these modules or the ArcGIS Maps SDK for JavaScript? See the [Esri developer community](https://community.esri.com/t5/arcgis-api-for-javascript/ct-p/arcgis-api-for-javascript). |
57 | 113 | - [Technical support](https://support.esri.com/). |
58 | 114 |
|
59 | 115 | ## Licensing |
|
0 commit comments