Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
angular-esri-map
Advanced tools
A collection of directives to help you use Esri maps and services in your Angular applications
A collection of directives to help you use Esri maps and services in your AngularJS v1.x applications.
**NOTE: ** AngularJS goes into Long Term Support on July 1, 2018. For more information go here.
These directives can be used as-is if your mapping needs are simple, or as reference examples of the patterns that you can use to write your own directives that use the ArcGIS API for JavaScript. Read more...
This project is no longer being actively maintained. It will not be updated or tested with the latest versions of the ArcGIS API for JavaScript and AngularJS v1.x. Ideas for new features or pull requests are not likely to be reviewed or merged.
No guarantee of future support is provided, but we will try to respond to new issues about bugs. These should include a link to an existing application or live demo (e.g. Plunkr, JS Bin, JsFiddle) where the bug can be verified, otherwise it is unlikely that we'll be able to help.
You can find up to date information on using the ArcGIS API for JavaScript in an Angular (2+) application at this Angular resources page.
Here are examples and guides showing how you can use this module to bring Esri maps into your own AngularJS v1.x applications.
To use these directives in your own AngularJS v1.x application, first install the module as a dependency using any of the following methods.
<!-- load angular-esri-map from CDN -->
<script src="https://unpkg.com/angular-esri-map@2"></script>
# OR install via bower
bower install angular-esri-map
# OR install via npm
npm install angular-esri-map
Alternatively, you can clone or download this repo and copy the desired module file (angular-esri-map.js
or angular-esri-map.min.js
) into your application.
Once you've added the module to your application, you can refer the sample code below to use the <esri-scene-view>
directive. If you have downloaded or installed locally, point to the location of the module file in your environment (instead of CDN) and load the page in a browser.
<!DOCTYPE html>
<html ng-app="esri-map-example">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<title>AngularJS Esri Quick Start</title>
<link rel="stylesheet" href="https://js.arcgis.com/4.8/esri/css/main.css">
<style type="text/css">
html, body, .esri-view {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
</head>
<body ng-controller="MapController as vm">
<esri-scene-view map="vm.map" view-options="{scale: 50000000, center: [-101.17, 21.78]}">
</esri-scene-view>
<!-- load Esri JSAPI -->
<script src="https://js.arcgis.com/4.8/"></script>
<!-- load AngularJS -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.5/angular.js"></script>
<!-- load angular-esri-map -->
<script src="https://unpkg.com/angular-esri-map@2"></script>
<script>
angular.module('esri-map-example', ['esri.map'])
.controller('MapController', function(esriLoader) {
var self = this;
esriLoader.require(['esri/Map'], function(Map) {
self.map = new Map({
basemap: 'streets'
});
});
});
</script>
</body>
</html>
See the documentation for examples and guides of how to use the other directives and services.
If your application only shows a map under certain conditions you may want to lazy load the ArcGIS API for JavaScript. You can do this by calling the esriLoader.bootstrap()
method. See the Lazy Load Patterns page for an example of how to do this.
At version 1.x, these directives and services require, at a minimum, AngularJS v1.3.0 and the ArcGIS API for JavaScript v3.12 (though most will work and are tested on v3.11).
For version 2.x, the ArcGIS API for JavaScript v4.0 is required.
See the compatibility table below for details.
angular-esri-map | AngularJS | ArcGIS API for JavaScript | Notes |
---|---|---|---|
v1.0.0 | v1.3 - v1.5 | v3.12 - 3.21 | Test coverage included for AngularJS v1.3. |
v1.1.0 | v1.3 - v1.5 | v3.15 - 3.21 | |
v1.1.8 | v1.3+ | v3.12 - 3.21 | Due to a breaking change in controllers at AngularJS v1.6, e2e test coverage has been performed with v1.3, but will only continue with v1.6. See CHANGELOG. |
v2.0.0 | v1.3 - v1.5 | v4.0 - v4.6 | Test coverage included for AngularJS v1.3. |
v2.0.2 | v1.3+ | v4.0 - v4.6 | Due to a breaking change in controllers at AngularJS v1.6, e2e test coverage has been performed with v1.3, but will only continue with v1.6. See CHANGELOG. |
v2.0.5 | v1.3+ | v4.6 - v4.8 | Uses .when() instead of .then() |
Websites
Presentations
You can find up to date information on using the ArcGIS API for JavaScript in an Angular (2+) application at this Angular resources page.
Ionic is a mobile-ready implementation of Angular that is built on top of Cordova/PhoneGap. The coding patterns shown above can also be used with Ionic.
Find a bug or want to request a new feature? Please let us know by submitting an issue. Thank you!
Anyone and everyone is welcome to contribute. Please see our guidelines for contributing.
Make sure you have Node and Gulp installed.
cd
into the angular-esri-map
foldernpm install
gulp
from the command line. This will run the linting and build commands and then start a local web server hosting the application under the docs
foldersrc
) and test pages (under test
). Test pages are served along with the docs site when you run the gulp
task and are accessible from the root (i.e. https://localhost:9002/simple-map.html
).Copyright 2014 Esri
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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
A copy of the license is available in the repository's license.txt file.
[v2.0.5]
Uses .when()
instead of .then()
for JSAPI 4.7+ compatibility
esriLoader defaults to loading JSAPI v4.8. Docs site uses JSAPI v4.8
Added information to readme to clarify status of this project.
Updated Travis CI config and package.json ("engines") to indicate the node versions that tests are expected to run on.
Fixed calcite-bootstrap css url in docs pages.
FAQs
A collection of directives to help you use Esri maps and services in your Angular applications
The npm package angular-esri-map receives a total of 286 weekly downloads. As such, angular-esri-map popularity was classified as not popular.
We found that angular-esri-map 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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.