Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-esri-map

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-esri-map - npm Package Compare versions

Comparing version 1.1.8 to 1.1.9

7

CHANGELOG.md

@@ -8,2 +8,6 @@ # Change Log

## [v1.1.9]
esriLoader defaults to loading JSAPI v3.20compact. Docs site uses JSAPI v3.20compact.
## [v1.1.8]

@@ -311,3 +315,4 @@

[unreleased]: https://github.com/Esri/angular-esri-map/compare/v1.1.8...v1.x
[unreleased]: https://github.com/Esri/angular-esri-map/compare/v1.1.9...v1.x
[v1.1.9]: https://github.com/Esri/angular-esri-map/compare/v1.1.8...v1.1.9
[v1.1.8]: https://github.com/Esri/angular-esri-map/compare/v1.1.7...v1.1.8

@@ -314,0 +319,0 @@ [v1.1.7]: https://github.com/Esri/angular-esri-map/compare/v1.1.6...v1.1.7

4

dist/angular-esri-core.js

@@ -32,3 +32,3 @@ (function(angular) {

* @param {Object=} options Send a list of options of how to load the ArcGIS API for JavaScript.
* Defaults to `{url: '//js.arcgis.com/3.19compact'}`
* Defaults to `{url: '//js.arcgis.com/3.20compact'}`
*

@@ -52,3 +52,3 @@ * @return {Promise} Returns a $q style promise which is resolved once the ArcGIS API for JavaScript has been loaded.

script.type = 'text/javascript';
script.src = opts.url || window.location.protocol + '//js.arcgis.com/3.19compact';
script.src = opts.url || window.location.protocol + '//js.arcgis.com/3.20compact';

@@ -55,0 +55,0 @@ // Set onload callback to resolve promise

@@ -1,1 +0,1 @@

!function(e){"use strict";e.module("esri.core",[])}(angular),function(e){"use strict";e.module("esri.core").factory("esriLoader",["$q",function(e){function r(r){var n=e.defer(),a=r||{};if(t())return n.reject("ArcGIS API for JavaScript is already loaded."),n.promise;var i=document.createElement("script");return i.type="text/javascript",i.src=a.url||window.location.protocol+"//js.arcgis.com/3.19compact",i.onload=function(){n.resolve(window.require)},document.body.appendChild(i),n.promise}function t(){return"undefined"!=typeof window.require}function n(r,n){var a=e.defer();return t()?"string"==typeof r?(require([r],function(e){a.resolve(e)}),a.promise.then(function(e){return n&&"function"==typeof n&&n(e),e})):r instanceof Array?(require(r,function(){var e=Array.prototype.slice.call(arguments);a.resolve(e)}),a.promise.then(function(e){return n&&"function"==typeof n&&n.apply(this,e),e})):(a.reject("An Array<String> or String is required to load modules."),a.promise):(a.reject("Trying to call esriLoader.require(), but the ArcGIS API for JavaScript has not been loaded yet. Run esriLoader.bootstrap() if you are lazy loading the ArcGIS API for JavaScript."),a.promise)}return{bootstrap:r,isLoaded:t,require:n}}])}(angular),function(e){"use strict";e.module("esri.core").service("esriRegistry",["$q",function(e){var r={};return{_register:function(t,n){r[t]||(r[t]=e.defer());var a=r[t];return n.then(function(e){return a.resolve(e),e},function(e){return a.reject(e),e}),function(){delete r[t]}},get:function(t){if(r[t])return r[t].promise;var n=e.defer();return r[t]=n,n.promise}}}])}(angular),function(e){"use strict";e.module("esri.core").factory("esriMapUtils",["$q","esriLoader",function(e,r){function t(e){return e instanceof Array}function n(e,r){return"esri.geometry.Extent"===e.declaredClass?e:new r(e)}var a={};return a.addCustomBasemap=function(e,n){return r.require("esri/basemaps").then(function(r){var a=n.baseMapLayers;return!t(a)&&t(n.urls)&&(a=n.urls.map(function(e){return{url:e}})),t(a)&&(r[e]={baseMapLayers:a,thumbnailUrl:n.thumbnailUrl,title:n.title}),r})},a.createMap=function(e,t){return r.require(["esri/map","esri/geometry/Extent"]).then(function(r){var a=r[0],i=r[1];return t&&t.hasOwnProperty("extent")&&(t.extent=n(t.extent,i)),new a(e,t)})},a.createWebMap=function(t,a,i,o){var s=e.defer();return r.require(["esri/arcgis/utils","esri/geometry/Extent"],function(e,r){i.hasOwnProperty("extent")&&(i.extent=n(i.extent,r)),e.createMap(t,a,{mapOptions:i}).then(function(r){o.layerInfos=e.getLegendLayers(r),o.itemInfo=r.itemInfo,s.resolve(r.map)})}),s.promise},a}])}(angular),function(e){"use strict";e.module("esri.core").factory("esriLayerUtils",["esriLoader",function(e){function r(e){var r;return"string"==typeof e&&(r=[],e.split(",").forEach(function(e){var t=parseInt(e);isNaN(t)||r.push(t)})),r}function t(e,r){return"esri.InfoTemplate"===e.declaredClass?e:e instanceof Array&&2===e.length?new r(e[0],e[1]):new r(e.title,e.content)}var n={};return n.createFeatureLayer=function(r,n){return e.require(["esri/layers/FeatureLayer","esri/InfoTemplate"]).then(function(e){var a=e[0],i=e[1];return n&&(n.infoTemplate&&(n.infoTemplate=t(n.infoTemplate,i)),n.hasOwnProperty("mode")&&(n.mode=a[n.mode])),new a(r,n)})},n.createVectorTileLayer=function(r,t){return e.require(["esri/layers/VectorTileLayer"]).then(function(e){var n=e[0];return new n(r,t)})},n.createDynamicMapServiceLayer=function(n,a,i){return e.require(["esri/layers/ArcGISDynamicMapServiceLayer","esri/InfoTemplate","esri/layers/ImageParameters"]).then(function(e){var o,s=e[0],u=e[1],c=e[2];if(a){if(a.infoTemplates)for(var f in a.infoTemplates)a.infoTemplates.hasOwnProperty(f)&&(a.infoTemplates[f].infoTemplate=t(a.infoTemplates[f].infoTemplate,u));if("object"==typeof a.imageParameters&&"esri.layers.ImageParameters"!==a.imageParameters.declaredClass){var l=new c;for(var m in a.imageParameters)a.imageParameters.hasOwnProperty(m)&&(l[m]=a.imageParameters[m]);a.imageParameters=l}}return o=new s(n,a),i&&o.setVisibleLayers(r(i)),o})},n.createInfoTemplate=function(r){return e.require("esri/InfoTemplate").then(function(e){return t(r,e)})},n}])}(angular);
!function(e){"use strict";e.module("esri.core",[])}(angular),function(e){"use strict";e.module("esri.core").factory("esriLoader",["$q",function(e){function r(r){var n=e.defer(),a=r||{};if(t())return n.reject("ArcGIS API for JavaScript is already loaded."),n.promise;var i=document.createElement("script");return i.type="text/javascript",i.src=a.url||window.location.protocol+"//js.arcgis.com/3.20compact",i.onload=function(){n.resolve(window.require)},document.body.appendChild(i),n.promise}function t(){return"undefined"!=typeof window.require}function n(r,n){var a=e.defer();return t()?"string"==typeof r?(require([r],function(e){a.resolve(e)}),a.promise.then(function(e){return n&&"function"==typeof n&&n(e),e})):r instanceof Array?(require(r,function(){var e=Array.prototype.slice.call(arguments);a.resolve(e)}),a.promise.then(function(e){return n&&"function"==typeof n&&n.apply(this,e),e})):(a.reject("An Array<String> or String is required to load modules."),a.promise):(a.reject("Trying to call esriLoader.require(), but the ArcGIS API for JavaScript has not been loaded yet. Run esriLoader.bootstrap() if you are lazy loading the ArcGIS API for JavaScript."),a.promise)}return{bootstrap:r,isLoaded:t,require:n}}])}(angular),function(e){"use strict";e.module("esri.core").service("esriRegistry",["$q",function(e){var r={};return{_register:function(t,n){r[t]||(r[t]=e.defer());var a=r[t];return n.then(function(e){return a.resolve(e),e},function(e){return a.reject(e),e}),function(){delete r[t]}},get:function(t){if(r[t])return r[t].promise;var n=e.defer();return r[t]=n,n.promise}}}])}(angular),function(e){"use strict";e.module("esri.core").factory("esriMapUtils",["$q","esriLoader",function(e,r){function t(e){return e instanceof Array}function n(e,r){return"esri.geometry.Extent"===e.declaredClass?e:new r(e)}var a={};return a.addCustomBasemap=function(e,n){return r.require("esri/basemaps").then(function(r){var a=n.baseMapLayers;return!t(a)&&t(n.urls)&&(a=n.urls.map(function(e){return{url:e}})),t(a)&&(r[e]={baseMapLayers:a,thumbnailUrl:n.thumbnailUrl,title:n.title}),r})},a.createMap=function(e,t){return r.require(["esri/map","esri/geometry/Extent"]).then(function(r){var a=r[0],i=r[1];return t&&t.hasOwnProperty("extent")&&(t.extent=n(t.extent,i)),new a(e,t)})},a.createWebMap=function(t,a,i,o){var s=e.defer();return r.require(["esri/arcgis/utils","esri/geometry/Extent"],function(e,r){i.hasOwnProperty("extent")&&(i.extent=n(i.extent,r)),e.createMap(t,a,{mapOptions:i}).then(function(r){o.layerInfos=e.getLegendLayers(r),o.itemInfo=r.itemInfo,s.resolve(r.map)})}),s.promise},a}])}(angular),function(e){"use strict";e.module("esri.core").factory("esriLayerUtils",["esriLoader",function(e){function r(e){var r;return"string"==typeof e&&(r=[],e.split(",").forEach(function(e){var t=parseInt(e);isNaN(t)||r.push(t)})),r}function t(e,r){return"esri.InfoTemplate"===e.declaredClass?e:e instanceof Array&&2===e.length?new r(e[0],e[1]):new r(e.title,e.content)}var n={};return n.createFeatureLayer=function(r,n){return e.require(["esri/layers/FeatureLayer","esri/InfoTemplate"]).then(function(e){var a=e[0],i=e[1];return n&&(n.infoTemplate&&(n.infoTemplate=t(n.infoTemplate,i)),n.hasOwnProperty("mode")&&(n.mode=a[n.mode])),new a(r,n)})},n.createVectorTileLayer=function(r,t){return e.require(["esri/layers/VectorTileLayer"]).then(function(e){var n=e[0];return new n(r,t)})},n.createDynamicMapServiceLayer=function(n,a,i){return e.require(["esri/layers/ArcGISDynamicMapServiceLayer","esri/InfoTemplate","esri/layers/ImageParameters"]).then(function(e){var o,s=e[0],u=e[1],c=e[2];if(a){if(a.infoTemplates)for(var f in a.infoTemplates)a.infoTemplates.hasOwnProperty(f)&&(a.infoTemplates[f].infoTemplate=t(a.infoTemplates[f].infoTemplate,u));if("object"==typeof a.imageParameters&&"esri.layers.ImageParameters"!==a.imageParameters.declaredClass){var l=new c;for(var m in a.imageParameters)a.imageParameters.hasOwnProperty(m)&&(l[m]=a.imageParameters[m]);a.imageParameters=l}}return o=new s(n,a),i&&o.setVisibleLayers(r(i)),o})},n.createInfoTemplate=function(r){return e.require("esri/InfoTemplate").then(function(e){return t(r,e)})},n}])}(angular);

@@ -1,1 +0,1 @@

!function(e){"use strict";e.module("esri.core",[])}(angular),function(e){"use strict";e.module("esri.core").factory("esriLoader",["$q",function(e){function r(r){var n=e.defer(),i=r||{};if(t())return n.reject("ArcGIS API for JavaScript is already loaded."),n.promise;var o=document.createElement("script");return o.type="text/javascript",o.src=i.url||window.location.protocol+"//js.arcgis.com/3.19compact",o.onload=function(){n.resolve(window.require)},document.body.appendChild(o),n.promise}function t(){return"undefined"!=typeof window.require}function n(r,n){var i=e.defer();return t()?"string"==typeof r?(require([r],function(e){i.resolve(e)}),i.promise.then(function(e){return n&&"function"==typeof n&&n(e),e})):r instanceof Array?(require(r,function(){var e=Array.prototype.slice.call(arguments);i.resolve(e)}),i.promise.then(function(e){return n&&"function"==typeof n&&n.apply(this,e),e})):(i.reject("An Array<String> or String is required to load modules."),i.promise):(i.reject("Trying to call esriLoader.require(), but the ArcGIS API for JavaScript has not been loaded yet. Run esriLoader.bootstrap() if you are lazy loading the ArcGIS API for JavaScript."),i.promise)}return{bootstrap:r,isLoaded:t,require:n}}])}(angular),function(e){"use strict";e.module("esri.core").service("esriRegistry",["$q",function(e){var r={};return{_register:function(t,n){r[t]||(r[t]=e.defer());var i=r[t];return n.then(function(e){return i.resolve(e),e},function(e){return i.reject(e),e}),function(){delete r[t]}},get:function(t){if(r[t])return r[t].promise;var n=e.defer();return r[t]=n,n.promise}}}])}(angular),function(e){"use strict";e.module("esri.core").factory("esriMapUtils",["$q","esriLoader",function(e,r){function t(e){return e instanceof Array}function n(e,r){return"esri.geometry.Extent"===e.declaredClass?e:new r(e)}var i={};return i.addCustomBasemap=function(e,n){return r.require("esri/basemaps").then(function(r){var i=n.baseMapLayers;return!t(i)&&t(n.urls)&&(i=n.urls.map(function(e){return{url:e}})),t(i)&&(r[e]={baseMapLayers:i,thumbnailUrl:n.thumbnailUrl,title:n.title}),r})},i.createMap=function(e,t){return r.require(["esri/map","esri/geometry/Extent"]).then(function(r){var i=r[0],o=r[1];return t&&t.hasOwnProperty("extent")&&(t.extent=n(t.extent,o)),new i(e,t)})},i.createWebMap=function(t,i,o,a){var s=e.defer();return r.require(["esri/arcgis/utils","esri/geometry/Extent"],function(e,r){o.hasOwnProperty("extent")&&(o.extent=n(o.extent,r)),e.createMap(t,i,{mapOptions:o}).then(function(r){a.layerInfos=e.getLegendLayers(r),a.itemInfo=r.itemInfo,s.resolve(r.map)})}),s.promise},i}])}(angular),function(e){"use strict";e.module("esri.core").factory("esriLayerUtils",["esriLoader",function(e){function r(e){var r;return"string"==typeof e&&(r=[],e.split(",").forEach(function(e){var t=parseInt(e);isNaN(t)||r.push(t)})),r}function t(e,r){return"esri.InfoTemplate"===e.declaredClass?e:e instanceof Array&&2===e.length?new r(e[0],e[1]):new r(e.title,e.content)}var n={};return n.createFeatureLayer=function(r,n){return e.require(["esri/layers/FeatureLayer","esri/InfoTemplate"]).then(function(e){var i=e[0],o=e[1];return n&&(n.infoTemplate&&(n.infoTemplate=t(n.infoTemplate,o)),n.hasOwnProperty("mode")&&(n.mode=i[n.mode])),new i(r,n)})},n.createVectorTileLayer=function(r,t){return e.require(["esri/layers/VectorTileLayer"]).then(function(e){var n=e[0];return new n(r,t)})},n.createDynamicMapServiceLayer=function(n,i,o){return e.require(["esri/layers/ArcGISDynamicMapServiceLayer","esri/InfoTemplate","esri/layers/ImageParameters"]).then(function(e){var a,s=e[0],c=e[1],u=e[2];if(i){if(i.infoTemplates)for(var l in i.infoTemplates)i.infoTemplates.hasOwnProperty(l)&&(i.infoTemplates[l].infoTemplate=t(i.infoTemplates[l].infoTemplate,c));if("object"==typeof i.imageParameters&&"esri.layers.ImageParameters"!==i.imageParameters.declaredClass){var f=new u;for(var p in i.imageParameters)i.imageParameters.hasOwnProperty(p)&&(f[p]=i.imageParameters[p]);i.imageParameters=f}}return a=new s(n,i),o&&a.setVisibleLayers(r(o)),a})},n.createInfoTemplate=function(r){return e.require("esri/InfoTemplate").then(function(e){return t(r,e)})},n}])}(angular),function(e){"use strict";e.module("esri.map",["esri.core"])}(angular),function(e){"use strict";e.module("esri.map").controller("EsriMapController",["$attrs","$timeout","esriMapUtils","esriRegistry",function(r,t,n,i){function o(e){return"undefined"==typeof e}function a(e,r){var t=r.geographicExtent&&r.geographicExtent.getCenter();t&&(t=t.normalize(),e.center={lat:t.y,lng:t.x}),e.zoom=r.getZoom()}var s,c=r;this.getMapOptions=function(){var e=this.mapOptions()||{};return this.basemap&&(e.basemap=this.basemap),this.center&&(this.center.lng&&this.center.lat?e.center=[this.center.lng,this.center.lat]:e.center=this.center),this.zoom&&(e.zoom=this.zoom),e},this.getMap=function(){return s},this.addLayer=function(e,r){return this.getMap().then(function(t){return t.addLayer(e,r)})},this.removeLayer=function(e){return this.getMap().then(function(r){return r.removeLayer(e)})},this.addLayerInfo=function(e){this.layerInfos?this.layerInfos.unshift(e):this.layerInfos=[e]},this.getLayerInfos=function(){return this.layerInfos},this.bindMapEvents=function(e,r){var n=this;this.getMap().then(function(i){i.loaded?(a(n,i),r.load&&n.load()(i)):r.load&&i.on("load",function(){e.$apply(function(){n.load()(i)})}),i.on("extent-change",function(o){r.extentChange&&n.extentChange()(o),n.inUpdateCycle||(n.inUpdateCycle=!0,e.$applyAsync(function(){a(n,i),t(function(){n.inUpdateCycle=!1},0)}))}),e.$watch("mapCtrl.basemap",function(e,r){i.loaded&&e!==r&&i.setBasemap(e)}),n.inUpdateCycle=!1,o(r.center)&&o(r.zoom)||e.$watchGroup(["mapCtrl.center.lng","mapCtrl.center.lat","mapCtrl.zoom"],function(e){n.inUpdateCycle||""!==e[0]&&""!==e[1]&&""!==e[2]&&(n.inUpdateCycle=!0,i.centerAndZoom([e[0],e[1]],e[2]).then(function(){n.inUpdateCycle=!1}))}),e.$on("$destroy",function(){n.deregister&&n.deregister(),i.destroy()})})},this.$onInit=function(){s=this.webmapId?n.createWebMap(this.webmapId,c.id,this.getMapOptions(),this):n.createMap(c.id,this.getMapOptions()),c.registerAs&&(this.deregister=i._register(c.registerAs,s))},1===e.version.major&&e.version.minor<5&&this.$onInit()}])}(angular),function(e){"use strict";e.module("esri.map").directive("esriMap",function(){return{restrict:"E",scope:{center:"=?",zoom:"=?",itemInfo:"=?",basemap:"@",webmapId:"@?",load:"&",extentChange:"&",mapOptions:"&"},controllerAs:"mapCtrl",bindToController:!0,controller:"EsriMapController",compile:function(e,r){return e.removeAttr("id"),e.append("<div id="+r.id+"></div>"),function(e,r,t,n){n.bindMapEvents(e,t)}}}})}(angular),function(e){"use strict";e.module("esri.map").directive("esriLegend",["$q","esriLoader",function(e,r){return{priority:-10,restrict:"EA",require:["?esriLegend","^esriMap"],replace:!0,scope:{},controllerAs:"legendCtrl",bindToController:!0,controller:function(){},link:function(t,n,i,o){var a=o[1],s=i.targetId||i.id,c=e.defer();r.require(["esri/dijit/Legend"],function(e){a.getMap().then(function(r){var n=function(r){var n,i={map:r},o=a.getLayerInfos();o&&(i.layerInfos=o),n=new e(i,s),n.startup(),t.$watchCollection(function(){return a.getLayerInfos()},function(e){n.refresh(e)}),c.resolve(n),t.$on("$destroy",function(){n.destroy()})};r.loaded?n(r):r.on("load",function(){n(r)})})})}}}])}(angular),function(e){"use strict";e.module("esri.map").controller("EsriLayerControllerBase",function(){function e(e){return e===!0||"true"===e}this.getLayerOptions=function(){var r=this.layerOptions()||{};return"undefined"!=typeof this.visible&&(r.visible=e(this.visible)),this.opacity&&(r.opacity=Number(this.opacity)),r},this.getLayerInfo=function(e,r){return{title:r.title||e.name,layer:e,hideLayers:r.hideLayers?r.hideLayers.split(",").map(Number):void 0,defaultSymbol:!r.defaultSymbol||JSON.parse(r.defaultSymbol)}},this._bindLayerEvents=function(r,t,n,i){t.load&&(n.loaded?r.layerCtrl.load()(n):n.on("load",function(){r.$apply(function(){r.layerCtrl.load()(n)})})),t.updateEnd&&n.on("update-end",function(e){r.$apply(function(){r.layerCtrl.updateEnd()(e)})}),r.$watch("layerCtrl.visible",function(r,t){r!==t&&n.setVisibility(e(r))}),r.$watch("layerCtrl.opacity",function(e,r){e!==r&&n.setOpacity(Number(e))}),r.$on("$destroy",function(){i.removeLayer(n)})}})}(angular),function(e){"use strict";e.module("esri.map").controller("EsriFeatureLayerController",["$controller","esriLayerUtils",function(r,t){var n;e.extend(this,r("EsriLayerControllerBase")),this.getFeatureLayerOptions=function(){var e=this.getLayerOptions();return this.definitionExpression&&(e.definitionExpression=this.definitionExpression),e},this.getLayer=function(){return n},this.setInfoTemplate=function(e){return this.getLayer().then(function(r){return t.createInfoTemplate(e).then(function(e){return r.setInfoTemplate(e),e})})},this.bindLayerEvents=function(e,r,t,n){this._bindLayerEvents(e,r,t,n),e.$watch("layerCtrl.definitionExpression",function(e,r){e!==r&&t.setDefinitionExpression(e)})},this.$onInit=function(){n=t.createFeatureLayer(this.url,this.getFeatureLayerOptions())},1===e.version.major&&e.version.minor<5&&this.$onInit()}])}(angular),function(e){"use strict";e.module("esri.map").directive("esriFeatureLayer",function(){return{restrict:"E",require:["esriFeatureLayer","^esriMap"],replace:!0,scope:{url:"@",visible:"@?",opacity:"@?",definitionExpression:"@?",load:"&",updateEnd:"&",layerOptions:"&"},controllerAs:"layerCtrl",bindToController:!0,controller:"EsriFeatureLayerController",link:function(e,r,t,n){var i=n[0],o=n[1];i.getLayer().then(function(r){var n=i.getLayerInfo(r,t);o.addLayer(r,0),o.addLayerInfo(n),i.bindLayerEvents(e,t,r,o)})}}})}(angular),function(e){"use strict";e.module("esri.map").controller("EsriDynamicMapServiceLayerController",["$controller","esriLayerUtils",function(r,t){var n;e.extend(this,r("EsriLayerControllerBase")),this.getLayer=function(){return n},this.setInfoTemplate=function(e,r){return this.getLayer().then(function(n){return t.createInfoTemplate(r).then(function(r){var t=n.infoTemplates;return t||(t={}),t[e]={infoTemplate:r},n.setInfoTemplates(t),t})})},this.bindLayerEvents=function(e,r,t,n){this._bindLayerEvents(e,r,t,n)},this.$onInit=function(){n=t.createDynamicMapServiceLayer(this.url,this.getLayerOptions(),this.visibleLayers)},1===e.version.major&&e.version.minor<5&&this.$onInit()}])}(angular),function(e){"use strict";e.module("esri.map").directive("esriDynamicMapServiceLayer",function(){return{restrict:"E",require:["esriDynamicMapServiceLayer","^esriMap"],replace:!0,scope:{url:"@",visible:"@?",opacity:"@?",visibleLayers:"@?",load:"&",updateEnd:"&",layerOptions:"&"},controllerAs:"layerCtrl",bindToController:!0,controller:"EsriDynamicMapServiceLayerController",link:function(e,r,t,n){var i=n[0],o=n[1];i.getLayer().then(function(r){var n=i.getLayerInfo(r,t);o.addLayer(r),o.addLayerInfo(n),i.bindLayerEvents(e,t,r,o)})}}})}(angular),function(e){"use strict";e.module("esri.map").controller("EsriVectorTileLayerController",["$controller","esriLayerUtils",function(r,t){var n;e.extend(this,r("EsriLayerControllerBase")),this.getLayer=function(){return n},this.bindLayerEvents=function(e,r,t,n){this._bindLayerEvents(e,r,t,n)},this.$onInit=function(){n=t.createVectorTileLayer(this.url,this.getLayerOptions())},1===e.version.major&&e.version.minor<5&&this.$onInit()}])}(angular),function(e){"use strict";e.module("esri.map").directive("esriVectorTileLayer",function(){return{restrict:"E",require:["esriVectorTileLayer","^esriMap"],replace:!0,scope:{url:"@",visible:"@?",opacity:"@?",load:"&",layerOptions:"&"},controllerAs:"layerCtrl",bindToController:!0,controller:"EsriVectorTileLayerController",link:function(e,r,t,n){var i=n[0],o=n[1];i.getLayer().then(function(r){var n=i.getLayerInfo(r,t);o.addLayer(r),o.addLayerInfo(n),i.bindLayerEvents(e,t,r,o)})}}})}(angular),function(e){"use strict";e.module("esri.map").directive("esriInfoTemplate",function(){return{restrict:"E",require:["?esriInfoTemplate","?^esriDynamicMapServiceLayer","?^esriFeatureLayer"],replace:!0,compile:function(e){var r=e.html();return e.html(""),function(e,t,n,i){var o=i[1],a=i[2];o&&o.setInfoTemplate(n.layerId,{title:n.title,content:r}),a&&a.setInfoTemplate({title:n.title,content:r})}}}})}(angular);
!function(e){"use strict";e.module("esri.core",[])}(angular),function(e){"use strict";e.module("esri.core").factory("esriLoader",["$q",function(e){function r(r){var n=e.defer(),i=r||{};if(t())return n.reject("ArcGIS API for JavaScript is already loaded."),n.promise;var o=document.createElement("script");return o.type="text/javascript",o.src=i.url||window.location.protocol+"//js.arcgis.com/3.20compact",o.onload=function(){n.resolve(window.require)},document.body.appendChild(o),n.promise}function t(){return"undefined"!=typeof window.require}function n(r,n){var i=e.defer();return t()?"string"==typeof r?(require([r],function(e){i.resolve(e)}),i.promise.then(function(e){return n&&"function"==typeof n&&n(e),e})):r instanceof Array?(require(r,function(){var e=Array.prototype.slice.call(arguments);i.resolve(e)}),i.promise.then(function(e){return n&&"function"==typeof n&&n.apply(this,e),e})):(i.reject("An Array<String> or String is required to load modules."),i.promise):(i.reject("Trying to call esriLoader.require(), but the ArcGIS API for JavaScript has not been loaded yet. Run esriLoader.bootstrap() if you are lazy loading the ArcGIS API for JavaScript."),i.promise)}return{bootstrap:r,isLoaded:t,require:n}}])}(angular),function(e){"use strict";e.module("esri.core").service("esriRegistry",["$q",function(e){var r={};return{_register:function(t,n){r[t]||(r[t]=e.defer());var i=r[t];return n.then(function(e){return i.resolve(e),e},function(e){return i.reject(e),e}),function(){delete r[t]}},get:function(t){if(r[t])return r[t].promise;var n=e.defer();return r[t]=n,n.promise}}}])}(angular),function(e){"use strict";e.module("esri.core").factory("esriMapUtils",["$q","esriLoader",function(e,r){function t(e){return e instanceof Array}function n(e,r){return"esri.geometry.Extent"===e.declaredClass?e:new r(e)}var i={};return i.addCustomBasemap=function(e,n){return r.require("esri/basemaps").then(function(r){var i=n.baseMapLayers;return!t(i)&&t(n.urls)&&(i=n.urls.map(function(e){return{url:e}})),t(i)&&(r[e]={baseMapLayers:i,thumbnailUrl:n.thumbnailUrl,title:n.title}),r})},i.createMap=function(e,t){return r.require(["esri/map","esri/geometry/Extent"]).then(function(r){var i=r[0],o=r[1];return t&&t.hasOwnProperty("extent")&&(t.extent=n(t.extent,o)),new i(e,t)})},i.createWebMap=function(t,i,o,a){var s=e.defer();return r.require(["esri/arcgis/utils","esri/geometry/Extent"],function(e,r){o.hasOwnProperty("extent")&&(o.extent=n(o.extent,r)),e.createMap(t,i,{mapOptions:o}).then(function(r){a.layerInfos=e.getLegendLayers(r),a.itemInfo=r.itemInfo,s.resolve(r.map)})}),s.promise},i}])}(angular),function(e){"use strict";e.module("esri.core").factory("esriLayerUtils",["esriLoader",function(e){function r(e){var r;return"string"==typeof e&&(r=[],e.split(",").forEach(function(e){var t=parseInt(e);isNaN(t)||r.push(t)})),r}function t(e,r){return"esri.InfoTemplate"===e.declaredClass?e:e instanceof Array&&2===e.length?new r(e[0],e[1]):new r(e.title,e.content)}var n={};return n.createFeatureLayer=function(r,n){return e.require(["esri/layers/FeatureLayer","esri/InfoTemplate"]).then(function(e){var i=e[0],o=e[1];return n&&(n.infoTemplate&&(n.infoTemplate=t(n.infoTemplate,o)),n.hasOwnProperty("mode")&&(n.mode=i[n.mode])),new i(r,n)})},n.createVectorTileLayer=function(r,t){return e.require(["esri/layers/VectorTileLayer"]).then(function(e){var n=e[0];return new n(r,t)})},n.createDynamicMapServiceLayer=function(n,i,o){return e.require(["esri/layers/ArcGISDynamicMapServiceLayer","esri/InfoTemplate","esri/layers/ImageParameters"]).then(function(e){var a,s=e[0],c=e[1],u=e[2];if(i){if(i.infoTemplates)for(var l in i.infoTemplates)i.infoTemplates.hasOwnProperty(l)&&(i.infoTemplates[l].infoTemplate=t(i.infoTemplates[l].infoTemplate,c));if("object"==typeof i.imageParameters&&"esri.layers.ImageParameters"!==i.imageParameters.declaredClass){var f=new u;for(var p in i.imageParameters)i.imageParameters.hasOwnProperty(p)&&(f[p]=i.imageParameters[p]);i.imageParameters=f}}return a=new s(n,i),o&&a.setVisibleLayers(r(o)),a})},n.createInfoTemplate=function(r){return e.require("esri/InfoTemplate").then(function(e){return t(r,e)})},n}])}(angular),function(e){"use strict";e.module("esri.map",["esri.core"])}(angular),function(e){"use strict";e.module("esri.map").controller("EsriMapController",["$attrs","$timeout","esriMapUtils","esriRegistry",function(r,t,n,i){function o(e){return"undefined"==typeof e}function a(e,r){var t=r.geographicExtent&&r.geographicExtent.getCenter();t&&(t=t.normalize(),e.center={lat:t.y,lng:t.x}),e.zoom=r.getZoom()}var s,c=r;this.getMapOptions=function(){var e=this.mapOptions()||{};return this.basemap&&(e.basemap=this.basemap),this.center&&(this.center.lng&&this.center.lat?e.center=[this.center.lng,this.center.lat]:e.center=this.center),this.zoom&&(e.zoom=this.zoom),e},this.getMap=function(){return s},this.addLayer=function(e,r){return this.getMap().then(function(t){return t.addLayer(e,r)})},this.removeLayer=function(e){return this.getMap().then(function(r){return r.removeLayer(e)})},this.addLayerInfo=function(e){this.layerInfos?this.layerInfos.unshift(e):this.layerInfos=[e]},this.getLayerInfos=function(){return this.layerInfos},this.bindMapEvents=function(e,r){var n=this;this.getMap().then(function(i){i.loaded?(a(n,i),r.load&&n.load()(i)):r.load&&i.on("load",function(){e.$apply(function(){n.load()(i)})}),i.on("extent-change",function(o){r.extentChange&&n.extentChange()(o),n.inUpdateCycle||(n.inUpdateCycle=!0,e.$applyAsync(function(){a(n,i),t(function(){n.inUpdateCycle=!1},0)}))}),e.$watch("mapCtrl.basemap",function(e,r){i.loaded&&e!==r&&i.setBasemap(e)}),n.inUpdateCycle=!1,o(r.center)&&o(r.zoom)||e.$watchGroup(["mapCtrl.center.lng","mapCtrl.center.lat","mapCtrl.zoom"],function(e){n.inUpdateCycle||""!==e[0]&&""!==e[1]&&""!==e[2]&&(n.inUpdateCycle=!0,i.centerAndZoom([e[0],e[1]],e[2]).then(function(){n.inUpdateCycle=!1}))}),e.$on("$destroy",function(){n.deregister&&n.deregister(),i.destroy()})})},this.$onInit=function(){s=this.webmapId?n.createWebMap(this.webmapId,c.id,this.getMapOptions(),this):n.createMap(c.id,this.getMapOptions()),c.registerAs&&(this.deregister=i._register(c.registerAs,s))},1===e.version.major&&e.version.minor<5&&this.$onInit()}])}(angular),function(e){"use strict";e.module("esri.map").directive("esriMap",function(){return{restrict:"E",scope:{center:"=?",zoom:"=?",itemInfo:"=?",basemap:"@",webmapId:"@?",load:"&",extentChange:"&",mapOptions:"&"},controllerAs:"mapCtrl",bindToController:!0,controller:"EsriMapController",compile:function(e,r){return e.removeAttr("id"),e.append("<div id="+r.id+"></div>"),function(e,r,t,n){n.bindMapEvents(e,t)}}}})}(angular),function(e){"use strict";e.module("esri.map").directive("esriLegend",["$q","esriLoader",function(e,r){return{priority:-10,restrict:"EA",require:["?esriLegend","^esriMap"],replace:!0,scope:{},controllerAs:"legendCtrl",bindToController:!0,controller:function(){},link:function(t,n,i,o){var a=o[1],s=i.targetId||i.id,c=e.defer();r.require(["esri/dijit/Legend"],function(e){a.getMap().then(function(r){var n=function(r){var n,i={map:r},o=a.getLayerInfos();o&&(i.layerInfos=o),n=new e(i,s),n.startup(),t.$watchCollection(function(){return a.getLayerInfos()},function(e){n.refresh(e)}),c.resolve(n),t.$on("$destroy",function(){n.destroy()})};r.loaded?n(r):r.on("load",function(){n(r)})})})}}}])}(angular),function(e){"use strict";e.module("esri.map").controller("EsriLayerControllerBase",function(){function e(e){return e===!0||"true"===e}this.getLayerOptions=function(){var r=this.layerOptions()||{};return"undefined"!=typeof this.visible&&(r.visible=e(this.visible)),this.opacity&&(r.opacity=Number(this.opacity)),r},this.getLayerInfo=function(e,r){return{title:r.title||e.name,layer:e,hideLayers:r.hideLayers?r.hideLayers.split(",").map(Number):void 0,defaultSymbol:!r.defaultSymbol||JSON.parse(r.defaultSymbol)}},this._bindLayerEvents=function(r,t,n,i){t.load&&(n.loaded?r.layerCtrl.load()(n):n.on("load",function(){r.$apply(function(){r.layerCtrl.load()(n)})})),t.updateEnd&&n.on("update-end",function(e){r.$apply(function(){r.layerCtrl.updateEnd()(e)})}),r.$watch("layerCtrl.visible",function(r,t){r!==t&&n.setVisibility(e(r))}),r.$watch("layerCtrl.opacity",function(e,r){e!==r&&n.setOpacity(Number(e))}),r.$on("$destroy",function(){i.removeLayer(n)})}})}(angular),function(e){"use strict";e.module("esri.map").controller("EsriFeatureLayerController",["$controller","esriLayerUtils",function(r,t){var n;e.extend(this,r("EsriLayerControllerBase")),this.getFeatureLayerOptions=function(){var e=this.getLayerOptions();return this.definitionExpression&&(e.definitionExpression=this.definitionExpression),e},this.getLayer=function(){return n},this.setInfoTemplate=function(e){return this.getLayer().then(function(r){return t.createInfoTemplate(e).then(function(e){return r.setInfoTemplate(e),e})})},this.bindLayerEvents=function(e,r,t,n){this._bindLayerEvents(e,r,t,n),e.$watch("layerCtrl.definitionExpression",function(e,r){e!==r&&t.setDefinitionExpression(e)})},this.$onInit=function(){n=t.createFeatureLayer(this.url,this.getFeatureLayerOptions())},1===e.version.major&&e.version.minor<5&&this.$onInit()}])}(angular),function(e){"use strict";e.module("esri.map").directive("esriFeatureLayer",function(){return{restrict:"E",require:["esriFeatureLayer","^esriMap"],replace:!0,scope:{url:"@",visible:"@?",opacity:"@?",definitionExpression:"@?",load:"&",updateEnd:"&",layerOptions:"&"},controllerAs:"layerCtrl",bindToController:!0,controller:"EsriFeatureLayerController",link:function(e,r,t,n){var i=n[0],o=n[1];i.getLayer().then(function(r){var n=i.getLayerInfo(r,t);o.addLayer(r,0),o.addLayerInfo(n),i.bindLayerEvents(e,t,r,o)})}}})}(angular),function(e){"use strict";e.module("esri.map").controller("EsriDynamicMapServiceLayerController",["$controller","esriLayerUtils",function(r,t){var n;e.extend(this,r("EsriLayerControllerBase")),this.getLayer=function(){return n},this.setInfoTemplate=function(e,r){return this.getLayer().then(function(n){return t.createInfoTemplate(r).then(function(r){var t=n.infoTemplates;return t||(t={}),t[e]={infoTemplate:r},n.setInfoTemplates(t),t})})},this.bindLayerEvents=function(e,r,t,n){this._bindLayerEvents(e,r,t,n)},this.$onInit=function(){n=t.createDynamicMapServiceLayer(this.url,this.getLayerOptions(),this.visibleLayers)},1===e.version.major&&e.version.minor<5&&this.$onInit()}])}(angular),function(e){"use strict";e.module("esri.map").directive("esriDynamicMapServiceLayer",function(){return{restrict:"E",require:["esriDynamicMapServiceLayer","^esriMap"],replace:!0,scope:{url:"@",visible:"@?",opacity:"@?",visibleLayers:"@?",load:"&",updateEnd:"&",layerOptions:"&"},controllerAs:"layerCtrl",bindToController:!0,controller:"EsriDynamicMapServiceLayerController",link:function(e,r,t,n){var i=n[0],o=n[1];i.getLayer().then(function(r){var n=i.getLayerInfo(r,t);o.addLayer(r),o.addLayerInfo(n),i.bindLayerEvents(e,t,r,o)})}}})}(angular),function(e){"use strict";e.module("esri.map").controller("EsriVectorTileLayerController",["$controller","esriLayerUtils",function(r,t){var n;e.extend(this,r("EsriLayerControllerBase")),this.getLayer=function(){return n},this.bindLayerEvents=function(e,r,t,n){this._bindLayerEvents(e,r,t,n)},this.$onInit=function(){n=t.createVectorTileLayer(this.url,this.getLayerOptions())},1===e.version.major&&e.version.minor<5&&this.$onInit()}])}(angular),function(e){"use strict";e.module("esri.map").directive("esriVectorTileLayer",function(){return{restrict:"E",require:["esriVectorTileLayer","^esriMap"],replace:!0,scope:{url:"@",visible:"@?",opacity:"@?",load:"&",layerOptions:"&"},controllerAs:"layerCtrl",bindToController:!0,controller:"EsriVectorTileLayerController",link:function(e,r,t,n){var i=n[0],o=n[1];i.getLayer().then(function(r){var n=i.getLayerInfo(r,t);o.addLayer(r),o.addLayerInfo(n),i.bindLayerEvents(e,t,r,o)})}}})}(angular),function(e){"use strict";e.module("esri.map").directive("esriInfoTemplate",function(){return{restrict:"E",require:["?esriInfoTemplate","?^esriDynamicMapServiceLayer","?^esriFeatureLayer"],replace:!0,compile:function(e){var r=e.html();return e.html(""),function(e,t,n,i){var o=i[1],a=i[2];o&&o.setInfoTemplate(n.layerId,{title:n.title,content:r}),a&&a.setInfoTemplate({title:n.title,content:r})}}}})}(angular);
{
"name": "angular-esri-map",
"version": "1.1.8",
"version": "1.1.9",
"description": "A collection of directives to help you use Esri maps and services in your Angular applications",

@@ -5,0 +5,0 @@ "main": "dist/angular-esri-map.js",

@@ -15,8 +15,9 @@ angular-esri-map

- [Lazy Loading of the ArcGIS API for JavaScript](#lazy-loading-of-the-arcgis-api-for-javascript)
- [Development Instructions](#development-instructions)
- [Dependencies](#dependencies)
- [Resources](#resources)
- [What about Angular 2?](#what-about-angular-2)
- [What about Ionic?](#what-about-ionic)
- [Issues](#issues)
- [Contributing](#contributing)
- [Development Instructions](#development-instructions)
- [Licensing](#licensing)

@@ -34,3 +35,3 @@

<!-- load angular-esri-map from CDN -->
<script src="//unpkg.com/angular-esri-map@1"></script>
<script src="https://unpkg.com/angular-esri-map@1"></script>
```

@@ -59,3 +60,3 @@

<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="//js.arcgis.com/3.19/esri/css/esri.css">
<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.20/esri/css/esri.css">
</head>

@@ -70,7 +71,7 @@ <body ng-controller="MapController as vm">

<!-- load Esri JSAPI -->
<script src="//js.arcgis.com/3.19compact"></script>
<script src="https://js.arcgis.com/3.20compact"></script>
<!-- load AngularJS -->
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.2/angular.js"></script>
<!-- load angular-esri-map -->
<script src="//unpkg.com/angular-esri-map@1"></script>
<script src="https://unpkg.com/angular-esri-map@1"></script>

@@ -98,13 +99,2 @@ <script>

## Development Instructions
Make sure you have [Node](http://nodejs.org/) and [Gulp](https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md#getting-started) installed.
1. [Fork and clone this repo](https://help.github.com/articles/fork-a-repo)
2. `cd` into the `angular-esri-map` folder
3. Install the dependencies with `npm install`
4. run `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` folder
5. Modify the source files (under `src`) 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. `http://localhost:9002/simple-map.html`).
6. Make a [pull request](https://help.github.com/articles/creating-a-pull-request) to contribute your changes
## Dependencies

@@ -116,8 +106,6 @@

--- | --- | --- | ---
v1.0.0 | v1.3+ | [v3.12+](https://developers.arcgis.com/javascript/3/) | Test coverage included for AngularJS v1.3.
v1.1.0 | v1.3+ | [v3.15+](https://developers.arcgis.com/javascript/3/) | Test coverage included for AngularJS v1.3.
v1.0.0 | v1.3 - v1.5 | [v3.12+](https://developers.arcgis.com/javascript/3/) | Test coverage included for AngularJS v1.3.
v1.1.0 | v1.3 - v1.5 | [v3.15+](https://developers.arcgis.com/javascript/3/) |
v1.1.8 | v1.3+ | [v3.15+](https://developers.arcgis.com/javascript/3/) | 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](https://github.com/Esri/angular-esri-map/blob/v1.x/CHANGELOG.md#v118).
You will need [Node](http://nodejs.org/) and [Gulp](https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md#getting-started) to do local development.
## Resources

@@ -144,2 +132,9 @@

## What about Ionic?
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.
* [jwasilgeo/ionic-esri-map](https://github.com/jwasilgeo/ionic-esri-map): An Ionic1 app showing how to integrate a map using the angular-esri-map v1 pattern.
* [andygup/ionic2-esri-map](https://github.com/andygup/ionic2-esri-map): Example using ArcGIS API for JavaScript with Ionic2 using the angular2-esri-loader pattern with webpack.
## Issues

@@ -153,2 +148,13 @@

## Development Instructions
Make sure you have [Node](http://nodejs.org/) and [Gulp](https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md#getting-started) installed.
1. [Fork and clone this repo](https://help.github.com/articles/fork-a-repo)
2. `cd` into the `angular-esri-map` folder
3. Install the dependencies with `npm install`
4. run `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` folder
5. Modify the source files (under `src`) 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. `http://localhost:9002/simple-map.html`).
6. Make a [pull request](https://help.github.com/articles/creating-a-pull-request) to contribute your changes
## Licensing

@@ -155,0 +161,0 @@ Copyright 2014 Esri

@@ -25,3 +25,3 @@ /*global require: false*/

* @param {Object=} options Send a list of options of how to load the ArcGIS API for JavaScript.
* Defaults to `{url: '//js.arcgis.com/3.19compact'}`
* Defaults to `{url: '//js.arcgis.com/3.20compact'}`
*

@@ -45,3 +45,3 @@ * @return {Promise} Returns a $q style promise which is resolved once the ArcGIS API for JavaScript has been loaded.

script.type = 'text/javascript';
script.src = opts.url || window.location.protocol + '//js.arcgis.com/3.19compact';
script.src = opts.url || window.location.protocol + '//js.arcgis.com/3.20compact';

@@ -48,0 +48,0 @@ // Set onload callback to resolve promise

@@ -38,4 +38,4 @@ describe('esriLoader', function() {

describe('when not passing url in options', function() {
it('should default to 3.19compact', function() {
var url = window.location.protocol + '//js.arcgis.com/3.19compact';
it('should default to 3.20compact', function() {
var url = window.location.protocol + '//js.arcgis.com/3.20compact';
esriLoader.bootstrap();

@@ -42,0 +42,0 @@ expect(document.body.appendChild.calls.argsFor(0)[0].src).toEqual(url);

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc