Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@leslie8469/arcgis
Advanced tools
ArcGIS API for JavaScript: A complete 2D and 3D mapping and data visualization API
Readme
A minified, unbuilt version of the ArcGIS API for JavaScript ES modules.
You can install these modules via npm and then use them directly in a framework such as React, Vue.js or Angular. Or, you can also create your own custom builds with Webpack or rollup.js.
Sample applications can be found at github.com/jsapi-resources/.
Install the modules into your project:
npm install @arcgis/core
Set the CSS to the same version as the installed API modules. You can verify the installed API version by running npm list @arcgis/core
. If you are working with local assets skip to the Manage assets locally section.
The first example shows importing CSS for production API version 4.19.0
:
index.css
@import "https://js.arcgis.com/4.19/@arcgis/core/assets/esri/themes/light/main.css";
The second example shows importing CSS for next
API version 4.19.0-next.20210324
:
index.css
@import "https://cdn.jsdelivr.net/npm/@arcgis/core@4.19.0-next.20210324/assets/esri/themes/light/main.css";
For most local builds, the API's assets are automatically pulled from a CDN at runtime and there is no need for additional configuration. The assets include styles, images, web workers, wasm and localization files. Production versions of the API use the ArcGIS CDN, and next
builds (e.g. 4.19.0-next.20210324
) use jsDelivr, similar to the CSS example above.
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.
Here’s a React example:
package.json
{
"scripts": {
"start": "ncp ./node_modules/@arcgis/core/assets ./public/assets && react-scripts start",
"build": "ncp ./node_modules/@arcgis/core/assets ./public/assets && react-scripts build",
}
}
App.js
import esriConfig from "@arcgis/core/config.js";
esriConfig.assetsPath = "./assets";
index.css
@import "@arcgis/core/assets/esri/themes/light/main.css";
For Angular, copy the asset files by configuring the architect/build/options/assets
section of angular.json
, for example:
angular.json
{
"assets": [
{
"glob": "**/*",
"input": "node_modules/@arcgis/core/assets",
"output": "/assets/"
}
]
}
app.component.ts
import esriConfig from "@arcgis/core/config.js";
esriConfig.assetsPath = "./assets";
app.component.css
@import "@arcgis/core/assets/esri/themes/light/main.css";
For other installations, consider using this npm script as a starting point:
package.json
{
"script": {
"copy": "cp -R ./node_modules/@arcgis/core/assets ./dist/assets"
}
}
Windows users can use xcopy
or ncp
for any platform.
Use of the ArcGIS API for JavaScript is subject to the terms described in the product-specific terms of use. Learn more about licensing here.
COPYRIGHT © 2021 Esri
All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
This material is licensed for use under the Esri Master License Agreement (MLA), and is bound by the terms of that agreement. You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
For additional information, contact: Environmental Systems Research Institute, Inc. Attn: Contracts and Legal Services Department 380 New York Street Redlands, California, USA 92373 USA
email: contracts@esri.com
FAQs
ArcGIS API for JavaScript: A complete 2D and 3D mapping and data visualization API
The npm package @leslie8469/arcgis receives a total of 0 weekly downloads. As such, @leslie8469/arcgis popularity was classified as not popular.
We found that @leslie8469/arcgis demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.