You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 6, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+13-46Lines changed: 13 additions & 46 deletions
Original file line number
Diff line number
Diff line change
@@ -1,29 +1,26 @@
1
1
# angular-cli-esri-map
2
2
3
-
This branch contains a simple but complete application that uses the ArcGIS API for JavaScript 4.x, which is an enterprise geospatial API, along with webpack and Angular CLI. It uses arcgis-webpack-plugin to help load ArcGIS JavaScript API modules.
4
-
5
-
If you would like to create your own Angular CLI project from scratch and incorporate these components, [create a new Angular CLI project](https://cli.angular.io/) and copy the `src/app/` directory of this repo to your new project. You will need to install `arcgis-webpack-plugin`, `@angular-builders/custom-webpack` and `@types/arcgis-js-api` manually, and then you'll need to configure the css in `angular.json` (see the file in this branch for an example).
3
+
This branch contains a simple but complete application that uses the ArcGIS API for JavaScript, an enterprise geospatial API, and Angular CLI. It uses esri-loader, a small library that helps load ArcGIS JavaScript API modules (v3.x or v4.x) in non-Dojo applications.
6
4
7
5
To use arcgis-webpack-plugin instead of esri-loader to load the ArcGIS API for JavaScript modules, check out the [`@arcgis-webpack-angular`](https://github.com/Esri/angular-cli-esri-map/tree/arcgis-webpack-angular) branch of this repo.
8
6
9
-
If you don't want to use webpack then use `esri-loader` instead by checking out the [`master`](https://github.com/Esri/angular-cli-esri-map) branch of this repo. `esri-loader` lets you lazy load ArcGIS JavaScript API modules without webpack.
7
+
If you would like to create your own Angular CLI project from scratch and incorporate these components, [create a new Angular CLI project](https://cli.angular.io/) and copy the `src/app/` directory of this repo to your new project. You will need to install `esri-loader` and `@types/arcgis-js-api` manually.
10
8
11
9
## Dependencies
12
10
13
11
**Note: This repo is only tested to work with the most current version of the following dependencies.**
@@ -38,44 +35,10 @@ If you don't want to use webpack then use `esri-loader` instead by checking out
38
35
### Run the application locally
39
36
40
37
```bash
41
-
git checkout arcgis-webpack-angular
42
-
ng serve --open
43
-
```
44
-
45
-
The app will automatically reload if you change any of the source files. You can shut down the development server with a `Control C` in the terminal any time you wish.
46
-
47
-
### Working with the View's CSS
48
-
49
-
For best performance, we recommend using the local copy of the css for the ArcGIS API for JavaScript. You can configure this in `angular.json` and choose from any of the [themes](https://developers.arcgis.com/javascript/latest/guide/styling/):
When working with secure ArcGIS services there is additional code that you'll need to get it to work with webpack. If you encounter an error similar to this: `DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope'`, then you'll need to follow the instructions outlined here: https://github.com/Esri/arcgis-webpack-plugin#usage. Add that code to your component and it should resolve the problem. This branch of the repo includes an example that uses workers.
61
-
62
-
IMPORTANT: be sure to configure the `DEFAULT_WORKER_URL` property to use the same `Major.minor` version used by the `arcgis-webpack-plugin`. You can confirm that version by looking in the header of `node_modules/@arcgis/webpack-plugin/extras/dojo/dojo.js` and you'll see information similar to this:
63
-
64
-
```js
65
-
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
66
-
// See https://js.arcgis.com/4.16/esri/copyright.txt for details.
67
-
//>>built
68
-
```
69
-
70
-
And, you need to match this version using this pattern within your component:
71
-
72
-
```js
73
-
// Refer to esri-map.component.ts file for a complete version of this code
If you are still having problems then open an issue in this repo.
41
+
Navigate to http://localhost:4200 to see the app running. The app will automatically reload if you change any of the source files. You can shut down the development server with a `Control C` any time you wish.
79
42
80
43
### Code scaffolding
81
44
@@ -85,13 +48,17 @@ Run `ng generate component component-name` to generate a new component. You can
85
48
86
49
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
87
50
51
+
### Running unit tests
52
+
53
+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
54
+
88
55
## Contributing
89
56
90
57
Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](https://github.com/esri/contributing).
91
58
92
59
## Licensing
93
60
94
-
Copyright 2020 Esri
61
+
Copyright 2019 Esri
95
62
96
63
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
0 commit comments