Professional Documents
Culture Documents
with AngularJS
Dave Bouwman - @dbouwman
Tom Wayson - @TomWayson
Angular
<declarative />
{{data-binding}}
test-all-the-things
dependency injection
super popular
big ecosystem
“forms-over-data”
Not So Much…
Big in “the enterprise”
“enterprise”
Big in “the enterprise”
80497449@N04/8280671002
component in a system
no3rdw/4731781962
adding maps to ng-apps
no3rdw/4731781962
<directive>
Wrap Angular in Dojo
Make JSAPI work in Angular
<esri-map id="map" center="map.center" zoom="map.zoom" basemap="topo">
<esri-feature-layer url="http://services.arcgis.com/.../FeatureServer/0" />
<esri-feature-layer url="http://services.arcgis.com/.../FeatureServer/1" />
</esri-map>
<esri-map id="map" center="map.center" zoom="map.zoom" basemap="topo">
<esri-feature-layer url="http://services.arcgis.com/.../FeatureServer/0" />
<esri-feature-layer url="http://services.arcgis.com/.../FeatureServer/1" />
</esri-map>
Map Directive
Let’s go further…
<esri-map id="map" center="map.center" zoom="map.zoom" basemap="topo">
<esri-feature-layer url="http://services.arcgis.com/.../FeatureServer/0" />
<esri-feature-layer url="http://services.arcgis.com/.../FeatureServer/1">
<renderer field="area" type="class-breaks">
<break min="0" max="50">
<symbol linecolor="#ff0044" fillcolor="#ff0044">
</break>
<break min="51" max="150">
<symbol linecolor="#cc0044" fillcolor="#cc0044">
</break>
<break min="151" max="500">
<symbol linecolor="#aa0044" fillcolor="#aa0044">
</break>
</renderer></esri-feature-layer>
</esri-map>
<esri-map id="map" center="map.center" zoom="map.zoom" basemap="topo">
<esri-feature-layer url="http://services.arcgis.com/.../FeatureServer/0" />
25 types of layers
<esri-feature-layer url="http://services.arcgis.com/.../FeatureServer/1">
<renderer field="area" type="class-breaks">
<break min="0" max="50">
10 renderers
<symbol linecolor="#ff0044" fillcolor="#ff0044">
</break>
<break min="51" max="150">
9 types of symbols
<symbol linecolor="#cc0044" fillcolor="#cc0044">
</break>
<break min="151" max="500">
100s of events
<symbol linecolor="#aa0044" fillcolor="#aa0044">
</break>
</renderer></esri-feature-layer>
</esri-map>
It’s… It’s… XML??!
Directives exposing the entire
Esri JS API?
No.
Directives exposing the entire
Esri Leaflet API?
No.
Facilitate creating custom
directives?
Yes!
What do you need?
http://github.com/esri/angular-esri-map
esri angular-esri-map
angular-esri-map: How does it work?
<script type="text/javascript">
angular.module('app', ['esri.map']);
</script>
angular.module('app').controller('MyController', function($scope) {
$scope.map = {
center: { lng: -122.45, lat: 37.75 },
zoom: 13
};
});
Site Map
Real World App: Gap Analysis
Layer Visibility Renderer
Definition Query
Layer Selection
Feature Layers
<floor-plan-map id="floorPlanMap"
floor-id="spaces.floorId" Definition Query
type="spaces.occupancy" Renderer
show-lines="lines.show"> Visibility
<div esri-legend target-id="legend"></div>
</floor-plan-map>
Demo: Parcel Map
http://tomwayson.github.io/angular-parcel-map/
Parcel Map: Directive API
angular.module('app').controller('MyController', function($scope) {
$scope.parcel = {
id: '1919377002'
};
$scope.onParcelSelected = function(e) {
$scope.selectedParcel = e.features[0];
};
});
<esri-map /> Directive: Attribute Binding