From 03650d0144c27cf5428eb3987017dcd47c82e85e Mon Sep 17 00:00:00 2001 From: Jacob Wasilkowski Date: Sat, 3 Oct 2015 09:50:31 -0500 Subject: [PATCH] added new feature-layer-events docs page; updated changelog; resolves #103 --- CHANGELOG.md | 4 +++ docs/app/appConfig.js | 11 ++++++++ docs/app/examples/feature-layer-events.html | 31 +++++++++++++++++++++ docs/app/examples/feature-layer-events.js | 26 +++++++++++++++++ docs/index.html | 1 + 5 files changed, 73 insertions(+) create mode 100644 docs/app/examples/feature-layer-events.html create mode 100644 docs/app/examples/feature-layer-events.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 888d346..8659366 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ Add or remove layers from the map programatically [#51](https://github.com/Esri/ The feature layer directive now includes optional attributes for opacity, definition expression, and constructor options. Opacity and definition expression act just like the visible attribute, and are watched for changes and can be adjusted at any time. [#51](https://github.com/Esri/angular-esri-map/pull/51) [@eas604](https://github.com/eas604) [#97](https://github.com/Esri/angular-esri-map/issues/97) and [#100](https://github.com/Esri/angular-esri-map/issues/100) +The feature layer directive also now includes optional attributes for the layer's load and update-end events. [#103](https://github.com/Esri/angular-esri-map/issues/103) + Added a directive for dynamic map service layers. Like the feature layer directive, it has optional attributes for visibility, opacity and constructor options. [#52](https://github.com/Esri/angular-esri-map/issues/52) [@Kollibri](https://github.com/Kollibri) Added a directive to set the info template(s) for layers so that they show a popup when clicked. [#52](https://github.com/Esri/angular-esri-map/issues/52) [#118](https://github.com/Esri/angular-esri-map/issues/118) [@Kollibri](https://github.com/Kollibri) @@ -36,6 +38,8 @@ Added an example page for the new dynamic map service layer. [c69329b9](https:// Added an example page showing how to add/remove layers from a map. [061ed936](https://github.com/Esri/angular-esri-map/commit/061ed9368f9931bc3fc03b536366f0b53c294b5e) +Added an example page (feature-layer-events) showing how to interact with the esriFeatureLayer directive's attributes for layer load and update-end events. [#103](https://github.com/Esri/angular-esri-map/issues/103) + ### Tests Added functional testing using [Protractor](https://angular.github.io/protractor/#/). [#82](https://github.com/Esri/angular-esri-map/pull/82), [#94](https://github.com/Esri/angular-esri-map/pull/94), [#112](https://github.com/Esri/angular-esri-map/pull/112) diff --git a/docs/app/appConfig.js b/docs/app/appConfig.js index b3b1730..9d2f683 100644 --- a/docs/app/appConfig.js +++ b/docs/app/appConfig.js @@ -106,6 +106,17 @@ templateUrl: urlPrefixes.routeTemplateUrl + 'map-events.html', controller: 'MapEventsCtrl' } + }, { + toc: { + title: 'Feature Layer Events', + description: 'Shows how to listen for feature layer events raised by the feature layer directive and get a direct reference to the layer object.', + url: urlPrefixes.templateHref + 'feature-layer-events' + }, + route: { + path: urlPrefixes.routePath + 'feature-layer-events', + templateUrl: urlPrefixes.routeTemplateUrl + 'feature-layer-events.html', + controller: 'FeatureLayerEventsCtrl' + } }, { toc: { title: 'Registry Pattern', diff --git a/docs/app/examples/feature-layer-events.html b/docs/app/examples/feature-layer-events.html new file mode 100644 index 0000000..e7ff31b --- /dev/null +++ b/docs/app/examples/feature-layer-events.html @@ -0,0 +1,31 @@ +

Feature Layer Events

+ + + + + + + +

+
+
Trees feature layer info
+ +
+

Lat: {{ map.center.lat | number:3 }}, Lng: {{ map.center.lng | number:3 }}, Zoom: {{map.zoom}}

+

Based on this JS Fiddle.

\ No newline at end of file diff --git a/docs/app/examples/feature-layer-events.js b/docs/app/examples/feature-layer-events.js new file mode 100644 index 0000000..6caf9bb --- /dev/null +++ b/docs/app/examples/feature-layer-events.js @@ -0,0 +1,26 @@ +'use strict'; + +angular.module('esri-map-docs') + .controller('FeatureLayerEventsCtrl', function($scope) { + $scope.map = { + center: { + lng: -122.676207, + lat: 45.523452 + }, + zoom: 12, + showTrees: false, + treesLoaded: false, + treesUpdateEndCount: 0 + }; + $scope.treesLayerLoaded = function(layer) { + // a 1-time reference to the layer is available + console.log(layer); + $scope.map.treesLoaded = true; + }; + $scope.treesLayerUpdateEnd = function(e) { + // reference to the layer's updateEnd event object is available + // e.target will also provide reference to the layer + console.log(e); + $scope.map.treesUpdateEndCount += 1; + }; + }); \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index e8d6a52..543eee7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -111,6 +111,7 @@

angular-esri-map

+