diff --git a/dist/builds/basemaps/esri-leaflet-basemaps-src.js b/dist/builds/basemaps/esri-leaflet-basemaps-src.js
new file mode 100644
index 000000000..335be7d31
--- /dev/null
+++ b/dist/builds/basemaps/esri-leaflet-basemaps-src.js
@@ -0,0 +1,570 @@
+/*! esri-leaflet - v1.0.0-rc.6 - 2015-03-05
+* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
+* Apache License*/
+(function (factory) {
+ //define an AMD module that relies on 'leaflet'
+ if (typeof define === 'function' && define.amd) {
+ define(['leaflet'], function (L) {
+ return factory(L);
+ });
+ //define a common js module that relies on 'leaflet'
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ module.exports = factory(require('leaflet'));
+ }
+
+ if(typeof window !== 'undefined' && window.L){
+ factory(window.L);
+ }
+}(function (L) {
+var EsriLeaflet = { //jshint ignore:line
+ VERSION: '1.0.0-rc.5',
+ Layers: {},
+ Services: {},
+ Controls: {},
+ Tasks: {},
+ Util: {},
+ Support: {
+ CORS: !!(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()),
+ pointerEvents: document.documentElement.style.pointerEvents === ''
+ }
+};
+
+if(typeof window !== 'undefined' && window.L){
+ window.L.esri = EsriLeaflet;
+}
+
+
+(function(EsriLeaflet){
+
+ var callbacks = 0;
+
+ window._EsriLeafletCallbacks = {};
+
+ function serialize(params){
+ var data = '';
+
+ params.f = params.f || 'json';
+
+ for (var key in params){
+ if(params.hasOwnProperty(key)){
+ var param = params[key];
+ var type = Object.prototype.toString.call(param);
+ var value;
+
+ if(data.length){
+ data += '&';
+ }
+
+ if (type === '[object Array]'){
+ value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');
+ } else if (type === '[object Object]') {
+ value = JSON.stringify(param);
+ } else if (type === '[object Date]'){
+ value = param.valueOf();
+ } else {
+ value = param;
+ }
+
+ data += encodeURIComponent(key) + '=' + encodeURIComponent(value);
+ }
+ }
+
+ return data;
+ }
+
+ function createRequest(callback, context){
+ var httpRequest = new XMLHttpRequest();
+
+ httpRequest.onerror = function(e) {
+ httpRequest.onreadystatechange = L.Util.falseFn;
+
+ callback.call(context, {
+ error: {
+ code: 500,
+ message: 'XMLHttpRequest error'
+ }
+ }, null);
+ };
+
+ httpRequest.onreadystatechange = function(){
+ var response;
+ var error;
+
+ if (httpRequest.readyState === 4) {
+ try {
+ response = JSON.parse(httpRequest.responseText);
+ } catch(e) {
+ response = null;
+ error = {
+ code: 500,
+ message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'
+ };
+ }
+
+ if (!error && response.error) {
+ error = response.error;
+ response = null;
+ }
+
+ httpRequest.onerror = L.Util.falseFn;
+
+ callback.call(context, error, response);
+ }
+ };
+
+ return httpRequest;
+ }
+
+ // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)
+ EsriLeaflet.Request = {
+ request: function(url, params, callback, context){
+ var paramString = serialize(params);
+ var httpRequest = createRequest(callback, context);
+ var requestLength = (url + '?' + paramString).length;
+
+ // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest
+ if(requestLength <= 2000 && L.esri.Support.CORS){
+ httpRequest.open('GET', url + '?' + paramString);
+ httpRequest.send(null);
+
+ // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest
+ } else if (requestLength > 2000 && L.esri.Support.CORS){
+ httpRequest.open('POST', url);
+ httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ httpRequest.send(paramString);
+
+ // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request
+ } else if(requestLength <= 2000 && !L.esri.Support.CORS){
+ return L.esri.Request.get.JSONP(url, params, callback, context);
+
+ // request is longer then 2000 characters and the browser does not support CORS, log a warning
+ } else {
+ if(console && console.warn){
+ console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');
+ return;
+ }
+ }
+
+ return httpRequest;
+ },
+ post: {
+ XMLHTTP: function (url, params, callback, context) {
+ var httpRequest = createRequest(callback, context);
+ httpRequest.open('POST', url);
+ httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ httpRequest.send(serialize(params));
+
+ return httpRequest;
+ }
+ },
+
+ get: {
+ CORS: function (url, params, callback, context) {
+ var httpRequest = createRequest(callback, context);
+
+ httpRequest.open('GET', url + '?' + serialize(params), true);
+ httpRequest.send(null);
+
+ return httpRequest;
+ },
+ JSONP: function(url, params, callback, context){
+ var callbackId = 'c' + callbacks;
+
+ params.callback = 'window._EsriLeafletCallbacks.' + callbackId;
+
+ var script = L.DomUtil.create('script', null, document.body);
+ script.type = 'text/javascript';
+ script.src = url + '?' + serialize(params);
+ script.id = callbackId;
+
+ window._EsriLeafletCallbacks[callbackId] = function(response){
+ if(window._EsriLeafletCallbacks[callbackId] !== true){
+ var error;
+ var responseType = Object.prototype.toString.call(response);
+
+ if(!(responseType === '[object Object]' || responseType === '[object Array]')){
+ error = {
+ error: {
+ code: 500,
+ message: 'Expected array or object as JSONP response'
+ }
+ };
+ response = null;
+ }
+
+ if (!error && response.error) {
+ error = response;
+ response = null;
+ }
+
+ callback.call(context, error, response);
+ window._EsriLeafletCallbacks[callbackId] = true;
+ }
+ };
+
+ callbacks++;
+
+ return {
+ id: callbackId,
+ url: script.src,
+ abort: function(){
+ window._EsriLeafletCallbacks._callback[callbackId]({
+ code: 0,
+ message: 'Request aborted.'
+ });
+ }
+ };
+ }
+ }
+ };
+
+ // choose the correct AJAX handler depending on CORS support
+ EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;
+
+ // always use XMLHttpRequest for posts
+ EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;
+
+ // expose a common request method the uses GET\POST based on request length
+ EsriLeaflet.request = EsriLeaflet.Request.request;
+
+})(EsriLeaflet);
+
+(function(EsriLeaflet){
+
+ var tileProtocol = (window.location.protocol !== 'https:') ? 'http:' : 'https:';
+
+ EsriLeaflet.Layers.BasemapLayer = L.TileLayer.extend({
+ statics: {
+ TILES: {
+ Streets: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',
+ attributionUrl: 'https://static.arcgis.com/attribution/World_Street_Map',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 19,
+ subdomains: ['server', 'services'],
+ attribution: 'Esri'
+ }
+ },
+ Topographic: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}',
+ attributionUrl: 'https://static.arcgis.com/attribution/World_Topo_Map',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 19,
+ subdomains: ['server', 'services'],
+ attribution: 'Esri'
+ }
+ },
+ Oceans: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}',
+ attributionUrl: 'https://static.arcgis.com/attribution/Ocean_Basemap',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 16,
+ subdomains: ['server', 'services'],
+ attribution: 'Esri'
+ }
+ },
+ OceansLabels: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: true,
+ logoPosition: 'bottomright',
+ //pane: 'esri-label',
+ minZoom: 1,
+ maxZoom: 16,
+ subdomains: ['server', 'services']
+ }
+ },
+ NationalGeographic: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 16,
+ subdomains: ['server', 'services'],
+ attribution: 'Esri'
+ }
+ },
+ DarkGray: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 16,
+ subdomains: ['server', 'services'],
+ attribution: 'Esri, DeLorme, HERE'
+ }
+ },
+ DarkGrayLabels: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: true,
+ logoPosition: 'bottomright',
+ //pane: 'esri-label',
+ minZoom: 1,
+ maxZoom: 16,
+ subdomains: ['server', 'services']
+ }
+ },
+ Gray: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 16,
+ subdomains: ['server', 'services'],
+ attribution: 'Esri, NAVTEQ, DeLorme'
+ }
+ },
+ GrayLabels: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: true,
+ logoPosition: 'bottomright',
+ //pane: 'esri-label',
+ minZoom: 1,
+ maxZoom: 16,
+ subdomains: ['server', 'services']
+ }
+ },
+ Imagery: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 19,
+ subdomains: ['server', 'services'],
+ attribution: 'Esri, DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community'
+ }
+ },
+ ImageryLabels: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: true,
+ logoPosition: 'bottomright',
+ //pane: 'esri-label',
+ minZoom: 1,
+ maxZoom: 19,
+ subdomains: ['server', 'services']
+ }
+ },
+ ImageryTransportation: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}',
+ //pane: 'esri-label',
+ options: {
+ hideLogo: true,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 19,
+ subdomains: ['server', 'services']
+ }
+ },
+ ShadedRelief: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 13,
+ subdomains: ['server', 'services'],
+ attribution: 'ESRI, NAVTEQ, DeLorme'
+ }
+ },
+ ShadedReliefLabels: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: true,
+ logoPosition: 'bottomright',
+ //pane: 'esri-label',
+ minZoom: 1,
+ maxZoom: 12,
+ subdomains: ['server', 'services']
+ }
+ },
+ Terrain: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 13,
+ subdomains: ['server', 'services'],
+ attribution: 'Esri, USGS, NOAA'
+ }
+ },
+ TerrainLabels: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: true,
+ logoPosition: 'bottomright',
+ //pane: 'esri-label',
+ minZoom: 1,
+ maxZoom: 13,
+ subdomains: ['server', 'services']
+ }
+ }
+ }
+ },
+ initialize: function(key, options){
+ var config;
+
+ // set the config variable with the appropriate config object
+ if (typeof key === 'object' && key.urlTemplate && key.options){
+ config = key;
+ } else if(typeof key === 'string' && EsriLeaflet.BasemapLayer.TILES[key]){
+ config = EsriLeaflet.BasemapLayer.TILES[key];
+ } else {
+ throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of "Streets", "Topographic", "Oceans", "OceansLabels", "NationalGeographic", "Gray", "GrayLabels", "DarkGray", "DarkGrayLabels", "Imagery", "ImageryLabels", "ImageryTransportation", "ShadedRelief", "ShadedReliefLabels", "Terrain" or "TerrainLabels"');
+ }
+
+ // merge passed options into the config options
+ var tileOptions = L.Util.extend(config.options, options);
+
+ // call the initialize method on L.TileLayer to set everything up
+ L.TileLayer.prototype.initialize.call(this, config.urlTemplate, L.Util.setOptions(this, tileOptions));
+
+ // if this basemap requires dynamic attribution set it up
+ if(config.attributionUrl){
+ this._getAttributionData(config.attributionUrl);
+ }
+ this._logo = new EsriLeaflet.Controls.Logo({
+ position: this.options.logoPosition
+ });
+ },
+ onAdd: function(map){
+ if(!this.options.hideLogo && !map._hasEsriLogo){
+ this._logo.addTo(map);
+ map._hasEsriLogo = true;
+ }
+
+ // if(this.options.pane && EsriLeaflet.Support.pointerEvents){
+ // this._initPane();
+ // }
+
+ L.TileLayer.prototype.onAdd.call(this, map);
+
+ map.on('moveend', this._updateMapAttribution, this);
+ },
+ onRemove: function(map){
+ // check to make sure the logo hasn't already been removed
+ if(this._logo && this._logo._container){
+ map.removeControl(this._logo);
+ map._hasEsriLogo = false;
+ }
+
+ L.TileLayer.prototype.onRemove.call(this, map);
+
+ map.off('moveend', this._updateMapAttribution, this);
+ },
+ getAttribution:function(){
+ var attribution = '' + this.options.attribution + ''/* + logo*/;
+ return attribution;
+ },
+ // _initPane: function(){
+ // if(!this._map.getPane(this.options.pane)){
+ // var pane = this._map.createPane(this.options.pane);
+ // pane.style.pointerEvents = 'none';
+ // pane.style.zIndex = 5;
+ // }
+ // },
+ _getAttributionData: function(url){
+ EsriLeaflet.get(url, {}, function(error, attributions){
+ this._attributions = [];
+ for (var c = 0; c < attributions.contributors.length; c++) {
+ var contributor = attributions.contributors[c];
+ for (var i = 0; i < contributor.coverageAreas.length; i++) {
+ var coverageArea = contributor.coverageAreas[i];
+ var southWest = new L.LatLng(coverageArea.bbox[0], coverageArea.bbox[1]);
+ var northEast = new L.LatLng(coverageArea.bbox[2], coverageArea.bbox[3]);
+ this._attributions.push({
+ attribution: contributor.attribution,
+ score: coverageArea.score,
+ bounds: new L.LatLngBounds(southWest, northEast),
+ minZoom: coverageArea.zoomMin,
+ maxZoom: coverageArea.zoomMax
+ });
+ }
+ }
+
+ this._attributions.sort(function(a, b){
+ return b.score - a.score;
+ });
+
+ this._updateMapAttribution();
+ }, this);
+ },
+ _updateMapAttribution: function(){
+ if(this._map && this._map.attributionControl && this._attributions){
+ var newAttributions = '';
+ var bounds = this._map.getBounds();
+ var zoom = this._map.getZoom();
+
+ for (var i = 0; i < this._attributions.length; i++) {
+ var attribution = this._attributions[i];
+ var text = attribution.attribution;
+ if(!newAttributions.match(text) && bounds.intersects(attribution.bounds) && zoom >= attribution.minZoom && zoom <= attribution.maxZoom) {
+ newAttributions += (', ' + text);
+ }
+ }
+ newAttributions = newAttributions.substr(2);
+ var attributionElement = this._map.attributionControl._container.querySelector('.esri-attributions');
+ attributionElement.innerHTML = newAttributions;
+ attributionElement.style.maxWidth = (this._map.getSize().x * 0.65) + 'px';
+ this.fire('attributionupdated', {
+ attribution: newAttributions
+ });
+ }
+ }
+ });
+
+ EsriLeaflet.BasemapLayer = EsriLeaflet.Layers.BasemapLayer;
+
+ EsriLeaflet.Layers.basemapLayer = function(key, options){
+ return new EsriLeaflet.Layers.BasemapLayer(key, options);
+ };
+
+ EsriLeaflet.basemapLayer = function(key, options){
+ return new EsriLeaflet.Layers.BasemapLayer(key, options);
+ };
+
+})(EsriLeaflet);
+
+EsriLeaflet.Controls.Logo = L.Control.extend({
+ options: {
+ position: 'bottomright',
+ marginTop: 0,
+ marginLeft: 0,
+ marginBottom: 0,
+ marginRight: 0
+ },
+ onAdd: function () {
+ var div = L.DomUtil.create('div', 'esri-leaflet-logo');
+ div.style.marginTop = this.options.marginTop;
+ div.style.marginLeft = this.options.marginLeft;
+ div.style.marginBottom = this.options.marginBottom;
+ div.style.marginRight = this.options.marginRight;
+ div.innerHTML = '';
+ return div;
+ }
+});
+
+EsriLeaflet.Controls.logo = function(options){
+ return new L.esri.Controls.Logo(options);
+};
+
+
+ return EsriLeaflet;
+}));
+//# sourceMappingURL=esri-leaflet-basemaps-src.js.map
\ No newline at end of file
diff --git a/dist/builds/basemaps/esri-leaflet-basemaps-src.js.map b/dist/builds/basemaps/esri-leaflet-basemaps-src.js.map
new file mode 100644
index 000000000..5e04d6bb4
--- /dev/null
+++ b/dist/builds/basemaps/esri-leaflet-basemaps-src.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["../../../src/EsriLeaflet.js","../../../src/Request.js","../../../src/Layers/BasemapLayer.js","../../../src/Controls/Logo.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI;AACxC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;AACxB,EAAE,MAAM,CAAC,CAAC,GAAG;AACb,EAAE,QAAQ,CAAC,CAAC,GAAG;AACf,EAAE,QAAQ,CAAC,CAAC,GAAG;AACf,EAAE,KAAK,CAAC,CAAC,GAAG;AACZ,EAAE,IAAI,CAAC,CAAC,GAAG;AACX,EAAE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AC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;AACrD,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG;AAClL,IAAI,MAAM,CAAC,GAAG,CAAC;AACf,EAAE,CAAC;AACH,GAAG;AACH;AACA,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE;AAC9C,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE;AAC3C,EAAE","file":"esri-leaflet-basemaps-src.js","sourcesContent":["var EsriLeaflet = { //jshint ignore:line\n VERSION: '1.0.0-rc.5',\n Layers: {},\n Services: {},\n Controls: {},\n Tasks: {},\n Util: {},\n Support: {\n CORS: !!(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()),\n pointerEvents: document.documentElement.style.pointerEvents === ''\n }\n};\n\nif(typeof window !== 'undefined' && window.L){\n window.L.esri = EsriLeaflet;\n}\n","(function(EsriLeaflet){\n\n var callbacks = 0;\n\n window._EsriLeafletCallbacks = {};\n\n function serialize(params){\n var data = '';\n\n params.f = params.f || 'json';\n\n for (var key in params){\n if(params.hasOwnProperty(key)){\n var param = params[key];\n var type = Object.prototype.toString.call(param);\n var value;\n\n if(data.length){\n data += '&';\n }\n\n if (type === '[object Array]'){\n value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');\n } else if (type === '[object Object]') {\n value = JSON.stringify(param);\n } else if (type === '[object Date]'){\n value = param.valueOf();\n } else {\n value = param;\n }\n\n data += encodeURIComponent(key) + '=' + encodeURIComponent(value);\n }\n }\n\n return data;\n }\n\n function createRequest(callback, context){\n var httpRequest = new XMLHttpRequest();\n\n httpRequest.onerror = function(e) {\n httpRequest.onreadystatechange = L.Util.falseFn;\n\n callback.call(context, {\n error: {\n code: 500,\n message: 'XMLHttpRequest error'\n }\n }, null);\n };\n\n httpRequest.onreadystatechange = function(){\n var response;\n var error;\n\n if (httpRequest.readyState === 4) {\n try {\n response = JSON.parse(httpRequest.responseText);\n } catch(e) {\n response = null;\n error = {\n code: 500,\n message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'\n };\n }\n\n if (!error && response.error) {\n error = response.error;\n response = null;\n }\n\n httpRequest.onerror = L.Util.falseFn;\n\n callback.call(context, error, response);\n }\n };\n\n return httpRequest;\n }\n\n // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)\n EsriLeaflet.Request = {\n request: function(url, params, callback, context){\n var paramString = serialize(params);\n var httpRequest = createRequest(callback, context);\n var requestLength = (url + '?' + paramString).length;\n\n // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest\n if(requestLength <= 2000 && L.esri.Support.CORS){\n httpRequest.open('GET', url + '?' + paramString);\n httpRequest.send(null);\n\n // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest\n } else if (requestLength > 2000 && L.esri.Support.CORS){\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(paramString);\n\n // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request\n } else if(requestLength <= 2000 && !L.esri.Support.CORS){\n return L.esri.Request.get.JSONP(url, params, callback, context);\n\n // request is longer then 2000 characters and the browser does not support CORS, log a warning\n } else {\n if(console && console.warn){\n console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');\n return;\n }\n }\n\n return httpRequest;\n },\n post: {\n XMLHTTP: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(serialize(params));\n\n return httpRequest;\n }\n },\n\n get: {\n CORS: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n\n httpRequest.open('GET', url + '?' + serialize(params), true);\n httpRequest.send(null);\n\n return httpRequest;\n },\n JSONP: function(url, params, callback, context){\n var callbackId = 'c' + callbacks;\n\n params.callback = 'window._EsriLeafletCallbacks.' + callbackId;\n\n var script = L.DomUtil.create('script', null, document.body);\n script.type = 'text/javascript';\n script.src = url + '?' + serialize(params);\n script.id = callbackId;\n\n window._EsriLeafletCallbacks[callbackId] = function(response){\n if(window._EsriLeafletCallbacks[callbackId] !== true){\n var error;\n var responseType = Object.prototype.toString.call(response);\n\n if(!(responseType === '[object Object]' || responseType === '[object Array]')){\n error = {\n error: {\n code: 500,\n message: 'Expected array or object as JSONP response'\n }\n };\n response = null;\n }\n\n if (!error && response.error) {\n error = response;\n response = null;\n }\n\n callback.call(context, error, response);\n window._EsriLeafletCallbacks[callbackId] = true;\n }\n };\n\n callbacks++;\n\n return {\n id: callbackId,\n url: script.src,\n abort: function(){\n window._EsriLeafletCallbacks._callback[callbackId]({\n code: 0,\n message: 'Request aborted.'\n });\n }\n };\n }\n }\n };\n\n // choose the correct AJAX handler depending on CORS support\n EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;\n\n // always use XMLHttpRequest for posts\n EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;\n\n // expose a common request method the uses GET\\POST based on request length\n EsriLeaflet.request = EsriLeaflet.Request.request;\n\n})(EsriLeaflet);","(function(EsriLeaflet){\n\n var tileProtocol = (window.location.protocol !== 'https:') ? 'http:' : 'https:';\n\n EsriLeaflet.Layers.BasemapLayer = L.TileLayer.extend({\n statics: {\n TILES: {\n Streets: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',\n attributionUrl: 'https://static.arcgis.com/attribution/World_Street_Map',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n attribution: 'Esri'\n }\n },\n Topographic: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}',\n attributionUrl: 'https://static.arcgis.com/attribution/World_Topo_Map',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n attribution: 'Esri'\n }\n },\n Oceans: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}',\n attributionUrl: 'https://static.arcgis.com/attribution/Ocean_Basemap',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'Esri'\n }\n },\n OceansLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services']\n }\n },\n NationalGeographic: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'Esri'\n }\n },\n DarkGray: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'Esri, DeLorme, HERE'\n }\n },\n DarkGrayLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services']\n }\n },\n Gray: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'Esri, NAVTEQ, DeLorme'\n }\n },\n GrayLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services']\n }\n },\n Imagery: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n attribution: 'Esri, DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community'\n }\n },\n ImageryLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services']\n }\n },\n ImageryTransportation: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}',\n //pane: 'esri-label',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services']\n }\n },\n ShadedRelief: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 13,\n subdomains: ['server', 'services'],\n attribution: 'ESRI, NAVTEQ, DeLorme'\n }\n },\n ShadedReliefLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 12,\n subdomains: ['server', 'services']\n }\n },\n Terrain: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 13,\n subdomains: ['server', 'services'],\n attribution: 'Esri, USGS, NOAA'\n }\n },\n TerrainLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 13,\n subdomains: ['server', 'services']\n }\n }\n }\n },\n initialize: function(key, options){\n var config;\n\n // set the config variable with the appropriate config object\n if (typeof key === 'object' && key.urlTemplate && key.options){\n config = key;\n } else if(typeof key === 'string' && EsriLeaflet.BasemapLayer.TILES[key]){\n config = EsriLeaflet.BasemapLayer.TILES[key];\n } else {\n throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of \"Streets\", \"Topographic\", \"Oceans\", \"OceansLabels\", \"NationalGeographic\", \"Gray\", \"GrayLabels\", \"DarkGray\", \"DarkGrayLabels\", \"Imagery\", \"ImageryLabels\", \"ImageryTransportation\", \"ShadedRelief\", \"ShadedReliefLabels\", \"Terrain\" or \"TerrainLabels\"');\n }\n\n // merge passed options into the config options\n var tileOptions = L.Util.extend(config.options, options);\n\n // call the initialize method on L.TileLayer to set everything up\n L.TileLayer.prototype.initialize.call(this, config.urlTemplate, L.Util.setOptions(this, tileOptions));\n\n // if this basemap requires dynamic attribution set it up\n if(config.attributionUrl){\n this._getAttributionData(config.attributionUrl);\n }\n this._logo = new EsriLeaflet.Controls.Logo({\n position: this.options.logoPosition\n });\n },\n onAdd: function(map){\n if(!this.options.hideLogo && !map._hasEsriLogo){\n this._logo.addTo(map);\n map._hasEsriLogo = true;\n }\n\n // if(this.options.pane && EsriLeaflet.Support.pointerEvents){\n // this._initPane();\n // }\n\n L.TileLayer.prototype.onAdd.call(this, map);\n\n map.on('moveend', this._updateMapAttribution, this);\n },\n onRemove: function(map){\n // check to make sure the logo hasn't already been removed\n if(this._logo && this._logo._container){\n map.removeControl(this._logo);\n map._hasEsriLogo = false;\n }\n\n L.TileLayer.prototype.onRemove.call(this, map);\n\n map.off('moveend', this._updateMapAttribution, this);\n },\n getAttribution:function(){\n var attribution = '' + this.options.attribution + ''/* + logo*/;\n return attribution;\n },\n // _initPane: function(){\n // if(!this._map.getPane(this.options.pane)){\n // var pane = this._map.createPane(this.options.pane);\n // pane.style.pointerEvents = 'none';\n // pane.style.zIndex = 5;\n // }\n // },\n _getAttributionData: function(url){\n EsriLeaflet.get(url, {}, function(error, attributions){\n this._attributions = [];\n for (var c = 0; c < attributions.contributors.length; c++) {\n var contributor = attributions.contributors[c];\n for (var i = 0; i < contributor.coverageAreas.length; i++) {\n var coverageArea = contributor.coverageAreas[i];\n var southWest = new L.LatLng(coverageArea.bbox[0], coverageArea.bbox[1]);\n var northEast = new L.LatLng(coverageArea.bbox[2], coverageArea.bbox[3]);\n this._attributions.push({\n attribution: contributor.attribution,\n score: coverageArea.score,\n bounds: new L.LatLngBounds(southWest, northEast),\n minZoom: coverageArea.zoomMin,\n maxZoom: coverageArea.zoomMax\n });\n }\n }\n\n this._attributions.sort(function(a, b){\n return b.score - a.score;\n });\n\n this._updateMapAttribution();\n }, this);\n },\n _updateMapAttribution: function(){\n if(this._map && this._map.attributionControl && this._attributions){\n var newAttributions = '';\n var bounds = this._map.getBounds();\n var zoom = this._map.getZoom();\n\n for (var i = 0; i < this._attributions.length; i++) {\n var attribution = this._attributions[i];\n var text = attribution.attribution;\n if(!newAttributions.match(text) && bounds.intersects(attribution.bounds) && zoom >= attribution.minZoom && zoom <= attribution.maxZoom) {\n newAttributions += (', ' + text);\n }\n }\n newAttributions = newAttributions.substr(2);\n var attributionElement = this._map.attributionControl._container.querySelector('.esri-attributions');\n attributionElement.innerHTML = newAttributions;\n attributionElement.style.maxWidth = (this._map.getSize().x * 0.65) + 'px';\n this.fire('attributionupdated', {\n attribution: newAttributions\n });\n }\n }\n });\n\n EsriLeaflet.BasemapLayer = EsriLeaflet.Layers.BasemapLayer;\n\n EsriLeaflet.Layers.basemapLayer = function(key, options){\n return new EsriLeaflet.Layers.BasemapLayer(key, options);\n };\n\n EsriLeaflet.basemapLayer = function(key, options){\n return new EsriLeaflet.Layers.BasemapLayer(key, options);\n };\n\n})(EsriLeaflet);","EsriLeaflet.Controls.Logo = L.Control.extend({\n options: {\n position: 'bottomright',\n marginTop: 0,\n marginLeft: 0,\n marginBottom: 0,\n marginRight: 0\n },\n onAdd: function () {\n var div = L.DomUtil.create('div', 'esri-leaflet-logo');\n div.style.marginTop = this.options.marginTop;\n div.style.marginLeft = this.options.marginLeft;\n div.style.marginBottom = this.options.marginBottom;\n div.style.marginRight = this.options.marginRight;\n div.innerHTML = '';\n return div;\n }\n});\n\nEsriLeaflet.Controls.logo = function(options){\n return new L.esri.Controls.Logo(options);\n};\n"]}
\ No newline at end of file
diff --git a/dist/builds/basemaps/esri-leaflet-basemaps.js b/dist/builds/basemaps/esri-leaflet-basemaps.js
new file mode 100644
index 000000000..cd143b5b8
--- /dev/null
+++ b/dist/builds/basemaps/esri-leaflet-basemaps.js
@@ -0,0 +1,24 @@
+/*! esri-leaflet - v1.0.0-rc.6 - 2015-03-05
+* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
+* Apache License*/
+(function (factory) {
+ //define an AMD module that relies on 'leaflet'
+ if (typeof define === 'function' && define.amd) {
+ define(['leaflet'], function (L) {
+ return factory(L);
+ });
+ //define a common js module that relies on 'leaflet'
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ module.exports = factory(require('leaflet'));
+ }
+
+ if(typeof window !== 'undefined' && window.L){
+ factory(window.L);
+ }
+}(function (L) {
+
+var EsriLeaflet={VERSION:"1.0.0-rc.5",Layers:{},Services:{},Controls:{},Tasks:{},Util:{},Support:{CORS:!!(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),pointerEvents:""===document.documentElement.style.pointerEvents}};"undefined"!=typeof window&&window.L&&(window.L.esri=EsriLeaflet),function(a){function b(a){var b="";a.f=a.f||"json";for(var c in a)if(a.hasOwnProperty(c)){var d,e=a[c],f=Object.prototype.toString.call(e);b.length&&(b+="&"),d="[object Array]"===f?"[object Object]"===Object.prototype.toString.call(e[0])?JSON.stringify(e):e.join(","):"[object Object]"===f?JSON.stringify(e):"[object Date]"===f?e.valueOf():e,b+=encodeURIComponent(c)+"="+encodeURIComponent(d)}return b}function c(a,b){var c=new XMLHttpRequest;return c.onerror=function(){c.onreadystatechange=L.Util.falseFn,a.call(b,{error:{code:500,message:"XMLHttpRequest error"}},null)},c.onreadystatechange=function(){var d,e;if(4===c.readyState){try{d=JSON.parse(c.responseText)}catch(f){d=null,e={code:500,message:"Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error."}}!e&&d.error&&(e=d.error,d=null),c.onerror=L.Util.falseFn,a.call(b,e,d)}},c}var d=0;window._EsriLeafletCallbacks={},a.Request={request:function(a,d,e,f){var g=b(d),h=c(e,f),i=(a+"?"+g).length;if(2e3>=i&&L.esri.Support.CORS)h.open("GET",a+"?"+g),h.send(null);else if(i>2e3&&L.esri.Support.CORS)h.open("POST",a),h.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),h.send(g);else{if(2e3>=i&&!L.esri.Support.CORS)return L.esri.Request.get.JSONP(a,d,e,f);if(console&&console.warn)return void console.warn("a request to "+a+" was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html")}return h},post:{XMLHTTP:function(a,d,e,f){var g=c(e,f);return g.open("POST",a),g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),g.send(b(d)),g}},get:{CORS:function(a,d,e,f){var g=c(e,f);return g.open("GET",a+"?"+b(d),!0),g.send(null),g},JSONP:function(a,c,e,f){var g="c"+d;c.callback="window._EsriLeafletCallbacks."+g;var h=L.DomUtil.create("script",null,document.body);return h.type="text/javascript",h.src=a+"?"+b(c),h.id=g,window._EsriLeafletCallbacks[g]=function(a){if(window._EsriLeafletCallbacks[g]!==!0){var b,c=Object.prototype.toString.call(a);"[object Object]"!==c&&"[object Array]"!==c&&(b={error:{code:500,message:"Expected array or object as JSONP response"}},a=null),!b&&a.error&&(b=a,a=null),e.call(f,b,a),window._EsriLeafletCallbacks[g]=!0}},d++,{id:g,url:h.src,abort:function(){window._EsriLeafletCallbacks._callback[g]({code:0,message:"Request aborted."})}}}}},a.get=a.Support.CORS?a.Request.get.CORS:a.Request.get.JSONP,a.post=a.Request.post.XMLHTTP,a.request=a.Request.request}(EsriLeaflet),function(a){var b="https:"!==window.location.protocol?"http:":"https:";a.Layers.BasemapLayer=L.TileLayer.extend({statics:{TILES:{Streets:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",attributionUrl:"https://static.arcgis.com/attribution/World_Street_Map",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"Esri"}},Topographic:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}",attributionUrl:"https://static.arcgis.com/attribution/World_Topo_Map",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"Esri"}},Oceans:{urlTemplate:b+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}",attributionUrl:"https://static.arcgis.com/attribution/Ocean_Basemap",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"Esri"}},OceansLabels:{urlTemplate:b+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"]}},NationalGeographic:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"Esri"}},DarkGray:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"Esri, DeLorme, HERE"}},DarkGrayLabels:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"]}},Gray:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"Esri, NAVTEQ, DeLorme"}},GrayLabels:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"]}},Imagery:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"Esri, DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community"}},ImageryLabels:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:19,subdomains:["server","services"]}},ImageryTransportation:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:19,subdomains:["server","services"]}},ShadedRelief:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"ESRI, NAVTEQ, DeLorme"}},ShadedReliefLabels:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:12,subdomains:["server","services"]}},Terrain:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"Esri, USGS, NOAA"}},TerrainLabels:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:13,subdomains:["server","services"]}}}},initialize:function(b,c){var d;if("object"==typeof b&&b.urlTemplate&&b.options)d=b;else{if("string"!=typeof b||!a.BasemapLayer.TILES[b])throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of "Streets", "Topographic", "Oceans", "OceansLabels", "NationalGeographic", "Gray", "GrayLabels", "DarkGray", "DarkGrayLabels", "Imagery", "ImageryLabels", "ImageryTransportation", "ShadedRelief", "ShadedReliefLabels", "Terrain" or "TerrainLabels"');d=a.BasemapLayer.TILES[b]}var e=L.Util.extend(d.options,c);L.TileLayer.prototype.initialize.call(this,d.urlTemplate,L.Util.setOptions(this,e)),d.attributionUrl&&this._getAttributionData(d.attributionUrl),this._logo=new a.Controls.Logo({position:this.options.logoPosition})},onAdd:function(a){this.options.hideLogo||a._hasEsriLogo||(this._logo.addTo(a),a._hasEsriLogo=!0),L.TileLayer.prototype.onAdd.call(this,a),a.on("moveend",this._updateMapAttribution,this)},onRemove:function(a){this._logo&&this._logo._container&&(a.removeControl(this._logo),a._hasEsriLogo=!1),L.TileLayer.prototype.onRemove.call(this,a),a.off("moveend",this._updateMapAttribution,this)},getAttribution:function(){var a=''+this.options.attribution+"";return a},_getAttributionData:function(b){a.get(b,{},function(a,b){this._attributions=[];for(var c=0;c=e.minZoom&&c<=e.maxZoom&&(a+=", "+f)}a=a.substr(2);var g=this._map.attributionControl._container.querySelector(".esri-attributions");g.innerHTML=a,g.style.maxWidth=.65*this._map.getSize().x+"px",this.fire("attributionupdated",{attribution:a})}}}),a.BasemapLayer=a.Layers.BasemapLayer,a.Layers.basemapLayer=function(b,c){return new a.Layers.BasemapLayer(b,c)},a.basemapLayer=function(b,c){return new a.Layers.BasemapLayer(b,c)}}(EsriLeaflet),EsriLeaflet.Controls.Logo=L.Control.extend({options:{position:"bottomright",marginTop:0,marginLeft:0,marginBottom:0,marginRight:0},onAdd:function(){var a=L.DomUtil.create("div","esri-leaflet-logo");return a.style.marginTop=this.options.marginTop,a.style.marginLeft=this.options.marginLeft,a.style.marginBottom=this.options.marginBottom,a.style.marginRight=this.options.marginRight,a.innerHTML='',a}}),EsriLeaflet.Controls.logo=function(a){return new L.esri.Controls.Logo(a)};
+//# sourceMappingURL=esri-leaflet-basemaps.js.map
+
+ return EsriLeaflet;
+}));
\ No newline at end of file
diff --git a/dist/builds/basemaps/esri-leaflet-basemaps.js.map b/dist/builds/basemaps/esri-leaflet-basemaps.js.map
new file mode 100644
index 000000000..2b9f28f57
--- /dev/null
+++ b/dist/builds/basemaps/esri-leaflet-basemaps.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"esri-leaflet-basemaps.js","sources":["../../../src/EsriLeaflet.js","../../../src/Request.js","../../../src/Layers/BasemapLayer.js","../../../src/Controls/Logo.js"],"names":["EsriLeaflet","VERSION","Layers","Services","Controls","Tasks","Util","Support","CORS","window","XMLHttpRequest","pointerEvents","document","documentElement","style","L","esri","serialize","params","data","f","key","hasOwnProperty","value","param","type","Object","prototype","toString","call","length","JSON","stringify","join","valueOf","encodeURIComponent","createRequest","callback","context","httpRequest","onerror","onreadystatechange","falseFn","error","code","message","response","readyState","parse","responseText","e","callbacks","_EsriLeafletCallbacks","Request","request","url","paramString","requestLength","open","send","setRequestHeader","get","JSONP","console","warn","post","XMLHTTP","callbackId","script","DomUtil","create","body","src","id","responseType","abort","_callback","tileProtocol","location","protocol","BasemapLayer","TileLayer","extend","statics","TILES","Streets","urlTemplate","attributionUrl","options","hideLogo","logoPosition","minZoom","maxZoom","subdomains","attribution","Topographic","Oceans","OceansLabels","NationalGeographic","DarkGray","DarkGrayLabels","Gray","GrayLabels","Imagery","ImageryLabels","ImageryTransportation","ShadedRelief","ShadedReliefLabels","Terrain","TerrainLabels","initialize","config","Error","tileOptions","this","setOptions","_getAttributionData","_logo","Logo","position","onAdd","map","_hasEsriLogo","addTo","on","_updateMapAttribution","onRemove","_container","removeControl","off","getAttribution","attributions","_attributions","c","contributors","contributor","i","coverageAreas","coverageArea","southWest","LatLng","bbox","northEast","push","score","bounds","LatLngBounds","zoomMin","zoomMax","sort","a","b","_map","attributionControl","newAttributions","getBounds","zoom","getZoom","text","match","intersects","substr","attributionElement","querySelector","innerHTML","maxWidth","getSize","x","fire","basemapLayer","Control","marginTop","marginLeft","marginBottom","marginRight","div","logo"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,GAAIA,cACFC,QAAS,aACTC,UACAC,YACAC,YACAC,SACAC,QACAC,SACEC,QAASC,OAAOC,gBAAkB,mBAAqB,IAAIA,iBAC3DC,cAAgE,KAAjDC,SAASC,gBAAgBC,MAAMH,eAI7B,oBAAXF,SAA0BA,OAAOM,IACzCN,OAAOM,EAAEC,KAAOhB,aCdlB,SAAUA,GAMR,QAASiB,GAAUC,GACjB,GAAIC,GAAO,EAEXD,GAAOE,EAAIF,EAAOE,GAAK,MAEvB,KAAK,GAAIC,KAAOH,GACd,GAAGA,EAAOI,eAAeD,GAAK,CAC5B,GAEIE,GAFAC,EAAQN,EAAOG,GACfI,EAAOC,OAAOC,UAAUC,SAASC,KAAKL,EAGvCL,GAAKW,SACNX,GAAQ,KAIRI,EADW,mBAATE,EACoD,oBAA7CC,OAAOC,UAAUC,SAASC,KAAKL,EAAM,IAA6BO,KAAKC,UAAUR,GAASA,EAAMS,KAAK,KAC5F,oBA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WACL,GAAIuD,GAAMhK,EAAEsD,QAAQC,OAAO,MAAO,oBAMlC,OALAyG,GAAIjK,MAAM6J,UAAYzD,KAAK1B,QAAQmF,UACnCI,EAAIjK,MAAM8J,WAAa1D,KAAK1B,QAAQoF,WACpCG,EAAIjK,MAAM+J,aAAe3D,KAAK1B,QAAQqF,aACtCE,EAAIjK,MAAMgK,YAAc5D,KAAK1B,QAAQsF,YACrCC,EAAIX,UAAY,8JACTW,KAIX/K,YAAYI,SAAS4K,KAAO,SAASxF,GACnC,MAAO,IAAIzE,GAAEC,KAAKZ,SAASkH,KAAK9B","sourcesContent":["var EsriLeaflet = { //jshint ignore:line\n VERSION: '1.0.0-rc.5',\n Layers: {},\n Services: {},\n Controls: {},\n Tasks: {},\n Util: {},\n Support: {\n CORS: !!(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()),\n pointerEvents: document.documentElement.style.pointerEvents === ''\n }\n};\n\nif(typeof window !== 'undefined' && window.L){\n window.L.esri = EsriLeaflet;\n}\n","(function(EsriLeaflet){\n\n var callbacks = 0;\n\n window._EsriLeafletCallbacks = {};\n\n function serialize(params){\n var data = '';\n\n params.f = params.f || 'json';\n\n for (var key in params){\n if(params.hasOwnProperty(key)){\n var param = params[key];\n var type = Object.prototype.toString.call(param);\n var value;\n\n if(data.length){\n data += '&';\n }\n\n if (type === '[object Array]'){\n value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');\n } else if (type === '[object Object]') {\n value = JSON.stringify(param);\n } else if (type === '[object Date]'){\n value = param.valueOf();\n } else {\n value = param;\n }\n\n data += encodeURIComponent(key) + '=' + encodeURIComponent(value);\n }\n }\n\n return data;\n }\n\n function createRequest(callback, context){\n var httpRequest = new XMLHttpRequest();\n\n httpRequest.onerror = function(e) {\n httpRequest.onreadystatechange = L.Util.falseFn;\n\n callback.call(context, {\n error: {\n code: 500,\n message: 'XMLHttpRequest error'\n }\n }, null);\n };\n\n httpRequest.onreadystatechange = function(){\n var response;\n var error;\n\n if (httpRequest.readyState === 4) {\n try {\n response = JSON.parse(httpRequest.responseText);\n } catch(e) {\n response = null;\n error = {\n code: 500,\n message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'\n };\n }\n\n if (!error && response.error) {\n error = response.error;\n response = null;\n }\n\n httpRequest.onerror = L.Util.falseFn;\n\n callback.call(context, error, response);\n }\n };\n\n return httpRequest;\n }\n\n // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)\n EsriLeaflet.Request = {\n request: function(url, params, callback, context){\n var paramString = serialize(params);\n var httpRequest = createRequest(callback, context);\n var requestLength = (url + '?' + paramString).length;\n\n // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest\n if(requestLength <= 2000 && L.esri.Support.CORS){\n httpRequest.open('GET', url + '?' + paramString);\n httpRequest.send(null);\n\n // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest\n } else if (requestLength > 2000 && L.esri.Support.CORS){\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(paramString);\n\n // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request\n } else if(requestLength <= 2000 && !L.esri.Support.CORS){\n return L.esri.Request.get.JSONP(url, params, callback, context);\n\n // request is longer then 2000 characters and the browser does not support CORS, log a warning\n } else {\n if(console && console.warn){\n console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');\n return;\n }\n }\n\n return httpRequest;\n },\n post: {\n XMLHTTP: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(serialize(params));\n\n return httpRequest;\n }\n },\n\n get: {\n CORS: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n\n httpRequest.open('GET', url + '?' + serialize(params), true);\n httpRequest.send(null);\n\n return httpRequest;\n },\n JSONP: function(url, params, callback, context){\n var callbackId = 'c' + callbacks;\n\n params.callback = 'window._EsriLeafletCallbacks.' + callbackId;\n\n var script = L.DomUtil.create('script', null, document.body);\n script.type = 'text/javascript';\n script.src = url + '?' + serialize(params);\n script.id = callbackId;\n\n window._EsriLeafletCallbacks[callbackId] = function(response){\n if(window._EsriLeafletCallbacks[callbackId] !== true){\n var error;\n var responseType = Object.prototype.toString.call(response);\n\n if(!(responseType === '[object Object]' || responseType === '[object Array]')){\n error = {\n error: {\n code: 500,\n message: 'Expected array or object as JSONP response'\n }\n };\n response = null;\n }\n\n if (!error && response.error) {\n error = response;\n response = null;\n }\n\n callback.call(context, error, response);\n window._EsriLeafletCallbacks[callbackId] = true;\n }\n };\n\n callbacks++;\n\n return {\n id: callbackId,\n url: script.src,\n abort: function(){\n window._EsriLeafletCallbacks._callback[callbackId]({\n code: 0,\n message: 'Request aborted.'\n });\n }\n };\n }\n }\n };\n\n // choose the correct AJAX handler depending on CORS support\n EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;\n\n // always use XMLHttpRequest for posts\n EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;\n\n // expose a common request method the uses GET\\POST based on request length\n EsriLeaflet.request = EsriLeaflet.Request.request;\n\n})(EsriLeaflet);","(function(EsriLeaflet){\n\n var tileProtocol = (window.location.protocol !== 'https:') ? 'http:' : 'https:';\n\n EsriLeaflet.Layers.BasemapLayer = L.TileLayer.extend({\n statics: {\n TILES: {\n Streets: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',\n attributionUrl: 'https://static.arcgis.com/attribution/World_Street_Map',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n attribution: 'Esri'\n }\n },\n Topographic: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}',\n attributionUrl: 'https://static.arcgis.com/attribution/World_Topo_Map',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n attribution: 'Esri'\n }\n },\n Oceans: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}',\n attributionUrl: 'https://static.arcgis.com/attribution/Ocean_Basemap',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'Esri'\n }\n },\n OceansLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services']\n }\n },\n NationalGeographic: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'Esri'\n }\n },\n DarkGray: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'Esri, DeLorme, HERE'\n }\n },\n DarkGrayLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services']\n }\n },\n Gray: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'Esri, NAVTEQ, DeLorme'\n }\n },\n GrayLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services']\n }\n },\n Imagery: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n attribution: 'Esri, DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community'\n }\n },\n ImageryLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services']\n }\n },\n ImageryTransportation: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}',\n //pane: 'esri-label',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services']\n }\n },\n ShadedRelief: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 13,\n subdomains: ['server', 'services'],\n attribution: 'ESRI, NAVTEQ, DeLorme'\n }\n },\n ShadedReliefLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 12,\n subdomains: ['server', 'services']\n }\n },\n Terrain: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 13,\n subdomains: ['server', 'services'],\n attribution: 'Esri, USGS, NOAA'\n }\n },\n TerrainLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 13,\n subdomains: ['server', 'services']\n }\n }\n }\n },\n initialize: function(key, options){\n var config;\n\n // set the config variable with the appropriate config object\n if (typeof key === 'object' && key.urlTemplate && key.options){\n config = key;\n } else if(typeof key === 'string' && EsriLeaflet.BasemapLayer.TILES[key]){\n config = EsriLeaflet.BasemapLayer.TILES[key];\n } else {\n throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of \"Streets\", \"Topographic\", \"Oceans\", \"OceansLabels\", \"NationalGeographic\", \"Gray\", \"GrayLabels\", \"DarkGray\", \"DarkGrayLabels\", \"Imagery\", \"ImageryLabels\", \"ImageryTransportation\", \"ShadedRelief\", \"ShadedReliefLabels\", \"Terrain\" or \"TerrainLabels\"');\n }\n\n // merge passed options into the config options\n var tileOptions = L.Util.extend(config.options, options);\n\n // call the initialize method on L.TileLayer to set everything up\n L.TileLayer.prototype.initialize.call(this, config.urlTemplate, L.Util.setOptions(this, tileOptions));\n\n // if this basemap requires dynamic attribution set it up\n if(config.attributionUrl){\n this._getAttributionData(config.attributionUrl);\n }\n this._logo = new EsriLeaflet.Controls.Logo({\n position: this.options.logoPosition\n });\n },\n onAdd: function(map){\n if(!this.options.hideLogo && !map._hasEsriLogo){\n this._logo.addTo(map);\n map._hasEsriLogo = true;\n }\n\n // if(this.options.pane && EsriLeaflet.Support.pointerEvents){\n // this._initPane();\n // }\n\n L.TileLayer.prototype.onAdd.call(this, map);\n\n map.on('moveend', this._updateMapAttribution, this);\n },\n onRemove: function(map){\n // check to make sure the logo hasn't already been removed\n if(this._logo && this._logo._container){\n map.removeControl(this._logo);\n map._hasEsriLogo = false;\n }\n\n L.TileLayer.prototype.onRemove.call(this, map);\n\n map.off('moveend', this._updateMapAttribution, this);\n },\n getAttribution:function(){\n var attribution = '' + this.options.attribution + ''/* + logo*/;\n return attribution;\n },\n // _initPane: function(){\n // if(!this._map.getPane(this.options.pane)){\n // var pane = this._map.createPane(this.options.pane);\n // pane.style.pointerEvents = 'none';\n // pane.style.zIndex = 5;\n // }\n // },\n _getAttributionData: function(url){\n EsriLeaflet.get(url, {}, function(error, attributions){\n this._attributions = [];\n for (var c = 0; c < attributions.contributors.length; c++) {\n var contributor = attributions.contributors[c];\n for (var i = 0; i < contributor.coverageAreas.length; i++) {\n var coverageArea = contributor.coverageAreas[i];\n var southWest = new L.LatLng(coverageArea.bbox[0], coverageArea.bbox[1]);\n var northEast = new L.LatLng(coverageArea.bbox[2], coverageArea.bbox[3]);\n this._attributions.push({\n attribution: contributor.attribution,\n score: coverageArea.score,\n bounds: new L.LatLngBounds(southWest, northEast),\n minZoom: coverageArea.zoomMin,\n maxZoom: coverageArea.zoomMax\n });\n }\n }\n\n this._attributions.sort(function(a, b){\n return b.score - a.score;\n });\n\n this._updateMapAttribution();\n }, this);\n },\n _updateMapAttribution: function(){\n if(this._map && this._map.attributionControl && this._attributions){\n var newAttributions = '';\n var bounds = this._map.getBounds();\n var zoom = this._map.getZoom();\n\n for (var i = 0; i < this._attributions.length; i++) {\n var attribution = this._attributions[i];\n var text = attribution.attribution;\n if(!newAttributions.match(text) && bounds.intersects(attribution.bounds) && zoom >= attribution.minZoom && zoom <= attribution.maxZoom) {\n newAttributions += (', ' + text);\n }\n }\n newAttributions = newAttributions.substr(2);\n var attributionElement = this._map.attributionControl._container.querySelector('.esri-attributions');\n attributionElement.innerHTML = newAttributions;\n attributionElement.style.maxWidth = (this._map.getSize().x * 0.65) + 'px';\n this.fire('attributionupdated', {\n attribution: newAttributions\n });\n }\n }\n });\n\n EsriLeaflet.BasemapLayer = EsriLeaflet.Layers.BasemapLayer;\n\n EsriLeaflet.Layers.basemapLayer = function(key, options){\n return new EsriLeaflet.Layers.BasemapLayer(key, options);\n };\n\n EsriLeaflet.basemapLayer = function(key, options){\n return new EsriLeaflet.Layers.BasemapLayer(key, options);\n };\n\n})(EsriLeaflet);","EsriLeaflet.Controls.Logo = L.Control.extend({\n options: {\n position: 'bottomright',\n marginTop: 0,\n marginLeft: 0,\n marginBottom: 0,\n marginRight: 0\n },\n onAdd: function () {\n var div = L.DomUtil.create('div', 'esri-leaflet-logo');\n div.style.marginTop = this.options.marginTop;\n div.style.marginLeft = this.options.marginLeft;\n div.style.marginBottom = this.options.marginBottom;\n div.style.marginRight = this.options.marginRight;\n div.innerHTML = '';\n return div;\n }\n});\n\nEsriLeaflet.Controls.logo = function(options){\n return new L.esri.Controls.Logo(options);\n};\n"]}
\ No newline at end of file
diff --git a/dist/builds/core/esri-leaflet-core-src.js b/dist/builds/core/esri-leaflet-core-src.js
new file mode 100644
index 000000000..fe3eb13fa
--- /dev/null
+++ b/dist/builds/core/esri-leaflet-core-src.js
@@ -0,0 +1,855 @@
+/*! esri-leaflet - v1.0.0-rc.6 - 2015-03-05
+* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
+* Apache License*/
+(function (factory) {
+ //define an AMD module that relies on 'leaflet'
+ if (typeof define === 'function' && define.amd) {
+ define(['leaflet'], function (L) {
+ return factory(L);
+ });
+ //define a common js module that relies on 'leaflet'
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ module.exports = factory(require('leaflet'));
+ }
+
+ if(typeof window !== 'undefined' && window.L){
+ factory(window.L);
+ }
+}(function (L) {
+var EsriLeaflet = { //jshint ignore:line
+ VERSION: '1.0.0-rc.5',
+ Layers: {},
+ Services: {},
+ Controls: {},
+ Tasks: {},
+ Util: {},
+ Support: {
+ CORS: !!(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()),
+ pointerEvents: document.documentElement.style.pointerEvents === ''
+ }
+};
+
+if(typeof window !== 'undefined' && window.L){
+ window.L.esri = EsriLeaflet;
+}
+
+
+(function(EsriLeaflet){
+
+ // normalize request animation frame
+ var raf = window.requestAnimationFrame ||
+ window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.msRequestAnimationFrame ||
+ function(cb) { return window.setTimeout(cb, 1000 / 60); };
+
+ // shallow object clone for feature properties and attributes
+ // from http://jsperf.com/cloning-an-object/2
+ function clone(obj) {
+ var target = {};
+ for (var i in obj) {
+ if (obj.hasOwnProperty(i)) {
+ target[i] = obj[i];
+ }
+ }
+ return target;
+ }
+
+ // checks if 2 x,y points are equal
+ function pointsEqual(a, b) {
+ for (var i = 0; i < a.length; i++) {
+ if (a[i] !== b[i]) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ // checks if the first and last points of a ring are equal and closes the ring
+ function closeRing(coordinates) {
+ if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {
+ coordinates.push(coordinates[0]);
+ }
+ return coordinates;
+ }
+
+ // determine if polygon ring coordinates are clockwise. clockwise signifies outer ring, counter-clockwise an inner ring
+ // or hole. this logic was found at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-
+ // points-are-in-clockwise-order
+ function ringIsClockwise(ringToTest) {
+ var total = 0,i = 0;
+ var rLength = ringToTest.length;
+ var pt1 = ringToTest[i];
+ var pt2;
+ for (i; i < rLength - 1; i++) {
+ pt2 = ringToTest[i + 1];
+ total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);
+ pt1 = pt2;
+ }
+ return (total >= 0);
+ }
+
+ // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L504-L519
+ function vertexIntersectsVertex(a1, a2, b1, b2) {
+ var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);
+ var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);
+ var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);
+
+ if ( uB !== 0 ) {
+ var ua = uaT / uB;
+ var ub = ubT / uB;
+
+ if ( 0 <= ua && ua <= 1 && 0 <= ub && ub <= 1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L521-L531
+ function arrayIntersectsArray(a, b) {
+ for (var i = 0; i < a.length - 1; i++) {
+ for (var j = 0; j < b.length - 1; j++) {
+ if (vertexIntersectsVertex(a[i], a[i + 1], b[j], b[j + 1])) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L470-L480
+ function coordinatesContainPoint(coordinates, point) {
+ var contains = false;
+ for(var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {
+ if (((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||
+ (coordinates[j][1] <= point[1] && point[1] < coordinates[i][1])) &&
+ (point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0])) {
+ contains = !contains;
+ }
+ }
+ return contains;
+ }
+
+ // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L106-L113
+ function coordinatesContainCoordinates(outer, inner){
+ var intersects = arrayIntersectsArray(outer, inner);
+ var contains = coordinatesContainPoint(outer, inner[0]);
+ if(!intersects && contains){
+ return true;
+ }
+ return false;
+ }
+
+ // do any polygons in this array contain any other polygons in this array?
+ // used for checking for holes in arcgis rings
+ // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L117-L172
+ function convertRingsToGeoJSON(rings){
+ var outerRings = [];
+ var holes = [];
+ var x; // iterator
+ var outerRing; // current outer ring being evaluated
+ var hole; // current hole being evaluated
+
+ // for each ring
+ for (var r = 0; r < rings.length; r++) {
+ var ring = closeRing(rings[r].slice(0));
+ if(ring.length < 4){
+ continue;
+ }
+ // is this ring an outer ring? is it clockwise?
+ if(ringIsClockwise(ring)){
+ var polygon = [ ring ];
+ outerRings.push(polygon); // push to outer rings
+ } else {
+ holes.push(ring); // counterclockwise push to holes
+ }
+ }
+
+ var uncontainedHoles = [];
+
+ // while there are holes left...
+ while(holes.length){
+ // pop a hole off out stack
+ hole = holes.pop();
+
+ // loop over all outer rings and see if they contain our hole.
+ var contained = false;
+ for (x = outerRings.length - 1; x >= 0; x--) {
+ outerRing = outerRings[x][0];
+ if(coordinatesContainCoordinates(outerRing, hole)){
+ // the hole is contained push it into our polygon
+ outerRings[x].push(hole);
+ contained = true;
+ break;
+ }
+ }
+
+ // ring is not contained in any outer ring
+ // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320
+ if(!contained){
+ uncontainedHoles.push(hole);
+ }
+ }
+
+ // if we couldn't match any holes using contains we can try intersects...
+ while(uncontainedHoles.length){
+ // pop a hole off out stack
+ hole = uncontainedHoles.pop();
+
+ // loop over all outer rings and see if any intersect our hole.
+ var intersects = false;
+ for (x = outerRings.length - 1; x >= 0; x--) {
+ outerRing = outerRings[x][0];
+ if(arrayIntersectsArray(outerRing, hole)){
+ // the hole is contained push it into our polygon
+ outerRings[x].push(hole);
+ intersects = true;
+ break;
+ }
+ }
+
+ if(!intersects) {
+ outerRings.push([hole.reverse()]);
+ }
+ }
+
+ if(outerRings.length === 1){
+ return {
+ type: 'Polygon',
+ coordinates: outerRings[0]
+ };
+ } else {
+ return {
+ type: 'MultiPolygon',
+ coordinates: outerRings
+ };
+ }
+ }
+
+ // This function ensures that rings are oriented in the right directions
+ // outer rings are clockwise, holes are counterclockwise
+ // used for converting GeoJSON Polygons to ArcGIS Polygons
+ function orientRings(poly){
+ var output = [];
+ var polygon = poly.slice(0);
+ var outerRing = closeRing(polygon.shift().slice(0));
+ if(outerRing.length >= 4){
+ if(!ringIsClockwise(outerRing)){
+ outerRing.reverse();
+ }
+
+ output.push(outerRing);
+
+ for (var i = 0; i < polygon.length; i++) {
+ var hole = closeRing(polygon[i].slice(0));
+ if(hole.length >= 4){
+ if(ringIsClockwise(hole)){
+ hole.reverse();
+ }
+ output.push(hole);
+ }
+ }
+ }
+
+ return output;
+ }
+
+ // This function flattens holes in multipolygons to one array of polygons
+ // used for converting GeoJSON Polygons to ArcGIS Polygons
+ function flattenMultiPolygonRings(rings){
+ var output = [];
+ for (var i = 0; i < rings.length; i++) {
+ var polygon = orientRings(rings[i]);
+ for (var x = polygon.length - 1; x >= 0; x--) {
+ var ring = polygon[x].slice(0);
+ output.push(ring);
+ }
+ }
+ return output;
+ }
+
+ // convert an extent (ArcGIS) to LatLngBounds (Leaflet)
+ EsriLeaflet.Util.extentToBounds = function(extent){
+ var sw = new L.LatLng(extent.ymin, extent.xmin);
+ var ne = new L.LatLng(extent.ymax, extent.xmax);
+ return new L.LatLngBounds(sw, ne);
+ };
+
+ // convert an LatLngBounds (Leaflet) to extent (ArcGIS)
+ EsriLeaflet.Util.boundsToExtent = function(bounds) {
+ bounds = L.latLngBounds(bounds);
+ return {
+ 'xmin': bounds.getSouthWest().lng,
+ 'ymin': bounds.getSouthWest().lat,
+ 'xmax': bounds.getNorthEast().lng,
+ 'ymax': bounds.getNorthEast().lat,
+ 'spatialReference': {
+ 'wkid' : 4326
+ }
+ };
+ };
+
+ EsriLeaflet.Util.arcgisToGeojson = function (arcgis, idAttribute){
+ var geojson = {};
+
+ if(typeof arcgis.x === 'number' && typeof arcgis.y === 'number'){
+ geojson.type = 'Point';
+ geojson.coordinates = [arcgis.x, arcgis.y];
+ }
+
+ if(arcgis.points){
+ geojson.type = 'MultiPoint';
+ geojson.coordinates = arcgis.points.slice(0);
+ }
+
+ if(arcgis.paths) {
+ if(arcgis.paths.length === 1){
+ geojson.type = 'LineString';
+ geojson.coordinates = arcgis.paths[0].slice(0);
+ } else {
+ geojson.type = 'MultiLineString';
+ geojson.coordinates = arcgis.paths.slice(0);
+ }
+ }
+
+ if(arcgis.rings) {
+ geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));
+ }
+
+ if(arcgis.geometry || arcgis.attributes) {
+ geojson.type = 'Feature';
+ geojson.geometry = (arcgis.geometry) ? EsriLeaflet.Util.arcgisToGeojson(arcgis.geometry) : null;
+ geojson.properties = (arcgis.attributes) ? clone(arcgis.attributes) : null;
+ if(arcgis.attributes) {
+ geojson.id = arcgis.attributes[idAttribute] || arcgis.attributes.OBJECTID || arcgis.attributes.FID;
+ }
+ }
+
+ return geojson;
+ };
+
+ // GeoJSON -> ArcGIS
+ EsriLeaflet.Util.geojsonToArcGIS = function(geojson, idAttribute){
+ idAttribute = idAttribute || 'OBJECTID';
+ var spatialReference = { wkid: 4326 };
+ var result = {};
+ var i;
+
+ switch(geojson.type){
+ case 'Point':
+ result.x = geojson.coordinates[0];
+ result.y = geojson.coordinates[1];
+ result.spatialReference = spatialReference;
+ break;
+ case 'MultiPoint':
+ result.points = geojson.coordinates.slice(0);
+ result.spatialReference = spatialReference;
+ break;
+ case 'LineString':
+ result.paths = [geojson.coordinates.slice(0)];
+ result.spatialReference = spatialReference;
+ break;
+ case 'MultiLineString':
+ result.paths = geojson.coordinates.slice(0);
+ result.spatialReference = spatialReference;
+ break;
+ case 'Polygon':
+ result.rings = orientRings(geojson.coordinates.slice(0));
+ result.spatialReference = spatialReference;
+ break;
+ case 'MultiPolygon':
+ result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));
+ result.spatialReference = spatialReference;
+ break;
+ case 'Feature':
+ if(geojson.geometry) {
+ result.geometry = EsriLeaflet.Util.geojsonToArcGIS(geojson.geometry, idAttribute);
+ }
+ result.attributes = (geojson.properties) ? clone(geojson.properties) : {};
+ if(geojson.id){
+ result.attributes[idAttribute] = geojson.id;
+ }
+ break;
+ case 'FeatureCollection':
+ result = [];
+ for (i = 0; i < geojson.features.length; i++){
+ result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.features[i], idAttribute));
+ }
+ break;
+ case 'GeometryCollection':
+ result = [];
+ for (i = 0; i < geojson.geometries.length; i++){
+ result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.geometries[i], idAttribute));
+ }
+ break;
+ }
+
+ return result;
+ };
+
+ EsriLeaflet.Util.responseToFeatureCollection = function(response, idAttribute){
+ var objectIdField;
+
+ if(idAttribute){
+ objectIdField = idAttribute;
+ } else if(response.objectIdFieldName){
+ objectIdField = response.objectIdFieldName;
+ } else if(response.fields) {
+ for (var j = 0; j <= response.fields.length - 1; j++) {
+ if(response.fields[j].type === 'esriFieldTypeOID') {
+ objectIdField = response.fields[j].name;
+ break;
+ }
+ }
+ } else {
+ objectIdField = 'OBJECTID';
+ }
+
+ var featureCollection = {
+ type: 'FeatureCollection',
+ features: []
+ };
+ var features = response.features || response.results;
+ if(features.length){
+ for (var i = features.length - 1; i >= 0; i--) {
+ featureCollection.features.push(EsriLeaflet.Util.arcgisToGeojson(features[i], objectIdField));
+ }
+ }
+
+ return featureCollection;
+ };
+
+ // trim whitespace and add a tailing slash is needed to a url
+ EsriLeaflet.Util.cleanUrl = function(url){
+ url = url.replace(/\s\s*/g, '');
+
+ //add a trailing slash to the url if the user omitted it
+ if(url[url.length-1] !== '/'){
+ url += '/';
+ }
+
+ return url;
+ };
+
+ EsriLeaflet.Util.isArcgisOnline = function(url){
+ return (/\.arcgis\.com/g).test(url);
+ };
+
+ EsriLeaflet.Util.geojsonTypeToArcGIS = function (geoJsonType) {
+ var arcgisGeometryType;
+ switch (geoJsonType) {
+ case 'Point':
+ arcgisGeometryType = 'esriGeometryPoint';
+ break;
+ case 'MultiPoint':
+ arcgisGeometryType = 'esriGeometryMultipoint';
+ break;
+ case 'LineString':
+ arcgisGeometryType = 'esriGeometryPolyline';
+ break;
+ case 'MultiLineString':
+ arcgisGeometryType = 'esriGeometryPolyline';
+ break;
+ case 'Polygon':
+ arcgisGeometryType = 'esriGeometryPolygon';
+ break;
+ case 'MultiPolygon':
+ arcgisGeometryType = 'esriGeometryPolygon';
+ break;
+ }
+ return arcgisGeometryType;
+ };
+
+ EsriLeaflet.Util.requestAnimationFrame = L.Util.bind(raf, window);
+
+})(EsriLeaflet);
+
+(function(EsriLeaflet){
+
+ var callbacks = 0;
+
+ window._EsriLeafletCallbacks = {};
+
+ function serialize(params){
+ var data = '';
+
+ params.f = params.f || 'json';
+
+ for (var key in params){
+ if(params.hasOwnProperty(key)){
+ var param = params[key];
+ var type = Object.prototype.toString.call(param);
+ var value;
+
+ if(data.length){
+ data += '&';
+ }
+
+ if (type === '[object Array]'){
+ value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');
+ } else if (type === '[object Object]') {
+ value = JSON.stringify(param);
+ } else if (type === '[object Date]'){
+ value = param.valueOf();
+ } else {
+ value = param;
+ }
+
+ data += encodeURIComponent(key) + '=' + encodeURIComponent(value);
+ }
+ }
+
+ return data;
+ }
+
+ function createRequest(callback, context){
+ var httpRequest = new XMLHttpRequest();
+
+ httpRequest.onerror = function(e) {
+ httpRequest.onreadystatechange = L.Util.falseFn;
+
+ callback.call(context, {
+ error: {
+ code: 500,
+ message: 'XMLHttpRequest error'
+ }
+ }, null);
+ };
+
+ httpRequest.onreadystatechange = function(){
+ var response;
+ var error;
+
+ if (httpRequest.readyState === 4) {
+ try {
+ response = JSON.parse(httpRequest.responseText);
+ } catch(e) {
+ response = null;
+ error = {
+ code: 500,
+ message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'
+ };
+ }
+
+ if (!error && response.error) {
+ error = response.error;
+ response = null;
+ }
+
+ httpRequest.onerror = L.Util.falseFn;
+
+ callback.call(context, error, response);
+ }
+ };
+
+ return httpRequest;
+ }
+
+ // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)
+ EsriLeaflet.Request = {
+ request: function(url, params, callback, context){
+ var paramString = serialize(params);
+ var httpRequest = createRequest(callback, context);
+ var requestLength = (url + '?' + paramString).length;
+
+ // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest
+ if(requestLength <= 2000 && L.esri.Support.CORS){
+ httpRequest.open('GET', url + '?' + paramString);
+ httpRequest.send(null);
+
+ // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest
+ } else if (requestLength > 2000 && L.esri.Support.CORS){
+ httpRequest.open('POST', url);
+ httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ httpRequest.send(paramString);
+
+ // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request
+ } else if(requestLength <= 2000 && !L.esri.Support.CORS){
+ return L.esri.Request.get.JSONP(url, params, callback, context);
+
+ // request is longer then 2000 characters and the browser does not support CORS, log a warning
+ } else {
+ if(console && console.warn){
+ console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');
+ return;
+ }
+ }
+
+ return httpRequest;
+ },
+ post: {
+ XMLHTTP: function (url, params, callback, context) {
+ var httpRequest = createRequest(callback, context);
+ httpRequest.open('POST', url);
+ httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ httpRequest.send(serialize(params));
+
+ return httpRequest;
+ }
+ },
+
+ get: {
+ CORS: function (url, params, callback, context) {
+ var httpRequest = createRequest(callback, context);
+
+ httpRequest.open('GET', url + '?' + serialize(params), true);
+ httpRequest.send(null);
+
+ return httpRequest;
+ },
+ JSONP: function(url, params, callback, context){
+ var callbackId = 'c' + callbacks;
+
+ params.callback = 'window._EsriLeafletCallbacks.' + callbackId;
+
+ var script = L.DomUtil.create('script', null, document.body);
+ script.type = 'text/javascript';
+ script.src = url + '?' + serialize(params);
+ script.id = callbackId;
+
+ window._EsriLeafletCallbacks[callbackId] = function(response){
+ if(window._EsriLeafletCallbacks[callbackId] !== true){
+ var error;
+ var responseType = Object.prototype.toString.call(response);
+
+ if(!(responseType === '[object Object]' || responseType === '[object Array]')){
+ error = {
+ error: {
+ code: 500,
+ message: 'Expected array or object as JSONP response'
+ }
+ };
+ response = null;
+ }
+
+ if (!error && response.error) {
+ error = response;
+ response = null;
+ }
+
+ callback.call(context, error, response);
+ window._EsriLeafletCallbacks[callbackId] = true;
+ }
+ };
+
+ callbacks++;
+
+ return {
+ id: callbackId,
+ url: script.src,
+ abort: function(){
+ window._EsriLeafletCallbacks._callback[callbackId]({
+ code: 0,
+ message: 'Request aborted.'
+ });
+ }
+ };
+ }
+ }
+ };
+
+ // choose the correct AJAX handler depending on CORS support
+ EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;
+
+ // always use XMLHttpRequest for posts
+ EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;
+
+ // expose a common request method the uses GET\POST based on request length
+ EsriLeaflet.request = EsriLeaflet.Request.request;
+
+})(EsriLeaflet);
+
+EsriLeaflet.Tasks.Task = L.Class.extend({
+
+ options: {
+ proxy: false,
+ useCors: EsriLeaflet.Support.CORS
+ },
+
+ //Generate a method for each methodName:paramName in the setters for this task.
+ generateSetter: function(param, context){
+ return L.Util.bind(function(value){
+ this.params[param] = value;
+ return this;
+ }, context);
+ },
+
+ initialize: function(endpoint){
+ // endpoint can be either a url (and options) for an ArcGIS Rest Service or an instance of EsriLeaflet.Service
+ if(endpoint.request && endpoint.options){
+ this._service = endpoint;
+ L.Util.setOptions(this, endpoint.options);
+ } else {
+ L.Util.setOptions(this, endpoint);
+ this.options.url = L.esri.Util.cleanUrl(endpoint.url);
+ }
+
+ // clone default params into this object
+ this.params = L.Util.extend({}, this.params || {});
+
+ // generate setter methods based on the setters object implimented a child class
+ if(this.setters){
+ for (var setter in this.setters){
+ var param = this.setters[setter];
+ this[setter] = this.generateSetter(param, this);
+ }
+ }
+ },
+
+ token: function(token){
+ if(this._service){
+ this._service.authenticate(token);
+ } else {
+ this.params.token = token;
+ }
+ return this;
+ },
+
+ request: function(callback, context){
+ if(this._service){
+ return this._service.request(this.path, this.params, callback, context);
+ } else {
+ return this._request('request', this.path, this.params, callback, context);
+ }
+ },
+
+ _request: function(method, path, params, callback, context){
+ var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;
+ if((method === 'get' || method === 'request') && !this.options.useCors){
+ return EsriLeaflet.Request.get.JSONP(url, params, callback, context);
+ } else{
+ return EsriLeaflet[method](url, params, callback, context);
+ }
+ }
+});
+
+EsriLeaflet.Services.Service = L.Class.extend({
+
+ includes: L.Mixin.Events,
+
+ options: {
+ proxy: false,
+ useCors: EsriLeaflet.Support.CORS
+ },
+
+ initialize: function (options) {
+ options = options || {};
+ this._requestQueue = [];
+ this._authenticating = false;
+ L.Util.setOptions(this, options);
+ this.options.url = EsriLeaflet.Util.cleanUrl(this.options.url);
+ },
+
+ get: function (path, params, callback, context) {
+ return this._request('get', path, params, callback, context);
+ },
+
+ post: function (path, params, callback, context) {
+ return this._request('post', path, params, callback, context);
+ },
+
+ request: function (path, params, callback, context) {
+ return this._request('request', path, params, callback, context);
+ },
+
+ metadata: function (callback, context) {
+ return this._request('get', '', {}, callback, context);
+ },
+
+ authenticate: function(token){
+ this._authenticating = false;
+ this.options.token = token;
+ this._runQueue();
+ return this;
+ },
+
+ _request: function(method, path, params, callback, context){
+ this.fire('requeststart', {
+ url: this.options.url + path,
+ params: params,
+ method: method
+ });
+
+ var wrappedCallback = this._createServiceCallback(method, path, params, callback, context);
+
+ if (this.options.token) {
+ params.token = this.options.token;
+ }
+
+ if (this._authenticating) {
+ this._requestQueue.push([method, path, params, callback, context]);
+ return;
+ } else {
+ var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;
+
+ if((method === 'get' || method === 'request') && !this.options.useCors){
+ return EsriLeaflet.Request.get.JSONP(url, params, wrappedCallback);
+ } else {
+ return EsriLeaflet[method](url, params, wrappedCallback);
+ }
+ }
+ },
+
+ _createServiceCallback: function(method, path, params, callback, context){
+ var request = [method, path, params, callback, context];
+
+ return L.Util.bind(function(error, response){
+
+ if (error && (error.code === 499 || error.code === 498)) {
+ this._authenticating = true;
+
+ this._requestQueue.push(request);
+
+ this.fire('authenticationrequired', {
+ authenticate: L.Util.bind(this.authenticate, this)
+ });
+ } else {
+ callback.call(context, error, response);
+
+ if(error) {
+ this.fire('requesterror', {
+ url: this.options.url + path,
+ params: params,
+ message: error.message,
+ code: error.code,
+ method: method
+ });
+ } else {
+ this.fire('requestsuccess', {
+ url: this.options.url + path,
+ params: params,
+ response: response,
+ method: method
+ });
+ }
+
+ this.fire('requestend', {
+ url: this.options.url + path,
+ params: params,
+ method: method
+ });
+ }
+ }, this);
+ },
+
+ _runQueue: function(){
+ for (var i = this._requestQueue.length - 1; i >= 0; i--) {
+ var request = this._requestQueue[i];
+ var method = request.shift();
+ this[method].apply(this, request);
+ }
+ this._requestQueue = [];
+ }
+
+});
+
+EsriLeaflet.Services.service = function(params){
+ return new EsriLeaflet.Services.Service(params);
+};
+
+ return EsriLeaflet;
+}));
+//# sourceMappingURL=esri-leaflet-core-src.js.map
\ No newline at end of file
diff --git a/dist/builds/core/esri-leaflet-core-src.js.map b/dist/builds/core/esri-leaflet-core-src.js.map
new file mode 100644
index 000000000..075d3cff2
--- /dev/null
+++ b/dist/builds/core/esri-leaflet-core-src.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["../../../src/EsriLeaflet.js","../../../src/Util.js","../../../src/Request.js","../../../src/Tasks/Task.js","../../../src/Services/Service.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI;AACxC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;AACxB,EAAE,MAAM,CAAC,CAAC,GAAG;AACb,EAAE,QAAQ,CAAC,CAAC,GAAG;AACf,EAAE,QAAQ,CAAC,CAAC,GAAG;AACf,EAAE,KAAK,CAAC,CAAC,GAAG;AACZ,EAAE,IAAI,CAAC,CAAC,GAAG;AACX,EAAE,OAAO,CAAC,CAAC,CAAC;AACZ,IAAI,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,cAAc,IAAI;AACjF,IAAI,aAAa,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE;AACtE,EAAE,CAAC;AACH,EAAE;AACF;AACA,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE;AAC9C,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC;AAC9B,CAAC;;;ACfD,CAAC,QAAQ,CAAC,WAAW,EAAE;AACvB;AACA,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,KA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AC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC9D,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE;AAC1C,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,GAAG;AACnC,MAAM,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE;AACxC,IAAI,CAAC;AACL,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG;AAC5B,EAAE,CAAC;AACH;AACA,GAAG;AACH;AACA,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE;AAChD,EAAE,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE;AAClD,E","file":"esri-leaflet-core-src.js","sourcesContent":["var EsriLeaflet = { //jshint ignore:line\n VERSION: '1.0.0-rc.5',\n Layers: {},\n Services: {},\n Controls: {},\n Tasks: {},\n Util: {},\n Support: {\n CORS: !!(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()),\n pointerEvents: document.documentElement.style.pointerEvents === ''\n }\n};\n\nif(typeof window !== 'undefined' && window.L){\n window.L.esri = EsriLeaflet;\n}\n","(function(EsriLeaflet){\n\n // normalize request animation frame\n var raf = window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function(cb) { return window.setTimeout(cb, 1000 / 60); };\n\n // shallow object clone for feature properties and attributes\n // from http://jsperf.com/cloning-an-object/2\n function clone(obj) {\n var target = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n target[i] = obj[i];\n }\n }\n return target;\n }\n\n // checks if 2 x,y points are equal\n function pointsEqual(a, b) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n }\n\n // checks if the first and last points of a ring are equal and closes the ring\n function closeRing(coordinates) {\n if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {\n coordinates.push(coordinates[0]);\n }\n return coordinates;\n }\n\n // determine if polygon ring coordinates are clockwise. clockwise signifies outer ring, counter-clockwise an inner ring\n // or hole. this logic was found at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-\n // points-are-in-clockwise-order\n function ringIsClockwise(ringToTest) {\n var total = 0,i = 0;\n var rLength = ringToTest.length;\n var pt1 = ringToTest[i];\n var pt2;\n for (i; i < rLength - 1; i++) {\n pt2 = ringToTest[i + 1];\n total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);\n pt1 = pt2;\n }\n return (total >= 0);\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L504-L519\n function vertexIntersectsVertex(a1, a2, b1, b2) {\n var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);\n var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);\n var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);\n\n if ( uB !== 0 ) {\n var ua = uaT / uB;\n var ub = ubT / uB;\n\n if ( 0 <= ua && ua <= 1 && 0 <= ub && ub <= 1 ) {\n return true;\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L521-L531\n function arrayIntersectsArray(a, b) {\n for (var i = 0; i < a.length - 1; i++) {\n for (var j = 0; j < b.length - 1; j++) {\n if (vertexIntersectsVertex(a[i], a[i + 1], b[j], b[j + 1])) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L470-L480\n function coordinatesContainPoint(coordinates, point) {\n var contains = false;\n for(var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {\n if (((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||\n (coordinates[j][1] <= point[1] && point[1] < coordinates[i][1])) &&\n (point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0])) {\n contains = !contains;\n }\n }\n return contains;\n }\n\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L106-L113\n function coordinatesContainCoordinates(outer, inner){\n var intersects = arrayIntersectsArray(outer, inner);\n var contains = coordinatesContainPoint(outer, inner[0]);\n if(!intersects && contains){\n return true;\n }\n return false;\n }\n\n // do any polygons in this array contain any other polygons in this array?\n // used for checking for holes in arcgis rings\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L117-L172\n function convertRingsToGeoJSON(rings){\n var outerRings = [];\n var holes = [];\n var x; // iterator\n var outerRing; // current outer ring being evaluated\n var hole; // current hole being evaluated\n\n // for each ring\n for (var r = 0; r < rings.length; r++) {\n var ring = closeRing(rings[r].slice(0));\n if(ring.length < 4){\n continue;\n }\n // is this ring an outer ring? is it clockwise?\n if(ringIsClockwise(ring)){\n var polygon = [ ring ];\n outerRings.push(polygon); // push to outer rings\n } else {\n holes.push(ring); // counterclockwise push to holes\n }\n }\n\n var uncontainedHoles = [];\n\n // while there are holes left...\n while(holes.length){\n // pop a hole off out stack\n hole = holes.pop();\n\n // loop over all outer rings and see if they contain our hole.\n var contained = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(coordinatesContainCoordinates(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n contained = true;\n break;\n }\n }\n\n // ring is not contained in any outer ring\n // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320\n if(!contained){\n uncontainedHoles.push(hole);\n }\n }\n\n // if we couldn't match any holes using contains we can try intersects...\n while(uncontainedHoles.length){\n // pop a hole off out stack\n hole = uncontainedHoles.pop();\n\n // loop over all outer rings and see if any intersect our hole.\n var intersects = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(arrayIntersectsArray(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n intersects = true;\n break;\n }\n }\n\n if(!intersects) {\n outerRings.push([hole.reverse()]);\n }\n }\n\n if(outerRings.length === 1){\n return {\n type: 'Polygon',\n coordinates: outerRings[0]\n };\n } else {\n return {\n type: 'MultiPolygon',\n coordinates: outerRings\n };\n }\n }\n\n // This function ensures that rings are oriented in the right directions\n // outer rings are clockwise, holes are counterclockwise\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function orientRings(poly){\n var output = [];\n var polygon = poly.slice(0);\n var outerRing = closeRing(polygon.shift().slice(0));\n if(outerRing.length >= 4){\n if(!ringIsClockwise(outerRing)){\n outerRing.reverse();\n }\n\n output.push(outerRing);\n\n for (var i = 0; i < polygon.length; i++) {\n var hole = closeRing(polygon[i].slice(0));\n if(hole.length >= 4){\n if(ringIsClockwise(hole)){\n hole.reverse();\n }\n output.push(hole);\n }\n }\n }\n\n return output;\n }\n\n // This function flattens holes in multipolygons to one array of polygons\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function flattenMultiPolygonRings(rings){\n var output = [];\n for (var i = 0; i < rings.length; i++) {\n var polygon = orientRings(rings[i]);\n for (var x = polygon.length - 1; x >= 0; x--) {\n var ring = polygon[x].slice(0);\n output.push(ring);\n }\n }\n return output;\n }\n\n // convert an extent (ArcGIS) to LatLngBounds (Leaflet)\n EsriLeaflet.Util.extentToBounds = function(extent){\n var sw = new L.LatLng(extent.ymin, extent.xmin);\n var ne = new L.LatLng(extent.ymax, extent.xmax);\n return new L.LatLngBounds(sw, ne);\n };\n\n // convert an LatLngBounds (Leaflet) to extent (ArcGIS)\n EsriLeaflet.Util.boundsToExtent = function(bounds) {\n bounds = L.latLngBounds(bounds);\n return {\n 'xmin': bounds.getSouthWest().lng,\n 'ymin': bounds.getSouthWest().lat,\n 'xmax': bounds.getNorthEast().lng,\n 'ymax': bounds.getNorthEast().lat,\n 'spatialReference': {\n 'wkid' : 4326\n }\n };\n };\n\n EsriLeaflet.Util.arcgisToGeojson = function (arcgis, idAttribute){\n var geojson = {};\n\n if(typeof arcgis.x === 'number' && typeof arcgis.y === 'number'){\n geojson.type = 'Point';\n geojson.coordinates = [arcgis.x, arcgis.y];\n }\n\n if(arcgis.points){\n geojson.type = 'MultiPoint';\n geojson.coordinates = arcgis.points.slice(0);\n }\n\n if(arcgis.paths) {\n if(arcgis.paths.length === 1){\n geojson.type = 'LineString';\n geojson.coordinates = arcgis.paths[0].slice(0);\n } else {\n geojson.type = 'MultiLineString';\n geojson.coordinates = arcgis.paths.slice(0);\n }\n }\n\n if(arcgis.rings) {\n geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));\n }\n\n if(arcgis.geometry || arcgis.attributes) {\n geojson.type = 'Feature';\n geojson.geometry = (arcgis.geometry) ? EsriLeaflet.Util.arcgisToGeojson(arcgis.geometry) : null;\n geojson.properties = (arcgis.attributes) ? clone(arcgis.attributes) : null;\n if(arcgis.attributes) {\n geojson.id = arcgis.attributes[idAttribute] || arcgis.attributes.OBJECTID || arcgis.attributes.FID;\n }\n }\n\n return geojson;\n };\n\n // GeoJSON -> ArcGIS\n EsriLeaflet.Util.geojsonToArcGIS = function(geojson, idAttribute){\n idAttribute = idAttribute || 'OBJECTID';\n var spatialReference = { wkid: 4326 };\n var result = {};\n var i;\n\n switch(geojson.type){\n case 'Point':\n result.x = geojson.coordinates[0];\n result.y = geojson.coordinates[1];\n result.spatialReference = spatialReference;\n break;\n case 'MultiPoint':\n result.points = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'LineString':\n result.paths = [geojson.coordinates.slice(0)];\n result.spatialReference = spatialReference;\n break;\n case 'MultiLineString':\n result.paths = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'Polygon':\n result.rings = orientRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'MultiPolygon':\n result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'Feature':\n if(geojson.geometry) {\n result.geometry = EsriLeaflet.Util.geojsonToArcGIS(geojson.geometry, idAttribute);\n }\n result.attributes = (geojson.properties) ? clone(geojson.properties) : {};\n if(geojson.id){\n result.attributes[idAttribute] = geojson.id;\n }\n break;\n case 'FeatureCollection':\n result = [];\n for (i = 0; i < geojson.features.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.features[i], idAttribute));\n }\n break;\n case 'GeometryCollection':\n result = [];\n for (i = 0; i < geojson.geometries.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.geometries[i], idAttribute));\n }\n break;\n }\n\n return result;\n };\n\n EsriLeaflet.Util.responseToFeatureCollection = function(response, idAttribute){\n var objectIdField;\n\n if(idAttribute){\n objectIdField = idAttribute;\n } else if(response.objectIdFieldName){\n objectIdField = response.objectIdFieldName;\n } else if(response.fields) {\n for (var j = 0; j <= response.fields.length - 1; j++) {\n if(response.fields[j].type === 'esriFieldTypeOID') {\n objectIdField = response.fields[j].name;\n break;\n }\n }\n } else {\n objectIdField = 'OBJECTID';\n }\n\n var featureCollection = {\n type: 'FeatureCollection',\n features: []\n };\n var features = response.features || response.results;\n if(features.length){\n for (var i = features.length - 1; i >= 0; i--) {\n featureCollection.features.push(EsriLeaflet.Util.arcgisToGeojson(features[i], objectIdField));\n }\n }\n\n return featureCollection;\n };\n\n // trim whitespace and add a tailing slash is needed to a url\n EsriLeaflet.Util.cleanUrl = function(url){\n url = url.replace(/\\s\\s*/g, '');\n\n //add a trailing slash to the url if the user omitted it\n if(url[url.length-1] !== '/'){\n url += '/';\n }\n\n return url;\n };\n\n EsriLeaflet.Util.isArcgisOnline = function(url){\n return (/\\.arcgis\\.com/g).test(url);\n };\n\n EsriLeaflet.Util.geojsonTypeToArcGIS = function (geoJsonType) {\n var arcgisGeometryType;\n switch (geoJsonType) {\n case 'Point':\n arcgisGeometryType = 'esriGeometryPoint';\n break;\n case 'MultiPoint':\n arcgisGeometryType = 'esriGeometryMultipoint';\n break;\n case 'LineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'MultiLineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'Polygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n case 'MultiPolygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n }\n return arcgisGeometryType;\n };\n\n EsriLeaflet.Util.requestAnimationFrame = L.Util.bind(raf, window);\n\n})(EsriLeaflet);","(function(EsriLeaflet){\n\n var callbacks = 0;\n\n window._EsriLeafletCallbacks = {};\n\n function serialize(params){\n var data = '';\n\n params.f = params.f || 'json';\n\n for (var key in params){\n if(params.hasOwnProperty(key)){\n var param = params[key];\n var type = Object.prototype.toString.call(param);\n var value;\n\n if(data.length){\n data += '&';\n }\n\n if (type === '[object Array]'){\n value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');\n } else if (type === '[object Object]') {\n value = JSON.stringify(param);\n } else if (type === '[object Date]'){\n value = param.valueOf();\n } else {\n value = param;\n }\n\n data += encodeURIComponent(key) + '=' + encodeURIComponent(value);\n }\n }\n\n return data;\n }\n\n function createRequest(callback, context){\n var httpRequest = new XMLHttpRequest();\n\n httpRequest.onerror = function(e) {\n httpRequest.onreadystatechange = L.Util.falseFn;\n\n callback.call(context, {\n error: {\n code: 500,\n message: 'XMLHttpRequest error'\n }\n }, null);\n };\n\n httpRequest.onreadystatechange = function(){\n var response;\n var error;\n\n if (httpRequest.readyState === 4) {\n try {\n response = JSON.parse(httpRequest.responseText);\n } catch(e) {\n response = null;\n error = {\n code: 500,\n message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'\n };\n }\n\n if (!error && response.error) {\n error = response.error;\n response = null;\n }\n\n httpRequest.onerror = L.Util.falseFn;\n\n callback.call(context, error, response);\n }\n };\n\n return httpRequest;\n }\n\n // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)\n EsriLeaflet.Request = {\n request: function(url, params, callback, context){\n var paramString = serialize(params);\n var httpRequest = createRequest(callback, context);\n var requestLength = (url + '?' + paramString).length;\n\n // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest\n if(requestLength <= 2000 && L.esri.Support.CORS){\n httpRequest.open('GET', url + '?' + paramString);\n httpRequest.send(null);\n\n // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest\n } else if (requestLength > 2000 && L.esri.Support.CORS){\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(paramString);\n\n // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request\n } else if(requestLength <= 2000 && !L.esri.Support.CORS){\n return L.esri.Request.get.JSONP(url, params, callback, context);\n\n // request is longer then 2000 characters and the browser does not support CORS, log a warning\n } else {\n if(console && console.warn){\n console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');\n return;\n }\n }\n\n return httpRequest;\n },\n post: {\n XMLHTTP: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(serialize(params));\n\n return httpRequest;\n }\n },\n\n get: {\n CORS: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n\n httpRequest.open('GET', url + '?' + serialize(params), true);\n httpRequest.send(null);\n\n return httpRequest;\n },\n JSONP: function(url, params, callback, context){\n var callbackId = 'c' + callbacks;\n\n params.callback = 'window._EsriLeafletCallbacks.' + callbackId;\n\n var script = L.DomUtil.create('script', null, document.body);\n script.type = 'text/javascript';\n script.src = url + '?' + serialize(params);\n script.id = callbackId;\n\n window._EsriLeafletCallbacks[callbackId] = function(response){\n if(window._EsriLeafletCallbacks[callbackId] !== true){\n var error;\n var responseType = Object.prototype.toString.call(response);\n\n if(!(responseType === '[object Object]' || responseType === '[object Array]')){\n error = {\n error: {\n code: 500,\n message: 'Expected array or object as JSONP response'\n }\n };\n response = null;\n }\n\n if (!error && response.error) {\n error = response;\n response = null;\n }\n\n callback.call(context, error, response);\n window._EsriLeafletCallbacks[callbackId] = true;\n }\n };\n\n callbacks++;\n\n return {\n id: callbackId,\n url: script.src,\n abort: function(){\n window._EsriLeafletCallbacks._callback[callbackId]({\n code: 0,\n message: 'Request aborted.'\n });\n }\n };\n }\n }\n };\n\n // choose the correct AJAX handler depending on CORS support\n EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;\n\n // always use XMLHttpRequest for posts\n EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;\n\n // expose a common request method the uses GET\\POST based on request length\n EsriLeaflet.request = EsriLeaflet.Request.request;\n\n})(EsriLeaflet);","EsriLeaflet.Tasks.Task = L.Class.extend({\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n //Generate a method for each methodName:paramName in the setters for this task.\n generateSetter: function(param, context){\n return L.Util.bind(function(value){\n this.params[param] = value;\n return this;\n }, context);\n },\n\n initialize: function(endpoint){\n // endpoint can be either a url (and options) for an ArcGIS Rest Service or an instance of EsriLeaflet.Service\n if(endpoint.request && endpoint.options){\n this._service = endpoint;\n L.Util.setOptions(this, endpoint.options);\n } else {\n L.Util.setOptions(this, endpoint);\n this.options.url = L.esri.Util.cleanUrl(endpoint.url);\n }\n\n // clone default params into this object\n this.params = L.Util.extend({}, this.params || {});\n\n // generate setter methods based on the setters object implimented a child class\n if(this.setters){\n for (var setter in this.setters){\n var param = this.setters[setter];\n this[setter] = this.generateSetter(param, this);\n }\n }\n },\n\n token: function(token){\n if(this._service){\n this._service.authenticate(token);\n } else {\n this.params.token = token;\n }\n return this;\n },\n\n request: function(callback, context){\n if(this._service){\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n },\n\n _request: function(method, path, params, callback, context){\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, callback, context);\n } else{\n return EsriLeaflet[method](url, params, callback, context);\n }\n }\n});","EsriLeaflet.Services.Service = L.Class.extend({\n\n includes: L.Mixin.Events,\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n initialize: function (options) {\n options = options || {};\n this._requestQueue = [];\n this._authenticating = false;\n L.Util.setOptions(this, options);\n this.options.url = EsriLeaflet.Util.cleanUrl(this.options.url);\n },\n\n get: function (path, params, callback, context) {\n return this._request('get', path, params, callback, context);\n },\n\n post: function (path, params, callback, context) {\n return this._request('post', path, params, callback, context);\n },\n\n request: function (path, params, callback, context) {\n return this._request('request', path, params, callback, context);\n },\n\n metadata: function (callback, context) {\n return this._request('get', '', {}, callback, context);\n },\n\n authenticate: function(token){\n this._authenticating = false;\n this.options.token = token;\n this._runQueue();\n return this;\n },\n\n _request: function(method, path, params, callback, context){\n this.fire('requeststart', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n\n var wrappedCallback = this._createServiceCallback(method, path, params, callback, context);\n\n if (this.options.token) {\n params.token = this.options.token;\n }\n\n if (this._authenticating) {\n this._requestQueue.push([method, path, params, callback, context]);\n return;\n } else {\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, wrappedCallback);\n } else {\n return EsriLeaflet[method](url, params, wrappedCallback);\n }\n }\n },\n\n _createServiceCallback: function(method, path, params, callback, context){\n var request = [method, path, params, callback, context];\n\n return L.Util.bind(function(error, response){\n\n if (error && (error.code === 499 || error.code === 498)) {\n this._authenticating = true;\n\n this._requestQueue.push(request);\n\n this.fire('authenticationrequired', {\n authenticate: L.Util.bind(this.authenticate, this)\n });\n } else {\n callback.call(context, error, response);\n\n if(error) {\n this.fire('requesterror', {\n url: this.options.url + path,\n params: params,\n message: error.message,\n code: error.code,\n method: method\n });\n } else {\n this.fire('requestsuccess', {\n url: this.options.url + path,\n params: params,\n response: response,\n method: method\n });\n }\n\n this.fire('requestend', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n }\n }, this);\n },\n\n _runQueue: function(){\n for (var i = this._requestQueue.length - 1; i >= 0; i--) {\n var request = this._requestQueue[i];\n var method = request.shift();\n this[method].apply(this, request);\n }\n this._requestQueue = [];\n }\n\n});\n\nEsriLeaflet.Services.service = function(params){\n return new EsriLeaflet.Services.Service(params);\n};"]}
\ No newline at end of file
diff --git a/dist/builds/core/esri-leaflet-core.js b/dist/builds/core/esri-leaflet-core.js
new file mode 100644
index 000000000..36a9d24e1
--- /dev/null
+++ b/dist/builds/core/esri-leaflet-core.js
@@ -0,0 +1,24 @@
+/*! esri-leaflet - v1.0.0-rc.6 - 2015-03-05
+* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
+* Apache License*/
+(function (factory) {
+ //define an AMD module that relies on 'leaflet'
+ if (typeof define === 'function' && define.amd) {
+ define(['leaflet'], function (L) {
+ return factory(L);
+ });
+ //define a common js module that relies on 'leaflet'
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ module.exports = factory(require('leaflet'));
+ }
+
+ if(typeof window !== 'undefined' && window.L){
+ factory(window.L);
+ }
+}(function (L) {
+
+var EsriLeaflet={VERSION:"1.0.0-rc.5",Layers:{},Services:{},Controls:{},Tasks:{},Util:{},Support:{CORS:!!(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),pointerEvents:""===document.documentElement.style.pointerEvents}};"undefined"!=typeof window&&window.L&&(window.L.esri=EsriLeaflet),function(a){function b(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function c(a,b){for(var c=0;cd;d++)b=a[d+1],c+=(b[0]-f[0])*(b[1]+f[1]),f=b;return c>=0}function f(a,b,c,d){var e=(d[0]-c[0])*(a[1]-c[1])-(d[1]-c[1])*(a[0]-c[0]),f=(b[0]-a[0])*(a[1]-c[1])-(b[1]-a[1])*(a[0]-c[0]),g=(d[1]-c[1])*(b[0]-a[0])-(d[0]-c[0])*(b[1]-a[1]);if(0!==g){var h=e/g,i=f/g;if(h>=0&&1>=h&&i>=0&&1>=i)return!0}return!1}function g(a,b){for(var c=0;c=0;b--)if(c=h[b][0],i(c,f)){h[b].push(f),o=!0;break}o||n.push(f)}for(;n.length;){f=n.pop();var p=!1;for(b=h.length-1;b>=0;b--)if(c=h[b][0],g(c,f)){h[b].push(f),p=!0;break}p||h.push([f.reverse()])}return 1===h.length?{type:"Polygon",coordinates:h[0]}:{type:"MultiPolygon",coordinates:h}}function k(a){var b=[],c=a.slice(0),f=d(c.shift().slice(0));if(f.length>=4){e(f)||f.reverse(),b.push(f);for(var g=0;g=4&&(e(h)&&h.reverse(),b.push(h))}}return b}function l(a){for(var b=[],c=0;c=0;e--){var f=d[e].slice(0);b.push(f)}return b}var m=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(a){return window.setTimeout(a,1e3/60)};a.Util.extentToBounds=function(a){var b=new L.LatLng(a.ymin,a.xmin),c=new L.LatLng(a.ymax,a.xmax);return new L.LatLngBounds(b,c)},a.Util.boundsToExtent=function(a){return a=L.latLngBounds(a),{xmin:a.getSouthWest().lng,ymin:a.getSouthWest().lat,xmax:a.getNorthEast().lng,ymax:a.getNorthEast().lat,spatialReference:{wkid:4326}}},a.Util.arcgisToGeojson=function(c,d){var e={};return"number"==typeof c.x&&"number"==typeof c.y&&(e.type="Point",e.coordinates=[c.x,c.y]),c.points&&(e.type="MultiPoint",e.coordinates=c.points.slice(0)),c.paths&&(1===c.paths.length?(e.type="LineString",e.coordinates=c.paths[0].slice(0)):(e.type="MultiLineString",e.coordinates=c.paths.slice(0))),c.rings&&(e=j(c.rings.slice(0))),(c.geometry||c.attributes)&&(e.type="Feature",e.geometry=c.geometry?a.Util.arcgisToGeojson(c.geometry):null,e.properties=c.attributes?b(c.attributes):null,c.attributes&&(e.id=c.attributes[d]||c.attributes.OBJECTID||c.attributes.FID)),e},a.Util.geojsonToArcGIS=function(c,d){d=d||"OBJECTID";var e,f={wkid:4326},g={};switch(c.type){case"Point":g.x=c.coordinates[0],g.y=c.coordinates[1],g.spatialReference=f;break;case"MultiPoint":g.points=c.coordinates.slice(0),g.spatialReference=f;break;case"LineString":g.paths=[c.coordinates.slice(0)],g.spatialReference=f;break;case"MultiLineString":g.paths=c.coordinates.slice(0),g.spatialReference=f;break;case"Polygon":g.rings=k(c.coordinates.slice(0)),g.spatialReference=f;break;case"MultiPolygon":g.rings=l(c.coordinates.slice(0)),g.spatialReference=f;break;case"Feature":c.geometry&&(g.geometry=a.Util.geojsonToArcGIS(c.geometry,d)),g.attributes=c.properties?b(c.properties):{},c.id&&(g.attributes[d]=c.id);break;case"FeatureCollection":for(g=[],e=0;e=0;h--)f.features.push(a.Util.arcgisToGeojson(g[h],d));return f},a.Util.cleanUrl=function(a){return a=a.replace(/\s\s*/g,""),"/"!==a[a.length-1]&&(a+="/"),a},a.Util.isArcgisOnline=function(a){return/\.arcgis\.com/g.test(a)},a.Util.geojsonTypeToArcGIS=function(a){var b;switch(a){case"Point":b="esriGeometryPoint";break;case"MultiPoint":b="esriGeometryMultipoint";break;case"LineString":b="esriGeometryPolyline";break;case"MultiLineString":b="esriGeometryPolyline";break;case"Polygon":b="esriGeometryPolygon";break;case"MultiPolygon":b="esriGeometryPolygon"}return b},a.Util.requestAnimationFrame=L.Util.bind(m,window)}(EsriLeaflet),function(a){function b(a){var b="";a.f=a.f||"json";for(var c in a)if(a.hasOwnProperty(c)){var d,e=a[c],f=Object.prototype.toString.call(e);b.length&&(b+="&"),d="[object Array]"===f?"[object Object]"===Object.prototype.toString.call(e[0])?JSON.stringify(e):e.join(","):"[object Object]"===f?JSON.stringify(e):"[object Date]"===f?e.valueOf():e,b+=encodeURIComponent(c)+"="+encodeURIComponent(d)}return b}function c(a,b){var c=new XMLHttpRequest;return c.onerror=function(){c.onreadystatechange=L.Util.falseFn,a.call(b,{error:{code:500,message:"XMLHttpRequest error"}},null)},c.onreadystatechange=function(){var d,e;if(4===c.readyState){try{d=JSON.parse(c.responseText)}catch(f){d=null,e={code:500,message:"Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error."}}!e&&d.error&&(e=d.error,d=null),c.onerror=L.Util.falseFn,a.call(b,e,d)}},c}var d=0;window._EsriLeafletCallbacks={},a.Request={request:function(a,d,e,f){var g=b(d),h=c(e,f),i=(a+"?"+g).length;if(2e3>=i&&L.esri.Support.CORS)h.open("GET",a+"?"+g),h.send(null);else if(i>2e3&&L.esri.Support.CORS)h.open("POST",a),h.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),h.send(g);else{if(2e3>=i&&!L.esri.Support.CORS)return L.esri.Request.get.JSONP(a,d,e,f);if(console&&console.warn)return void console.warn("a request to "+a+" was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html")}return h},post:{XMLHTTP:function(a,d,e,f){var g=c(e,f);return g.open("POST",a),g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),g.send(b(d)),g}},get:{CORS:function(a,d,e,f){var g=c(e,f);return g.open("GET",a+"?"+b(d),!0),g.send(null),g},JSONP:function(a,c,e,f){var g="c"+d;c.callback="window._EsriLeafletCallbacks."+g;var h=L.DomUtil.create("script",null,document.body);return h.type="text/javascript",h.src=a+"?"+b(c),h.id=g,window._EsriLeafletCallbacks[g]=function(a){if(window._EsriLeafletCallbacks[g]!==!0){var b,c=Object.prototype.toString.call(a);"[object Object]"!==c&&"[object Array]"!==c&&(b={error:{code:500,message:"Expected array or object as JSONP response"}},a=null),!b&&a.error&&(b=a,a=null),e.call(f,b,a),window._EsriLeafletCallbacks[g]=!0}},d++,{id:g,url:h.src,abort:function(){window._EsriLeafletCallbacks._callback[g]({code:0,message:"Request aborted."})}}}}},a.get=a.Support.CORS?a.Request.get.CORS:a.Request.get.JSONP,a.post=a.Request.post.XMLHTTP,a.request=a.Request.request}(EsriLeaflet),EsriLeaflet.Tasks.Task=L.Class.extend({options:{proxy:!1,useCors:EsriLeaflet.Support.CORS},generateSetter:function(a,b){return L.Util.bind(function(b){return this.params[a]=b,this},b)},initialize:function(a){if(a.request&&a.options?(this._service=a,L.Util.setOptions(this,a.options)):(L.Util.setOptions(this,a),this.options.url=L.esri.Util.cleanUrl(a.url)),this.params=L.Util.extend({},this.params||{}),this.setters)for(var b in this.setters){var c=this.setters[b];this[b]=this.generateSetter(c,this)}},token:function(a){return this._service?this._service.authenticate(a):this.params.token=a,this},request:function(a,b){return this._service?this._service.request(this.path,this.params,a,b):this._request("request",this.path,this.params,a,b)},_request:function(a,b,c,d,e){var f=this.options.proxy?this.options.proxy+"?"+this.options.url+b:this.options.url+b;return"get"!==a&&"request"!==a||this.options.useCors?EsriLeaflet[a](f,c,d,e):EsriLeaflet.Request.get.JSONP(f,c,d,e)}}),EsriLeaflet.Services.Service=L.Class.extend({includes:L.Mixin.Events,options:{proxy:!1,useCors:EsriLeaflet.Support.CORS},initialize:function(a){a=a||{},this._requestQueue=[],this._authenticating=!1,L.Util.setOptions(this,a),this.options.url=EsriLeaflet.Util.cleanUrl(this.options.url)},get:function(a,b,c,d){return this._request("get",a,b,c,d)},post:function(a,b,c,d){return this._request("post",a,b,c,d)},request:function(a,b,c,d){return this._request("request",a,b,c,d)},metadata:function(a,b){return this._request("get","",{},a,b)},authenticate:function(a){return this._authenticating=!1,this.options.token=a,this._runQueue(),this},_request:function(a,b,c,d,e){this.fire("requeststart",{url:this.options.url+b,params:c,method:a});var f=this._createServiceCallback(a,b,c,d,e);if(this.options.token&&(c.token=this.options.token),this._authenticating)return void this._requestQueue.push([a,b,c,d,e]);var g=this.options.proxy?this.options.proxy+"?"+this.options.url+b:this.options.url+b;return"get"!==a&&"request"!==a||this.options.useCors?EsriLeaflet[a](g,c,f):EsriLeaflet.Request.get.JSONP(g,c,f)},_createServiceCallback:function(a,b,c,d,e){var f=[a,b,c,d,e];return L.Util.bind(function(g,h){!g||499!==g.code&&498!==g.code?(d.call(e,g,h),g?this.fire("requesterror",{url:this.options.url+b,params:c,message:g.message,code:g.code,method:a}):this.fire("requestsuccess",{url:this.options.url+b,params:c,response:h,method:a}),this.fire("requestend",{url:this.options.url+b,params:c,method:a})):(this._authenticating=!0,this._requestQueue.push(f),this.fire("authenticationrequired",{authenticate:L.Util.bind(this.authenticate,this)}))},this)},_runQueue:function(){for(var a=this._requestQueue.length-1;a>=0;a--){var b=this._requestQueue[a],c=b.shift();this[c].apply(this,b)}this._requestQueue=[]}}),EsriLeaflet.Services.service=function(a){return new EsriLeaflet.Services.Service(a)};
+//# sourceMappingURL=esri-leaflet-core.js.map
+
+ return EsriLeaflet;
+}));
\ No newline at end of file
diff --git a/dist/builds/core/esri-leaflet-core.js.map b/dist/builds/core/esri-leaflet-core.js.map
new file mode 100644
index 000000000..72ea0d35a
--- /dev/null
+++ b/dist/builds/core/esri-leaflet-core.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"esri-leaflet-core.js","sources":["../../../src/EsriLeaflet.js","../../../src/Util.js","../../../src/Request.js","../../../src/Tasks/Task.js","../../../src/Services/Service.js"],"names":["EsriLeaflet","VERSION","Layers","Services","Controls","Tasks","Util","Support","CORS","window","XMLHttpRequest","pointerEvents","document","documentElement","style","L","esri","clone","obj","target","i","hasOwnProperty","pointsEqual","a","b","length","closeRing","coordinates","push","ringIsClockwise","ringToTest","pt2","total","rLength","pt1","vertexIntersectsVertex","a1","a2","b1","b2","uaT","ubT","uB","ua","ub","arrayIntersectsArray","j","coordinatesContainPoint","point","contains","l","coordinatesContainCoordinates","outer","inner","intersects","convertRingsToGeoJSON","rings","x","outerRing","hole","outerRings","holes","r","ring","slice","polygon","uncontainedHoles","pop","contained","reverse","type","orientRings","poly","output","shift","flattenMultiPolygonRings","raf","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","msRequestAnimationFrame","cb","setTimeout","extentToBounds","extent","sw","LatLng","ymin","xmin","ne","ymax","xmax","LatLngBounds","boundsToExtent","bounds","latLngBounds","getSouthWest","lng","lat","getNorthEast","spatialReference","wkid","arcgisToGeojson","arcgis","idAttribute","geojson","y","points","paths","geometry","attributes","properties","id","OBJECTID","FID","geojsonToArcGIS","result","features","geometries","responseToFeatureCollection","response","objectIdField","objectIdFieldName","fields","name","featureCollection","results","cleanUrl","url","replace","isArcgisOnline","test","geojsonTypeToArcGIS","geoJsonType","arcgisGeometryType","bind","serialize","params","data","f","key","value","param","Object","prototype","toString","call","JSON","stringify","join","valueOf","encodeURIComponent","createRequest","callback","context","httpRequest","onerror","onreadystatechange","falseFn","error","code","message","readyState","parse","responseText","e","callbacks","_EsriLeafletCallbacks","Request","request","paramString","requestLength","open","send","setRequestHeader","get","JSONP","console","warn","post","XMLHTTP","callbackId","script","DomUtil","create","body","src","responseType","abort","_callback","Task","Class","extend","options","proxy","useCors","generateSetter","this","initialize","endpoint","_service","setOptions","setters","setter","token","authenticate","path","_request","method","Service","includes","Mixin","Events","_requestQueue","_authenticating","metadata","_runQueue","fire","wrappedCallback","_createServiceCallback","apply","service"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,GAAIA,cACFC,QAAS,aACTC,UACAC,YACAC,YACAC,SACAC,QACAC,SACEC,QAASC,OAAOC,gBAAkB,mBAAqB,IAAIA,iBAC3DC,cAAgE,KAAjDC,SAASC,gBAAgBC,MAAMH,eAI7B,oBAAXF,SAA0BA,OAAOM,IACzCN,OAAOM,EAAEC,KAAOhB,aCdlB,SAAUA,GAWR,QAASiB,GAAMC,GACb,GA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C,KAAKoB,KAAK,gBACRzF,IAAKqE,KAAKJ,QAAQjE,IAAM8E,EACxBrE,OAAQA,EACRwB,QAASF,EAAME,QACfD,KAAMD,EAAMC,KACZgD,OAAQA,IAGVX,KAAKoB,KAAK,kBACRzF,IAAKqE,KAAKJ,QAAQjE,IAAM8E,EACxBrE,OAAQA,EACRjB,SAAUA,EACVwF,OAAQA,IAIZX,KAAKoB,KAAK,cACRzF,IAAKqE,KAAKJ,QAAQjE,IAAM8E,EACxBrE,OAAQA,EACRuE,OAAQA,MA9BVX,KAAKiB,iBAAkB,EAEvBjB,KAAKgB,cAAczL,KAAK6I,GAExB4B,KAAKoB,KAAK,0BACRZ,aAAc9L,EAAET,KAAKiI,KAAK8D,KAAKQ,aAAcR,UA4BhDA,OAGLmB,UAAW,WACT,IAAK,GAAIpM,GAAIiL,KAAKgB,cAAc5L,OAAS,EAAGL,GAAK,EAAGA,IAAK,CACvD,GAAIqJ,GAAU4B,KAAKgB,cAAcjM,GAC7B4L,EAASvC,EAAQ/F,OACrB2H,MAAKW,GAAQY,MAAMvB,KAAM5B,GAE3B4B,KAAKgB,oBAKTrN,YAAYG,SAAS0N,QAAU,SAASpF,GACtC,MAAO,IAAIzI,aAAYG,SAAS8M,QAAQxE","sourcesContent":["var EsriLeaflet = { //jshint ignore:line\n VERSION: '1.0.0-rc.5',\n Layers: {},\n Services: {},\n Controls: {},\n Tasks: {},\n Util: {},\n Support: {\n CORS: !!(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()),\n pointerEvents: document.documentElement.style.pointerEvents === ''\n }\n};\n\nif(typeof window !== 'undefined' && window.L){\n window.L.esri = EsriLeaflet;\n}\n","(function(EsriLeaflet){\n\n // normalize request animation frame\n var raf = window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function(cb) { return window.setTimeout(cb, 1000 / 60); };\n\n // shallow object clone for feature properties and attributes\n // from http://jsperf.com/cloning-an-object/2\n function clone(obj) {\n var target = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n target[i] = obj[i];\n }\n }\n return target;\n }\n\n // checks if 2 x,y points are equal\n function pointsEqual(a, b) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n }\n\n // checks if the first and last points of a ring are equal and closes the ring\n function closeRing(coordinates) {\n if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {\n coordinates.push(coordinates[0]);\n }\n return coordinates;\n }\n\n // determine if polygon ring coordinates are clockwise. clockwise signifies outer ring, counter-clockwise an inner ring\n // or hole. this logic was found at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-\n // points-are-in-clockwise-order\n function ringIsClockwise(ringToTest) {\n var total = 0,i = 0;\n var rLength = ringToTest.length;\n var pt1 = ringToTest[i];\n var pt2;\n for (i; i < rLength - 1; i++) {\n pt2 = ringToTest[i + 1];\n total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);\n pt1 = pt2;\n }\n return (total >= 0);\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L504-L519\n function vertexIntersectsVertex(a1, a2, b1, b2) {\n var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);\n var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);\n var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);\n\n if ( uB !== 0 ) {\n var ua = uaT / uB;\n var ub = ubT / uB;\n\n if ( 0 <= ua && ua <= 1 && 0 <= ub && ub <= 1 ) {\n return true;\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L521-L531\n function arrayIntersectsArray(a, b) {\n for (var i = 0; i < a.length - 1; i++) {\n for (var j = 0; j < b.length - 1; j++) {\n if (vertexIntersectsVertex(a[i], a[i + 1], b[j], b[j + 1])) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L470-L480\n function coordinatesContainPoint(coordinates, point) {\n var contains = false;\n for(var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {\n if (((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||\n (coordinates[j][1] <= point[1] && point[1] < coordinates[i][1])) &&\n (point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0])) {\n contains = !contains;\n }\n }\n return contains;\n }\n\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L106-L113\n function coordinatesContainCoordinates(outer, inner){\n var intersects = arrayIntersectsArray(outer, inner);\n var contains = coordinatesContainPoint(outer, inner[0]);\n if(!intersects && contains){\n return true;\n }\n return false;\n }\n\n // do any polygons in this array contain any other polygons in this array?\n // used for checking for holes in arcgis rings\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L117-L172\n function convertRingsToGeoJSON(rings){\n var outerRings = [];\n var holes = [];\n var x; // iterator\n var outerRing; // current outer ring being evaluated\n var hole; // current hole being evaluated\n\n // for each ring\n for (var r = 0; r < rings.length; r++) {\n var ring = closeRing(rings[r].slice(0));\n if(ring.length < 4){\n continue;\n }\n // is this ring an outer ring? is it clockwise?\n if(ringIsClockwise(ring)){\n var polygon = [ ring ];\n outerRings.push(polygon); // push to outer rings\n } else {\n holes.push(ring); // counterclockwise push to holes\n }\n }\n\n var uncontainedHoles = [];\n\n // while there are holes left...\n while(holes.length){\n // pop a hole off out stack\n hole = holes.pop();\n\n // loop over all outer rings and see if they contain our hole.\n var contained = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(coordinatesContainCoordinates(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n contained = true;\n break;\n }\n }\n\n // ring is not contained in any outer ring\n // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320\n if(!contained){\n uncontainedHoles.push(hole);\n }\n }\n\n // if we couldn't match any holes using contains we can try intersects...\n while(uncontainedHoles.length){\n // pop a hole off out stack\n hole = uncontainedHoles.pop();\n\n // loop over all outer rings and see if any intersect our hole.\n var intersects = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(arrayIntersectsArray(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n intersects = true;\n break;\n }\n }\n\n if(!intersects) {\n outerRings.push([hole.reverse()]);\n }\n }\n\n if(outerRings.length === 1){\n return {\n type: 'Polygon',\n coordinates: outerRings[0]\n };\n } else {\n return {\n type: 'MultiPolygon',\n coordinates: outerRings\n };\n }\n }\n\n // This function ensures that rings are oriented in the right directions\n // outer rings are clockwise, holes are counterclockwise\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function orientRings(poly){\n var output = [];\n var polygon = poly.slice(0);\n var outerRing = closeRing(polygon.shift().slice(0));\n if(outerRing.length >= 4){\n if(!ringIsClockwise(outerRing)){\n outerRing.reverse();\n }\n\n output.push(outerRing);\n\n for (var i = 0; i < polygon.length; i++) {\n var hole = closeRing(polygon[i].slice(0));\n if(hole.length >= 4){\n if(ringIsClockwise(hole)){\n hole.reverse();\n }\n output.push(hole);\n }\n }\n }\n\n return output;\n }\n\n // This function flattens holes in multipolygons to one array of polygons\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function flattenMultiPolygonRings(rings){\n var output = [];\n for (var i = 0; i < rings.length; i++) {\n var polygon = orientRings(rings[i]);\n for (var x = polygon.length - 1; x >= 0; x--) {\n var ring = polygon[x].slice(0);\n output.push(ring);\n }\n }\n return output;\n }\n\n // convert an extent (ArcGIS) to LatLngBounds (Leaflet)\n EsriLeaflet.Util.extentToBounds = function(extent){\n var sw = new L.LatLng(extent.ymin, extent.xmin);\n var ne = new L.LatLng(extent.ymax, extent.xmax);\n return new L.LatLngBounds(sw, ne);\n };\n\n // convert an LatLngBounds (Leaflet) to extent (ArcGIS)\n EsriLeaflet.Util.boundsToExtent = function(bounds) {\n bounds = L.latLngBounds(bounds);\n return {\n 'xmin': bounds.getSouthWest().lng,\n 'ymin': bounds.getSouthWest().lat,\n 'xmax': bounds.getNorthEast().lng,\n 'ymax': bounds.getNorthEast().lat,\n 'spatialReference': {\n 'wkid' : 4326\n }\n };\n };\n\n EsriLeaflet.Util.arcgisToGeojson = function (arcgis, idAttribute){\n var geojson = {};\n\n if(typeof arcgis.x === 'number' && typeof arcgis.y === 'number'){\n geojson.type = 'Point';\n geojson.coordinates = [arcgis.x, arcgis.y];\n }\n\n if(arcgis.points){\n geojson.type = 'MultiPoint';\n geojson.coordinates = arcgis.points.slice(0);\n }\n\n if(arcgis.paths) {\n if(arcgis.paths.length === 1){\n geojson.type = 'LineString';\n geojson.coordinates = arcgis.paths[0].slice(0);\n } else {\n geojson.type = 'MultiLineString';\n geojson.coordinates = arcgis.paths.slice(0);\n }\n }\n\n if(arcgis.rings) {\n geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));\n }\n\n if(arcgis.geometry || arcgis.attributes) {\n geojson.type = 'Feature';\n geojson.geometry = (arcgis.geometry) ? EsriLeaflet.Util.arcgisToGeojson(arcgis.geometry) : null;\n geojson.properties = (arcgis.attributes) ? clone(arcgis.attributes) : null;\n if(arcgis.attributes) {\n geojson.id = arcgis.attributes[idAttribute] || arcgis.attributes.OBJECTID || arcgis.attributes.FID;\n }\n }\n\n return geojson;\n };\n\n // GeoJSON -> ArcGIS\n EsriLeaflet.Util.geojsonToArcGIS = function(geojson, idAttribute){\n idAttribute = idAttribute || 'OBJECTID';\n var spatialReference = { wkid: 4326 };\n var result = {};\n var i;\n\n switch(geojson.type){\n case 'Point':\n result.x = geojson.coordinates[0];\n result.y = geojson.coordinates[1];\n result.spatialReference = spatialReference;\n break;\n case 'MultiPoint':\n result.points = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'LineString':\n result.paths = [geojson.coordinates.slice(0)];\n result.spatialReference = spatialReference;\n break;\n case 'MultiLineString':\n result.paths = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'Polygon':\n result.rings = orientRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'MultiPolygon':\n result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'Feature':\n if(geojson.geometry) {\n result.geometry = EsriLeaflet.Util.geojsonToArcGIS(geojson.geometry, idAttribute);\n }\n result.attributes = (geojson.properties) ? clone(geojson.properties) : {};\n if(geojson.id){\n result.attributes[idAttribute] = geojson.id;\n }\n break;\n case 'FeatureCollection':\n result = [];\n for (i = 0; i < geojson.features.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.features[i], idAttribute));\n }\n break;\n case 'GeometryCollection':\n result = [];\n for (i = 0; i < geojson.geometries.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.geometries[i], idAttribute));\n }\n break;\n }\n\n return result;\n };\n\n EsriLeaflet.Util.responseToFeatureCollection = function(response, idAttribute){\n var objectIdField;\n\n if(idAttribute){\n objectIdField = idAttribute;\n } else if(response.objectIdFieldName){\n objectIdField = response.objectIdFieldName;\n } else if(response.fields) {\n for (var j = 0; j <= response.fields.length - 1; j++) {\n if(response.fields[j].type === 'esriFieldTypeOID') {\n objectIdField = response.fields[j].name;\n break;\n }\n }\n } else {\n objectIdField = 'OBJECTID';\n }\n\n var featureCollection = {\n type: 'FeatureCollection',\n features: []\n };\n var features = response.features || response.results;\n if(features.length){\n for (var i = features.length - 1; i >= 0; i--) {\n featureCollection.features.push(EsriLeaflet.Util.arcgisToGeojson(features[i], objectIdField));\n }\n }\n\n return featureCollection;\n };\n\n // trim whitespace and add a tailing slash is needed to a url\n EsriLeaflet.Util.cleanUrl = function(url){\n url = url.replace(/\\s\\s*/g, '');\n\n //add a trailing slash to the url if the user omitted it\n if(url[url.length-1] !== '/'){\n url += '/';\n }\n\n return url;\n };\n\n EsriLeaflet.Util.isArcgisOnline = function(url){\n return (/\\.arcgis\\.com/g).test(url);\n };\n\n EsriLeaflet.Util.geojsonTypeToArcGIS = function (geoJsonType) {\n var arcgisGeometryType;\n switch (geoJsonType) {\n case 'Point':\n arcgisGeometryType = 'esriGeometryPoint';\n break;\n case 'MultiPoint':\n arcgisGeometryType = 'esriGeometryMultipoint';\n break;\n case 'LineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'MultiLineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'Polygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n case 'MultiPolygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n }\n return arcgisGeometryType;\n };\n\n EsriLeaflet.Util.requestAnimationFrame = L.Util.bind(raf, window);\n\n})(EsriLeaflet);","(function(EsriLeaflet){\n\n var callbacks = 0;\n\n window._EsriLeafletCallbacks = {};\n\n function serialize(params){\n var data = '';\n\n params.f = params.f || 'json';\n\n for (var key in params){\n if(params.hasOwnProperty(key)){\n var param = params[key];\n var type = Object.prototype.toString.call(param);\n var value;\n\n if(data.length){\n data += '&';\n }\n\n if (type === '[object Array]'){\n value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');\n } else if (type === '[object Object]') {\n value = JSON.stringify(param);\n } else if (type === '[object Date]'){\n value = param.valueOf();\n } else {\n value = param;\n }\n\n data += encodeURIComponent(key) + '=' + encodeURIComponent(value);\n }\n }\n\n return data;\n }\n\n function createRequest(callback, context){\n var httpRequest = new XMLHttpRequest();\n\n httpRequest.onerror = function(e) {\n httpRequest.onreadystatechange = L.Util.falseFn;\n\n callback.call(context, {\n error: {\n code: 500,\n message: 'XMLHttpRequest error'\n }\n }, null);\n };\n\n httpRequest.onreadystatechange = function(){\n var response;\n var error;\n\n if (httpRequest.readyState === 4) {\n try {\n response = JSON.parse(httpRequest.responseText);\n } catch(e) {\n response = null;\n error = {\n code: 500,\n message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'\n };\n }\n\n if (!error && response.error) {\n error = response.error;\n response = null;\n }\n\n httpRequest.onerror = L.Util.falseFn;\n\n callback.call(context, error, response);\n }\n };\n\n return httpRequest;\n }\n\n // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)\n EsriLeaflet.Request = {\n request: function(url, params, callback, context){\n var paramString = serialize(params);\n var httpRequest = createRequest(callback, context);\n var requestLength = (url + '?' + paramString).length;\n\n // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest\n if(requestLength <= 2000 && L.esri.Support.CORS){\n httpRequest.open('GET', url + '?' + paramString);\n httpRequest.send(null);\n\n // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest\n } else if (requestLength > 2000 && L.esri.Support.CORS){\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(paramString);\n\n // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request\n } else if(requestLength <= 2000 && !L.esri.Support.CORS){\n return L.esri.Request.get.JSONP(url, params, callback, context);\n\n // request is longer then 2000 characters and the browser does not support CORS, log a warning\n } else {\n if(console && console.warn){\n console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');\n return;\n }\n }\n\n return httpRequest;\n },\n post: {\n XMLHTTP: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(serialize(params));\n\n return httpRequest;\n }\n },\n\n get: {\n CORS: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n\n httpRequest.open('GET', url + '?' + serialize(params), true);\n httpRequest.send(null);\n\n return httpRequest;\n },\n JSONP: function(url, params, callback, context){\n var callbackId = 'c' + callbacks;\n\n params.callback = 'window._EsriLeafletCallbacks.' + callbackId;\n\n var script = L.DomUtil.create('script', null, document.body);\n script.type = 'text/javascript';\n script.src = url + '?' + serialize(params);\n script.id = callbackId;\n\n window._EsriLeafletCallbacks[callbackId] = function(response){\n if(window._EsriLeafletCallbacks[callbackId] !== true){\n var error;\n var responseType = Object.prototype.toString.call(response);\n\n if(!(responseType === '[object Object]' || responseType === '[object Array]')){\n error = {\n error: {\n code: 500,\n message: 'Expected array or object as JSONP response'\n }\n };\n response = null;\n }\n\n if (!error && response.error) {\n error = response;\n response = null;\n }\n\n callback.call(context, error, response);\n window._EsriLeafletCallbacks[callbackId] = true;\n }\n };\n\n callbacks++;\n\n return {\n id: callbackId,\n url: script.src,\n abort: function(){\n window._EsriLeafletCallbacks._callback[callbackId]({\n code: 0,\n message: 'Request aborted.'\n });\n }\n };\n }\n }\n };\n\n // choose the correct AJAX handler depending on CORS support\n EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;\n\n // always use XMLHttpRequest for posts\n EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;\n\n // expose a common request method the uses GET\\POST based on request length\n EsriLeaflet.request = EsriLeaflet.Request.request;\n\n})(EsriLeaflet);","EsriLeaflet.Tasks.Task = L.Class.extend({\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n //Generate a method for each methodName:paramName in the setters for this task.\n generateSetter: function(param, context){\n return L.Util.bind(function(value){\n this.params[param] = value;\n return this;\n }, context);\n },\n\n initialize: function(endpoint){\n // endpoint can be either a url (and options) for an ArcGIS Rest Service or an instance of EsriLeaflet.Service\n if(endpoint.request && endpoint.options){\n this._service = endpoint;\n L.Util.setOptions(this, endpoint.options);\n } else {\n L.Util.setOptions(this, endpoint);\n this.options.url = L.esri.Util.cleanUrl(endpoint.url);\n }\n\n // clone default params into this object\n this.params = L.Util.extend({}, this.params || {});\n\n // generate setter methods based on the setters object implimented a child class\n if(this.setters){\n for (var setter in this.setters){\n var param = this.setters[setter];\n this[setter] = this.generateSetter(param, this);\n }\n }\n },\n\n token: function(token){\n if(this._service){\n this._service.authenticate(token);\n } else {\n this.params.token = token;\n }\n return this;\n },\n\n request: function(callback, context){\n if(this._service){\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n },\n\n _request: function(method, path, params, callback, context){\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, callback, context);\n } else{\n return EsriLeaflet[method](url, params, callback, context);\n }\n }\n});","EsriLeaflet.Services.Service = L.Class.extend({\n\n includes: L.Mixin.Events,\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n initialize: function (options) {\n options = options || {};\n this._requestQueue = [];\n this._authenticating = false;\n L.Util.setOptions(this, options);\n this.options.url = EsriLeaflet.Util.cleanUrl(this.options.url);\n },\n\n get: function (path, params, callback, context) {\n return this._request('get', path, params, callback, context);\n },\n\n post: function (path, params, callback, context) {\n return this._request('post', path, params, callback, context);\n },\n\n request: function (path, params, callback, context) {\n return this._request('request', path, params, callback, context);\n },\n\n metadata: function (callback, context) {\n return this._request('get', '', {}, callback, context);\n },\n\n authenticate: function(token){\n this._authenticating = false;\n this.options.token = token;\n this._runQueue();\n return this;\n },\n\n _request: function(method, path, params, callback, context){\n this.fire('requeststart', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n\n var wrappedCallback = this._createServiceCallback(method, path, params, callback, context);\n\n if (this.options.token) {\n params.token = this.options.token;\n }\n\n if (this._authenticating) {\n this._requestQueue.push([method, path, params, callback, context]);\n return;\n } else {\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, wrappedCallback);\n } else {\n return EsriLeaflet[method](url, params, wrappedCallback);\n }\n }\n },\n\n _createServiceCallback: function(method, path, params, callback, context){\n var request = [method, path, params, callback, context];\n\n return L.Util.bind(function(error, response){\n\n if (error && (error.code === 499 || error.code === 498)) {\n this._authenticating = true;\n\n this._requestQueue.push(request);\n\n this.fire('authenticationrequired', {\n authenticate: L.Util.bind(this.authenticate, this)\n });\n } else {\n callback.call(context, error, response);\n\n if(error) {\n this.fire('requesterror', {\n url: this.options.url + path,\n params: params,\n message: error.message,\n code: error.code,\n method: method\n });\n } else {\n this.fire('requestsuccess', {\n url: this.options.url + path,\n params: params,\n response: response,\n method: method\n });\n }\n\n this.fire('requestend', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n }\n }, this);\n },\n\n _runQueue: function(){\n for (var i = this._requestQueue.length - 1; i >= 0; i--) {\n var request = this._requestQueue[i];\n var method = request.shift();\n this[method].apply(this, request);\n }\n this._requestQueue = [];\n }\n\n});\n\nEsriLeaflet.Services.service = function(params){\n return new EsriLeaflet.Services.Service(params);\n};"]}
\ No newline at end of file
diff --git a/dist/builds/feature-layer/esri-leaflet-feature-layer-src.js b/dist/builds/feature-layer/esri-leaflet-feature-layer-src.js
new file mode 100644
index 000000000..a472bb165
--- /dev/null
+++ b/dist/builds/feature-layer/esri-leaflet-feature-layer-src.js
@@ -0,0 +1,2236 @@
+/*! esri-leaflet - v1.0.0-rc.6 - 2015-03-05
+* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
+* Apache License*/
+(function (factory) {
+ //define an AMD module that relies on 'leaflet'
+ if (typeof define === 'function' && define.amd) {
+ define(['leaflet'], function (L) {
+ return factory(L);
+ });
+ //define a common js module that relies on 'leaflet'
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ module.exports = factory(require('leaflet'));
+ }
+
+ if(typeof window !== 'undefined' && window.L){
+ factory(window.L);
+ }
+}(function (L) {
+var EsriLeaflet = { //jshint ignore:line
+ VERSION: '1.0.0-rc.5',
+ Layers: {},
+ Services: {},
+ Controls: {},
+ Tasks: {},
+ Util: {},
+ Support: {
+ CORS: !!(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()),
+ pointerEvents: document.documentElement.style.pointerEvents === ''
+ }
+};
+
+if(typeof window !== 'undefined' && window.L){
+ window.L.esri = EsriLeaflet;
+}
+
+
+(function(EsriLeaflet){
+
+ // normalize request animation frame
+ var raf = window.requestAnimationFrame ||
+ window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.msRequestAnimationFrame ||
+ function(cb) { return window.setTimeout(cb, 1000 / 60); };
+
+ // shallow object clone for feature properties and attributes
+ // from http://jsperf.com/cloning-an-object/2
+ function clone(obj) {
+ var target = {};
+ for (var i in obj) {
+ if (obj.hasOwnProperty(i)) {
+ target[i] = obj[i];
+ }
+ }
+ return target;
+ }
+
+ // checks if 2 x,y points are equal
+ function pointsEqual(a, b) {
+ for (var i = 0; i < a.length; i++) {
+ if (a[i] !== b[i]) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ // checks if the first and last points of a ring are equal and closes the ring
+ function closeRing(coordinates) {
+ if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {
+ coordinates.push(coordinates[0]);
+ }
+ return coordinates;
+ }
+
+ // determine if polygon ring coordinates are clockwise. clockwise signifies outer ring, counter-clockwise an inner ring
+ // or hole. this logic was found at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-
+ // points-are-in-clockwise-order
+ function ringIsClockwise(ringToTest) {
+ var total = 0,i = 0;
+ var rLength = ringToTest.length;
+ var pt1 = ringToTest[i];
+ var pt2;
+ for (i; i < rLength - 1; i++) {
+ pt2 = ringToTest[i + 1];
+ total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);
+ pt1 = pt2;
+ }
+ return (total >= 0);
+ }
+
+ // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L504-L519
+ function vertexIntersectsVertex(a1, a2, b1, b2) {
+ var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);
+ var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);
+ var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);
+
+ if ( uB !== 0 ) {
+ var ua = uaT / uB;
+ var ub = ubT / uB;
+
+ if ( 0 <= ua && ua <= 1 && 0 <= ub && ub <= 1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L521-L531
+ function arrayIntersectsArray(a, b) {
+ for (var i = 0; i < a.length - 1; i++) {
+ for (var j = 0; j < b.length - 1; j++) {
+ if (vertexIntersectsVertex(a[i], a[i + 1], b[j], b[j + 1])) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L470-L480
+ function coordinatesContainPoint(coordinates, point) {
+ var contains = false;
+ for(var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {
+ if (((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||
+ (coordinates[j][1] <= point[1] && point[1] < coordinates[i][1])) &&
+ (point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0])) {
+ contains = !contains;
+ }
+ }
+ return contains;
+ }
+
+ // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L106-L113
+ function coordinatesContainCoordinates(outer, inner){
+ var intersects = arrayIntersectsArray(outer, inner);
+ var contains = coordinatesContainPoint(outer, inner[0]);
+ if(!intersects && contains){
+ return true;
+ }
+ return false;
+ }
+
+ // do any polygons in this array contain any other polygons in this array?
+ // used for checking for holes in arcgis rings
+ // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L117-L172
+ function convertRingsToGeoJSON(rings){
+ var outerRings = [];
+ var holes = [];
+ var x; // iterator
+ var outerRing; // current outer ring being evaluated
+ var hole; // current hole being evaluated
+
+ // for each ring
+ for (var r = 0; r < rings.length; r++) {
+ var ring = closeRing(rings[r].slice(0));
+ if(ring.length < 4){
+ continue;
+ }
+ // is this ring an outer ring? is it clockwise?
+ if(ringIsClockwise(ring)){
+ var polygon = [ ring ];
+ outerRings.push(polygon); // push to outer rings
+ } else {
+ holes.push(ring); // counterclockwise push to holes
+ }
+ }
+
+ var uncontainedHoles = [];
+
+ // while there are holes left...
+ while(holes.length){
+ // pop a hole off out stack
+ hole = holes.pop();
+
+ // loop over all outer rings and see if they contain our hole.
+ var contained = false;
+ for (x = outerRings.length - 1; x >= 0; x--) {
+ outerRing = outerRings[x][0];
+ if(coordinatesContainCoordinates(outerRing, hole)){
+ // the hole is contained push it into our polygon
+ outerRings[x].push(hole);
+ contained = true;
+ break;
+ }
+ }
+
+ // ring is not contained in any outer ring
+ // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320
+ if(!contained){
+ uncontainedHoles.push(hole);
+ }
+ }
+
+ // if we couldn't match any holes using contains we can try intersects...
+ while(uncontainedHoles.length){
+ // pop a hole off out stack
+ hole = uncontainedHoles.pop();
+
+ // loop over all outer rings and see if any intersect our hole.
+ var intersects = false;
+ for (x = outerRings.length - 1; x >= 0; x--) {
+ outerRing = outerRings[x][0];
+ if(arrayIntersectsArray(outerRing, hole)){
+ // the hole is contained push it into our polygon
+ outerRings[x].push(hole);
+ intersects = true;
+ break;
+ }
+ }
+
+ if(!intersects) {
+ outerRings.push([hole.reverse()]);
+ }
+ }
+
+ if(outerRings.length === 1){
+ return {
+ type: 'Polygon',
+ coordinates: outerRings[0]
+ };
+ } else {
+ return {
+ type: 'MultiPolygon',
+ coordinates: outerRings
+ };
+ }
+ }
+
+ // This function ensures that rings are oriented in the right directions
+ // outer rings are clockwise, holes are counterclockwise
+ // used for converting GeoJSON Polygons to ArcGIS Polygons
+ function orientRings(poly){
+ var output = [];
+ var polygon = poly.slice(0);
+ var outerRing = closeRing(polygon.shift().slice(0));
+ if(outerRing.length >= 4){
+ if(!ringIsClockwise(outerRing)){
+ outerRing.reverse();
+ }
+
+ output.push(outerRing);
+
+ for (var i = 0; i < polygon.length; i++) {
+ var hole = closeRing(polygon[i].slice(0));
+ if(hole.length >= 4){
+ if(ringIsClockwise(hole)){
+ hole.reverse();
+ }
+ output.push(hole);
+ }
+ }
+ }
+
+ return output;
+ }
+
+ // This function flattens holes in multipolygons to one array of polygons
+ // used for converting GeoJSON Polygons to ArcGIS Polygons
+ function flattenMultiPolygonRings(rings){
+ var output = [];
+ for (var i = 0; i < rings.length; i++) {
+ var polygon = orientRings(rings[i]);
+ for (var x = polygon.length - 1; x >= 0; x--) {
+ var ring = polygon[x].slice(0);
+ output.push(ring);
+ }
+ }
+ return output;
+ }
+
+ // convert an extent (ArcGIS) to LatLngBounds (Leaflet)
+ EsriLeaflet.Util.extentToBounds = function(extent){
+ var sw = new L.LatLng(extent.ymin, extent.xmin);
+ var ne = new L.LatLng(extent.ymax, extent.xmax);
+ return new L.LatLngBounds(sw, ne);
+ };
+
+ // convert an LatLngBounds (Leaflet) to extent (ArcGIS)
+ EsriLeaflet.Util.boundsToExtent = function(bounds) {
+ bounds = L.latLngBounds(bounds);
+ return {
+ 'xmin': bounds.getSouthWest().lng,
+ 'ymin': bounds.getSouthWest().lat,
+ 'xmax': bounds.getNorthEast().lng,
+ 'ymax': bounds.getNorthEast().lat,
+ 'spatialReference': {
+ 'wkid' : 4326
+ }
+ };
+ };
+
+ EsriLeaflet.Util.arcgisToGeojson = function (arcgis, idAttribute){
+ var geojson = {};
+
+ if(typeof arcgis.x === 'number' && typeof arcgis.y === 'number'){
+ geojson.type = 'Point';
+ geojson.coordinates = [arcgis.x, arcgis.y];
+ }
+
+ if(arcgis.points){
+ geojson.type = 'MultiPoint';
+ geojson.coordinates = arcgis.points.slice(0);
+ }
+
+ if(arcgis.paths) {
+ if(arcgis.paths.length === 1){
+ geojson.type = 'LineString';
+ geojson.coordinates = arcgis.paths[0].slice(0);
+ } else {
+ geojson.type = 'MultiLineString';
+ geojson.coordinates = arcgis.paths.slice(0);
+ }
+ }
+
+ if(arcgis.rings) {
+ geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));
+ }
+
+ if(arcgis.geometry || arcgis.attributes) {
+ geojson.type = 'Feature';
+ geojson.geometry = (arcgis.geometry) ? EsriLeaflet.Util.arcgisToGeojson(arcgis.geometry) : null;
+ geojson.properties = (arcgis.attributes) ? clone(arcgis.attributes) : null;
+ if(arcgis.attributes) {
+ geojson.id = arcgis.attributes[idAttribute] || arcgis.attributes.OBJECTID || arcgis.attributes.FID;
+ }
+ }
+
+ return geojson;
+ };
+
+ // GeoJSON -> ArcGIS
+ EsriLeaflet.Util.geojsonToArcGIS = function(geojson, idAttribute){
+ idAttribute = idAttribute || 'OBJECTID';
+ var spatialReference = { wkid: 4326 };
+ var result = {};
+ var i;
+
+ switch(geojson.type){
+ case 'Point':
+ result.x = geojson.coordinates[0];
+ result.y = geojson.coordinates[1];
+ result.spatialReference = spatialReference;
+ break;
+ case 'MultiPoint':
+ result.points = geojson.coordinates.slice(0);
+ result.spatialReference = spatialReference;
+ break;
+ case 'LineString':
+ result.paths = [geojson.coordinates.slice(0)];
+ result.spatialReference = spatialReference;
+ break;
+ case 'MultiLineString':
+ result.paths = geojson.coordinates.slice(0);
+ result.spatialReference = spatialReference;
+ break;
+ case 'Polygon':
+ result.rings = orientRings(geojson.coordinates.slice(0));
+ result.spatialReference = spatialReference;
+ break;
+ case 'MultiPolygon':
+ result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));
+ result.spatialReference = spatialReference;
+ break;
+ case 'Feature':
+ if(geojson.geometry) {
+ result.geometry = EsriLeaflet.Util.geojsonToArcGIS(geojson.geometry, idAttribute);
+ }
+ result.attributes = (geojson.properties) ? clone(geojson.properties) : {};
+ if(geojson.id){
+ result.attributes[idAttribute] = geojson.id;
+ }
+ break;
+ case 'FeatureCollection':
+ result = [];
+ for (i = 0; i < geojson.features.length; i++){
+ result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.features[i], idAttribute));
+ }
+ break;
+ case 'GeometryCollection':
+ result = [];
+ for (i = 0; i < geojson.geometries.length; i++){
+ result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.geometries[i], idAttribute));
+ }
+ break;
+ }
+
+ return result;
+ };
+
+ EsriLeaflet.Util.responseToFeatureCollection = function(response, idAttribute){
+ var objectIdField;
+
+ if(idAttribute){
+ objectIdField = idAttribute;
+ } else if(response.objectIdFieldName){
+ objectIdField = response.objectIdFieldName;
+ } else if(response.fields) {
+ for (var j = 0; j <= response.fields.length - 1; j++) {
+ if(response.fields[j].type === 'esriFieldTypeOID') {
+ objectIdField = response.fields[j].name;
+ break;
+ }
+ }
+ } else {
+ objectIdField = 'OBJECTID';
+ }
+
+ var featureCollection = {
+ type: 'FeatureCollection',
+ features: []
+ };
+ var features = response.features || response.results;
+ if(features.length){
+ for (var i = features.length - 1; i >= 0; i--) {
+ featureCollection.features.push(EsriLeaflet.Util.arcgisToGeojson(features[i], objectIdField));
+ }
+ }
+
+ return featureCollection;
+ };
+
+ // trim whitespace and add a tailing slash is needed to a url
+ EsriLeaflet.Util.cleanUrl = function(url){
+ url = url.replace(/\s\s*/g, '');
+
+ //add a trailing slash to the url if the user omitted it
+ if(url[url.length-1] !== '/'){
+ url += '/';
+ }
+
+ return url;
+ };
+
+ EsriLeaflet.Util.isArcgisOnline = function(url){
+ return (/\.arcgis\.com/g).test(url);
+ };
+
+ EsriLeaflet.Util.geojsonTypeToArcGIS = function (geoJsonType) {
+ var arcgisGeometryType;
+ switch (geoJsonType) {
+ case 'Point':
+ arcgisGeometryType = 'esriGeometryPoint';
+ break;
+ case 'MultiPoint':
+ arcgisGeometryType = 'esriGeometryMultipoint';
+ break;
+ case 'LineString':
+ arcgisGeometryType = 'esriGeometryPolyline';
+ break;
+ case 'MultiLineString':
+ arcgisGeometryType = 'esriGeometryPolyline';
+ break;
+ case 'Polygon':
+ arcgisGeometryType = 'esriGeometryPolygon';
+ break;
+ case 'MultiPolygon':
+ arcgisGeometryType = 'esriGeometryPolygon';
+ break;
+ }
+ return arcgisGeometryType;
+ };
+
+ EsriLeaflet.Util.requestAnimationFrame = L.Util.bind(raf, window);
+
+})(EsriLeaflet);
+
+(function(EsriLeaflet){
+
+ var callbacks = 0;
+
+ window._EsriLeafletCallbacks = {};
+
+ function serialize(params){
+ var data = '';
+
+ params.f = params.f || 'json';
+
+ for (var key in params){
+ if(params.hasOwnProperty(key)){
+ var param = params[key];
+ var type = Object.prototype.toString.call(param);
+ var value;
+
+ if(data.length){
+ data += '&';
+ }
+
+ if (type === '[object Array]'){
+ value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');
+ } else if (type === '[object Object]') {
+ value = JSON.stringify(param);
+ } else if (type === '[object Date]'){
+ value = param.valueOf();
+ } else {
+ value = param;
+ }
+
+ data += encodeURIComponent(key) + '=' + encodeURIComponent(value);
+ }
+ }
+
+ return data;
+ }
+
+ function createRequest(callback, context){
+ var httpRequest = new XMLHttpRequest();
+
+ httpRequest.onerror = function(e) {
+ httpRequest.onreadystatechange = L.Util.falseFn;
+
+ callback.call(context, {
+ error: {
+ code: 500,
+ message: 'XMLHttpRequest error'
+ }
+ }, null);
+ };
+
+ httpRequest.onreadystatechange = function(){
+ var response;
+ var error;
+
+ if (httpRequest.readyState === 4) {
+ try {
+ response = JSON.parse(httpRequest.responseText);
+ } catch(e) {
+ response = null;
+ error = {
+ code: 500,
+ message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'
+ };
+ }
+
+ if (!error && response.error) {
+ error = response.error;
+ response = null;
+ }
+
+ httpRequest.onerror = L.Util.falseFn;
+
+ callback.call(context, error, response);
+ }
+ };
+
+ return httpRequest;
+ }
+
+ // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)
+ EsriLeaflet.Request = {
+ request: function(url, params, callback, context){
+ var paramString = serialize(params);
+ var httpRequest = createRequest(callback, context);
+ var requestLength = (url + '?' + paramString).length;
+
+ // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest
+ if(requestLength <= 2000 && L.esri.Support.CORS){
+ httpRequest.open('GET', url + '?' + paramString);
+ httpRequest.send(null);
+
+ // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest
+ } else if (requestLength > 2000 && L.esri.Support.CORS){
+ httpRequest.open('POST', url);
+ httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ httpRequest.send(paramString);
+
+ // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request
+ } else if(requestLength <= 2000 && !L.esri.Support.CORS){
+ return L.esri.Request.get.JSONP(url, params, callback, context);
+
+ // request is longer then 2000 characters and the browser does not support CORS, log a warning
+ } else {
+ if(console && console.warn){
+ console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');
+ return;
+ }
+ }
+
+ return httpRequest;
+ },
+ post: {
+ XMLHTTP: function (url, params, callback, context) {
+ var httpRequest = createRequest(callback, context);
+ httpRequest.open('POST', url);
+ httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ httpRequest.send(serialize(params));
+
+ return httpRequest;
+ }
+ },
+
+ get: {
+ CORS: function (url, params, callback, context) {
+ var httpRequest = createRequest(callback, context);
+
+ httpRequest.open('GET', url + '?' + serialize(params), true);
+ httpRequest.send(null);
+
+ return httpRequest;
+ },
+ JSONP: function(url, params, callback, context){
+ var callbackId = 'c' + callbacks;
+
+ params.callback = 'window._EsriLeafletCallbacks.' + callbackId;
+
+ var script = L.DomUtil.create('script', null, document.body);
+ script.type = 'text/javascript';
+ script.src = url + '?' + serialize(params);
+ script.id = callbackId;
+
+ window._EsriLeafletCallbacks[callbackId] = function(response){
+ if(window._EsriLeafletCallbacks[callbackId] !== true){
+ var error;
+ var responseType = Object.prototype.toString.call(response);
+
+ if(!(responseType === '[object Object]' || responseType === '[object Array]')){
+ error = {
+ error: {
+ code: 500,
+ message: 'Expected array or object as JSONP response'
+ }
+ };
+ response = null;
+ }
+
+ if (!error && response.error) {
+ error = response;
+ response = null;
+ }
+
+ callback.call(context, error, response);
+ window._EsriLeafletCallbacks[callbackId] = true;
+ }
+ };
+
+ callbacks++;
+
+ return {
+ id: callbackId,
+ url: script.src,
+ abort: function(){
+ window._EsriLeafletCallbacks._callback[callbackId]({
+ code: 0,
+ message: 'Request aborted.'
+ });
+ }
+ };
+ }
+ }
+ };
+
+ // choose the correct AJAX handler depending on CORS support
+ EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;
+
+ // always use XMLHttpRequest for posts
+ EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;
+
+ // expose a common request method the uses GET\POST based on request length
+ EsriLeaflet.request = EsriLeaflet.Request.request;
+
+})(EsriLeaflet);
+
+EsriLeaflet.Services.Service = L.Class.extend({
+
+ includes: L.Mixin.Events,
+
+ options: {
+ proxy: false,
+ useCors: EsriLeaflet.Support.CORS
+ },
+
+ initialize: function (options) {
+ options = options || {};
+ this._requestQueue = [];
+ this._authenticating = false;
+ L.Util.setOptions(this, options);
+ this.options.url = EsriLeaflet.Util.cleanUrl(this.options.url);
+ },
+
+ get: function (path, params, callback, context) {
+ return this._request('get', path, params, callback, context);
+ },
+
+ post: function (path, params, callback, context) {
+ return this._request('post', path, params, callback, context);
+ },
+
+ request: function (path, params, callback, context) {
+ return this._request('request', path, params, callback, context);
+ },
+
+ metadata: function (callback, context) {
+ return this._request('get', '', {}, callback, context);
+ },
+
+ authenticate: function(token){
+ this._authenticating = false;
+ this.options.token = token;
+ this._runQueue();
+ return this;
+ },
+
+ _request: function(method, path, params, callback, context){
+ this.fire('requeststart', {
+ url: this.options.url + path,
+ params: params,
+ method: method
+ });
+
+ var wrappedCallback = this._createServiceCallback(method, path, params, callback, context);
+
+ if (this.options.token) {
+ params.token = this.options.token;
+ }
+
+ if (this._authenticating) {
+ this._requestQueue.push([method, path, params, callback, context]);
+ return;
+ } else {
+ var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;
+
+ if((method === 'get' || method === 'request') && !this.options.useCors){
+ return EsriLeaflet.Request.get.JSONP(url, params, wrappedCallback);
+ } else {
+ return EsriLeaflet[method](url, params, wrappedCallback);
+ }
+ }
+ },
+
+ _createServiceCallback: function(method, path, params, callback, context){
+ var request = [method, path, params, callback, context];
+
+ return L.Util.bind(function(error, response){
+
+ if (error && (error.code === 499 || error.code === 498)) {
+ this._authenticating = true;
+
+ this._requestQueue.push(request);
+
+ this.fire('authenticationrequired', {
+ authenticate: L.Util.bind(this.authenticate, this)
+ });
+ } else {
+ callback.call(context, error, response);
+
+ if(error) {
+ this.fire('requesterror', {
+ url: this.options.url + path,
+ params: params,
+ message: error.message,
+ code: error.code,
+ method: method
+ });
+ } else {
+ this.fire('requestsuccess', {
+ url: this.options.url + path,
+ params: params,
+ response: response,
+ method: method
+ });
+ }
+
+ this.fire('requestend', {
+ url: this.options.url + path,
+ params: params,
+ method: method
+ });
+ }
+ }, this);
+ },
+
+ _runQueue: function(){
+ for (var i = this._requestQueue.length - 1; i >= 0; i--) {
+ var request = this._requestQueue[i];
+ var method = request.shift();
+ this[method].apply(this, request);
+ }
+ this._requestQueue = [];
+ }
+
+});
+
+EsriLeaflet.Services.service = function(params){
+ return new EsriLeaflet.Services.Service(params);
+};
+
+EsriLeaflet.Services.FeatureLayer = EsriLeaflet.Services.Service.extend({
+
+ options: {
+ idAttribute: 'OBJECTID'
+ },
+
+ query: function(){
+ return new EsriLeaflet.Tasks.Query(this);
+ },
+
+ addFeature: function(feature, callback, context) {
+ delete feature.id;
+
+ feature = EsriLeaflet.Util.geojsonToArcGIS(feature);
+
+ return this.post('addFeatures', {
+ features: [feature]
+ }, function(error, response){
+ var result = (response && response.addResults) ? response.addResults[0] : undefined;
+ if(callback){
+ callback.call(this, error || response.addResults[0].error, result);
+ }
+ }, context);
+ },
+
+ updateFeature: function(feature, callback, context) {
+ feature = EsriLeaflet.Util.geojsonToArcGIS(feature, this.options.idAttribute);
+
+ return this.post('updateFeatures', {
+ features: [feature]
+ }, function(error, response){
+ var result = (response && response.updateResults) ? response.updateResults[0] : undefined;
+ if(callback){
+ callback.call(context, error || response.updateResults[0].error, result);
+ }
+ }, context);
+ },
+
+ deleteFeature: function(id, callback, context) {
+ return this.post('deleteFeatures', {
+ objectIds: id
+ }, function(error, response){
+ var result = (response && response.deleteResults) ? response.deleteResults[0] : undefined;
+ if(callback){
+ callback.call(context, error || response.deleteResults[0].error, result);
+ }
+ }, context);
+ }
+
+});
+
+EsriLeaflet.Services.featureLayer = function(options) {
+ return new EsriLeaflet.Services.FeatureLayer(options);
+};
+
+EsriLeaflet.Tasks.Task = L.Class.extend({
+
+ options: {
+ proxy: false,
+ useCors: EsriLeaflet.Support.CORS
+ },
+
+ //Generate a method for each methodName:paramName in the setters for this task.
+ generateSetter: function(param, context){
+ return L.Util.bind(function(value){
+ this.params[param] = value;
+ return this;
+ }, context);
+ },
+
+ initialize: function(endpoint){
+ // endpoint can be either a url (and options) for an ArcGIS Rest Service or an instance of EsriLeaflet.Service
+ if(endpoint.request && endpoint.options){
+ this._service = endpoint;
+ L.Util.setOptions(this, endpoint.options);
+ } else {
+ L.Util.setOptions(this, endpoint);
+ this.options.url = L.esri.Util.cleanUrl(endpoint.url);
+ }
+
+ // clone default params into this object
+ this.params = L.Util.extend({}, this.params || {});
+
+ // generate setter methods based on the setters object implimented a child class
+ if(this.setters){
+ for (var setter in this.setters){
+ var param = this.setters[setter];
+ this[setter] = this.generateSetter(param, this);
+ }
+ }
+ },
+
+ token: function(token){
+ if(this._service){
+ this._service.authenticate(token);
+ } else {
+ this.params.token = token;
+ }
+ return this;
+ },
+
+ request: function(callback, context){
+ if(this._service){
+ return this._service.request(this.path, this.params, callback, context);
+ } else {
+ return this._request('request', this.path, this.params, callback, context);
+ }
+ },
+
+ _request: function(method, path, params, callback, context){
+ var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;
+ if((method === 'get' || method === 'request') && !this.options.useCors){
+ return EsriLeaflet.Request.get.JSONP(url, params, callback, context);
+ } else{
+ return EsriLeaflet[method](url, params, callback, context);
+ }
+ }
+});
+
+EsriLeaflet.Tasks.Query = EsriLeaflet.Tasks.Task.extend({
+ setters: {
+ 'offset': 'offset',
+ 'limit': 'limit',
+ 'fields': 'outFields',
+ 'precision': 'geometryPrecision',
+ 'featureIds': 'objectIds',
+ 'returnGeometry': 'returnGeometry',
+ 'token': 'token'
+ },
+
+ path: 'query',
+
+ params: {
+ returnGeometry: true,
+ where: '1=1',
+ outSr: 4326,
+ outFields: '*'
+ },
+
+ within: function(geometry){
+ this._setGeometry(geometry);
+ this.params.spatialRel = 'esriSpatialRelContains'; // will make code read layer within geometry, to the api this will reads geometry contains layer
+ return this;
+ },
+
+ intersects: function(geometry){
+ this._setGeometry(geometry);
+ this.params.spatialRel = 'esriSpatialRelIntersects';
+ return this;
+ },
+
+ contains: function(geometry){
+ this._setGeometry(geometry);
+ this.params.spatialRel = 'esriSpatialRelWithin'; // will make code read layer contains geometry, to the api this will reads geometry within layer
+ return this;
+ },
+
+ // crosses: function(geometry){
+ // this._setGeometry(geometry);
+ // this.params.spatialRel = 'esriSpatialRelCrosses';
+ // return this;
+ // },
+
+ // touches: function(geometry){
+ // this._setGeometry(geometry);
+ // this.params.spatialRel = 'esriSpatialRelTouches';
+ // return this;
+ // },
+
+ overlaps: function(geometry){
+ this._setGeometry(geometry);
+ this.params.spatialRel = 'esriSpatialRelOverlaps';
+ return this;
+ },
+
+ // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online
+ nearby: function(latlng, radius){
+ latlng = L.latLng(latlng);
+ this.params.geometry = [latlng.lng, latlng.lat];
+ this.params.geometryType = 'esriGeometryPoint';
+ this.params.spatialRel = 'esriSpatialRelIntersects';
+ this.params.units = 'esriSRUnit_Meter';
+ this.params.distance = radius;
+ this.params.inSr = 4326;
+ return this;
+ },
+
+ where: function(string){
+ this.params.where = string.replace(/"/g, "\'"); // jshint ignore:line
+ return this;
+ },
+
+ between: function(start, end){
+ this.params.time = [start.valueOf(), end.valueOf()];
+ return this;
+ },
+
+ simplify: function(map, factor){
+ var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());
+ this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;
+ return this;
+ },
+
+ orderBy: function(fieldName, order){
+ order = order || 'ASC';
+ this.params.orderByFields = (this.params.orderByFields) ? this.params.orderByFields + ',' : '';
+ this.params.orderByFields += ([fieldName, order]).join(' ');
+ return this;
+ },
+
+ run: function(callback, context){
+ this._cleanParams();
+
+ // if the service is hosted on arcgis online request geojson directly
+ if(EsriLeaflet.Util.isArcgisOnline(this.options.url)){
+ this.params.f = 'geojson';
+
+ return this.request(function(error, response){
+ callback.call(context, error, response, response);
+ }, context);
+
+ // otherwise convert it in the callback then pass it on
+ } else {
+ return this.request(function(error, response){
+ callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);
+ }, context);
+ }
+ },
+
+ count: function(callback, context){
+ this._cleanParams();
+ this.params.returnCountOnly = true;
+ return this.request(function(error, response){
+ callback.call(this, error, (response && response.count), response);
+ }, context);
+ },
+
+ ids: function(callback, context){
+ this._cleanParams();
+ this.params.returnIdsOnly = true;
+ return this.request(function(error, response){
+ callback.call(this, error, (response && response.objectIds), response);
+ }, context);
+ },
+
+ // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online
+ bounds: function(callback, context){
+ this._cleanParams();
+ this.params.returnExtentOnly = true;
+ return this.request(function(error, response){
+ callback.call(context, error, (response && response.extent && EsriLeaflet.Util.extentToBounds(response.extent)), response);
+ }, context);
+ },
+
+ // only valid for image services
+ pixelSize: function(point){
+ point = L.point(point);
+ this.params.pixelSize = [point.x,point.y];
+ return this;
+ },
+
+ // only valid for map services
+ layer: function(layer){
+ this.path = layer + '/query';
+ return this;
+ },
+
+ _cleanParams: function(){
+ delete this.params.returnIdsOnly;
+ delete this.params.returnExtentOnly;
+ delete this.params.returnCountOnly;
+ },
+
+ _setGeometry: function(geometry) {
+ this.params.inSr = 4326;
+
+ // convert bounds to extent and finish
+ if ( geometry instanceof L.LatLngBounds ) {
+ // set geometry + geometryType
+ this.params.geometry = EsriLeaflet.Util.boundsToExtent(geometry);
+ this.params.geometryType = 'esriGeometryEnvelope';
+ return;
+ }
+
+ // convert L.Marker > L.LatLng
+ if(geometry.getLatLng){
+ geometry = geometry.getLatLng();
+ }
+
+ // convert L.LatLng to a geojson point and continue;
+ if (geometry instanceof L.LatLng) {
+ geometry = {
+ type: 'Point',
+ coordinates: [geometry.lng, geometry.lat]
+ };
+ }
+
+ // handle L.GeoJSON, pull out the first geometry
+ if ( geometry instanceof L.GeoJSON ) {
+ //reassign geometry to the GeoJSON value (we are assuming that only one feature is present)
+ geometry = geometry.getLayers()[0].feature.geometry;
+ this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);
+ this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);
+ }
+
+ // Handle L.Polyline and L.Polygon
+ if (geometry.toGeoJSON) {
+ geometry = geometry.toGeoJSON();
+ }
+
+ // handle GeoJSON feature by pulling out the geometry
+ if ( geometry.type === 'Feature' ) {
+ // get the geometry of the geojson feature
+ geometry = geometry.geometry;
+ }
+
+ // confirm that our GeoJSON is a point, line or polygon
+ if ( geometry.type === 'Point' || geometry.type === 'LineString' || geometry.type === 'Polygon') {
+ this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);
+ this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);
+ return;
+ }
+
+ // warn the user if we havn't found a
+ /* global console */
+ if(console && console.warn) {
+ console.warn('invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object');
+ }
+
+ return;
+ }
+});
+
+EsriLeaflet.Tasks.query = function(params){
+ return new EsriLeaflet.Tasks.Query(params);
+};
+
+EsriLeaflet.Layers.FeatureGrid = L.Class.extend({
+
+ includes: L.Mixin.Events,
+
+ options: {
+ cellSize: 512,
+ updateInterval: 150
+ },
+
+ initialize: function (options) {
+ options = L.setOptions(this, options);
+ },
+
+ onAdd: function (map) {
+ this._map = map;
+ this._update = L.Util.limitExecByInterval(this._update, this.options.updateInterval, this);
+
+ // @TODO remove for leaflet 0.8
+ this._map.addEventListener(this.getEvents(), this);
+
+ this._reset();
+ this._update();
+ },
+
+ onRemove: function(){
+ this._map.removeEventListener(this.getEvents(), this);
+ this._removeCells();
+ },
+
+ getEvents: function () {
+ var events = {
+ viewreset: this._reset,
+ moveend: this._update,
+ zoomend : this._onZoom
+ };
+
+ return events;
+ },
+
+ addTo: function(map){
+ map.addLayer(this);
+ return this;
+ },
+
+ removeFrom: function(map){
+ map.removeLayer(this);
+ return this;
+ },
+
+ _onZoom : function () {
+ var zoom = this._map.getZoom();
+
+ if (zoom > this.options.maxZoom ||
+ zoom < this.options.minZoom) {
+ this.removeFrom(this._map);
+ this._map.addEventListener('zoomend', this.getEvents().zoomend, this);
+ } else if (!this._map.hasLayer(this)) {
+ this._map.removeEventListener('zoomend', this.getEvents().zoomend, this);
+ this.addTo(this._map);
+ }
+
+ },
+
+ _reset: function () {
+ this._removeCells();
+
+ this._cells = {};
+ this._activeCells = {};
+ this._cellsToLoad = 0;
+ this._cellsTotal = 0;
+
+ // @TODO enable at Leaflet 0.8
+ // this._cellNumBounds = this._getCellNumBounds();
+
+ this._resetWrap();
+ },
+
+ _resetWrap: function () {
+ var map = this._map,
+ crs = map.options.crs;
+
+ if (crs.infinite) { return; }
+
+ var cellSize = this._getCellSize();
+
+ if (crs.wrapLng) {
+ this._wrapLng = [
+ Math.floor(map.project([0, crs.wrapLng[0]]).x / cellSize),
+ Math.ceil(map.project([0, crs.wrapLng[1]]).x / cellSize)
+ ];
+ }
+
+ if (crs.wrapLat) {
+ this._wrapLat = [
+ Math.floor(map.project([crs.wrapLat[0], 0]).y / cellSize),
+ Math.ceil(map.project([crs.wrapLat[1], 0]).y / cellSize)
+ ];
+ }
+ },
+
+ _getCellSize: function () {
+ return this.options.cellSize;
+ },
+
+ _update: function () {
+ if (!this._map) { return; }
+
+ var bounds = this._map.getPixelBounds(),
+ zoom = this._map.getZoom(),
+ cellSize = this._getCellSize(),
+ cellPadding = [cellSize/2,cellSize/2];
+ // cellPadding = [0,0]
+
+ if (zoom > this.options.maxZoom ||
+ zoom < this.options.minZoom) { return; }
+
+ // cell coordinates range for the current view
+ var topLeft = bounds.min.subtract(cellPadding).divideBy(cellSize).floor();
+ topLeft.x = Math.max(topLeft.x, 0);
+ topLeft.y = Math.max(topLeft.y, 0);
+
+ var cellBounds = L.bounds(topLeft, bounds.max.add(cellPadding).divideBy(cellSize).floor());
+
+ // remove any present cells that are off the specified bounds
+ this._removeOtherCells(cellBounds);
+ this._addCells(cellBounds);
+ },
+
+ _addCells: function (bounds) {
+ var queue = [],
+ center = bounds.getCenter(),
+ zoom = this._map.getZoom();
+
+ var j, i, coords;
+ // create a queue of coordinates to load cells from
+ for (j = bounds.min.y; j <= bounds.max.y; j++) {
+ for (i = bounds.min.x; i <= bounds.max.x; i++) {
+ coords = new L.Point(i, j);
+ coords.z = zoom;
+
+ // @TODO enable at Leaflet 0.8
+ // if (this._isValidCell(coords)) {
+ // queue.push(coords);
+ // }
+
+ queue.push(coords);
+ }
+ }
+ var cellsToLoad = queue.length;
+
+ if (cellsToLoad === 0) { return; }
+
+ this._cellsToLoad += cellsToLoad;
+ this._cellsTotal += cellsToLoad;
+
+ // sort cell queue to load cells in order of their distance to center
+ queue.sort(function (a, b) {
+ return a.distanceTo(center) - b.distanceTo(center);
+ });
+
+ for (i = 0; i < cellsToLoad; i++) {
+ this._addCell(queue[i]);
+ }
+ },
+
+ // @TODO enable at Leaflet 0.8
+ // _isValidCell: function (coords) {
+ // var crs = this._map.options.crs;
+
+ // if (!crs.infinite) {
+ // // don't load cell if it's out of bounds and not wrapped
+ // var bounds = this._cellNumBounds;
+ // if (
+ // (!crs.wrapLng && (coords.x < bounds.min.x || coords.x > bounds.max.x)) ||
+ // (!crs.wrapLat && (coords.y < bounds.min.y || coords.y > bounds.max.y))
+ // ) {
+ // return false;
+ // }
+ // }
+
+ // if (!this.options.bounds) {
+ // return true;
+ // }
+
+ // // don't load cell if it doesn't intersect the bounds in options
+ // var cellBounds = this._cellCoordsToBounds(coords);
+ // return L.latLngBounds(this.options.bounds).intersects(cellBounds);
+ // },
+
+ // converts cell coordinates to its geographical bounds
+ _cellCoordsToBounds: function (coords) {
+ var map = this._map,
+ cellSize = this.options.cellSize,
+
+ nwPoint = coords.multiplyBy(cellSize),
+ sePoint = nwPoint.add([cellSize, cellSize]),
+
+ // @TODO for Leaflet 0.8
+ // nw = map.wrapLatLng(map.unproject(nwPoint, coords.z)),
+ // se = map.wrapLatLng(map.unproject(sePoint, coords.z));
+
+ nw = map.unproject(nwPoint, coords.z).wrap(),
+ se = map.unproject(sePoint, coords.z).wrap();
+
+ return new L.LatLngBounds(nw, se);
+ },
+
+ // converts cell coordinates to key for the cell cache
+ _cellCoordsToKey: function (coords) {
+ return coords.x + ':' + coords.y;
+ },
+
+ // converts cell cache key to coordiantes
+ _keyToCellCoords: function (key) {
+ var kArr = key.split(':'),
+ x = parseInt(kArr[0], 10),
+ y = parseInt(kArr[1], 10);
+
+ return new L.Point(x, y);
+ },
+
+ // remove any present cells that are off the specified bounds
+ _removeOtherCells: function (bounds) {
+ for (var key in this._cells) {
+ if (!bounds.contains(this._keyToCellCoords(key))) {
+ this._removeCell(key);
+ }
+ }
+ },
+
+ _removeCell: function (key) {
+ var cell = this._activeCells[key];
+ if(cell){
+ delete this._activeCells[key];
+
+ if (this.cellLeave) {
+ this.cellLeave(cell.bounds, cell.coords);
+ }
+
+ this.fire('cellleave', {
+ bounds: cell.bounds,
+ coords: cell.coords
+ });
+ }
+ },
+
+ _removeCells: function(){
+ for (var key in this._cells) {
+ var bounds = this._cells[key].bounds;
+ var coords = this._cells[key].coords;
+
+ if (this.cellLeave) {
+ this.cellLeave(bounds, coords);
+ }
+
+ this.fire('cellleave', {
+ bounds: bounds,
+ coords: coords
+ });
+ }
+ },
+
+ _addCell: function (coords) {
+
+ // wrap cell coords if necessary (depending on CRS)
+ this._wrapCoords(coords);
+
+ // generate the cell key
+ var key = this._cellCoordsToKey(coords);
+
+ // get the cell from the cache
+ var cell = this._cells[key];
+ // if this cell should be shown as isnt active yet (enter)
+
+ if (cell && !this._activeCells[key]) {
+ if (this.cellEnter) {
+ this.cellEnter(cell.bounds, coords);
+ }
+
+ this.fire('cellenter', {
+ bounds: cell.bounds,
+ coords: coords
+ });
+
+ this._activeCells[key] = cell;
+ }
+
+ // if we dont have this cell in the cache yet (create)
+ if (!cell) {
+ cell = {
+ coords: coords,
+ bounds: this._cellCoordsToBounds(coords)
+ };
+
+ this._cells[key] = cell;
+ this._activeCells[key] = cell;
+
+ if(this.createCell){
+ this.createCell(cell.bounds, coords);
+ }
+
+ this.fire('cellcreate', {
+ bounds: cell.bounds,
+ coords: coords
+ });
+ }
+ },
+
+ _wrapCoords: function (coords) {
+ coords.x = this._wrapLng ? L.Util.wrapNum(coords.x, this._wrapLng) : coords.x;
+ coords.y = this._wrapLat ? L.Util.wrapNum(coords.y, this._wrapLat) : coords.y;
+ }
+
+ // get the global cell coordinates range for the current zoom
+ // @TODO enable at Leaflet 0.8
+ // _getCellNumBounds: function () {
+ // // @TODO for Leaflet 0.8
+ // // var bounds = this._map.getPixelWorldBounds(),
+ // // size = this._getCellSize();
+ // //
+ // // return bounds ? L.bounds(
+ // // bounds.min.divideBy(size).floor(),
+ // // bounds.max.divideBy(size).ceil().subtract([1, 1])) : null;
+ // }
+
+});
+
+(function(EsriLeaflet){
+
+ EsriLeaflet.Layers.FeatureManager = EsriLeaflet.Layers.FeatureGrid.extend({
+
+ /**
+ * Options
+ */
+
+ options: {
+ where: '1=1',
+ fields: ['*'],
+ from: false,
+ to: false,
+ timeField: false,
+ timeFilterMode: 'server',
+ simplifyFactor: 0,
+ precision: 6
+ },
+
+ /**
+ * Constructor
+ */
+
+ initialize: function (url, options) {
+ EsriLeaflet.Layers.FeatureGrid.prototype.initialize.call(this, options);
+
+ options = options || {};
+ options.url = EsriLeaflet.Util.cleanUrl(url);
+ options = L.setOptions(this, options);
+
+ this._service = new EsriLeaflet.Services.FeatureLayer(options);
+
+ //use case insensitive regex to look for common fieldnames used for indexing
+ /*global console */
+ if (this.options.fields[0] !== '*'){
+ var oidCheck = false;
+ for (var i = 0; i < this.options.fields.length; i++){
+ if (this.options.fields[i].match(/^(OBJECTID|FID|OID|ID)$/i)){
+ oidCheck = true;
+ }
+ }
+ if (oidCheck === false && console && console.warn){
+ console.warn('no known esriFieldTypeOID field detected in fields Array. Please add an attribute field containing unique IDs to ensure the layer can be drawn correctly.');
+ }
+ }
+
+ // Leaflet 0.8 change to new propagation
+ this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', function (e) {
+ e = L.extend({
+ target: this
+ }, e);
+ this.fire(e.type, e);
+ }, this);
+
+ if(this.options.timeField.start && this.options.timeField.end){
+ this._startTimeIndex = new BinarySearchIndex();
+ this._endTimeIndex = new BinarySearchIndex();
+ } else if(this.options.timeField){
+ this._timeIndex = new BinarySearchIndex();
+ }
+
+ this._cache = {};
+ this._currentSnapshot = []; // cache of what layers should be active
+ this._activeRequests = 0;
+ this._pendingRequests = [];
+ },
+
+ /**
+ * Layer Interface
+ */
+
+ onAdd: function(map){
+ return EsriLeaflet.Layers.FeatureGrid.prototype.onAdd.call(this, map);
+ },
+
+ onRemove: function(map){
+ return EsriLeaflet.Layers.FeatureGrid.prototype.onRemove.call(this, map);
+ },
+
+ getAttribution: function () {
+ return this.options.attribution;
+ },
+
+ /**
+ * Feature Managment
+ */
+
+ createCell: function(bounds, coords){
+ this._requestFeatures(bounds, coords);
+ },
+
+ _requestFeatures: function(bounds, coords, callback){
+ this._activeRequests++;
+
+ // our first active request fires loading
+ if(this._activeRequests === 1){
+ this.fire('loading', {
+ bounds: bounds
+ });
+ }
+
+ return this._buildQuery(bounds).run(function(error, featureCollection, response){
+ if(response && response.exceededTransferLimit){
+ this.fire('drawlimitexceeded');
+ }
+
+ //deincriment the request counter
+ this._activeRequests--;
+
+ if(!error && featureCollection.features.length){
+ // schedule adding features until the next animation frame
+ EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){
+ this._addFeatures(featureCollection.features, coords);
+ }, this));
+ }
+
+ if(callback){
+ callback.call(this, error, featureCollection);
+ }
+
+ // if there are no more active requests fire a load event for this view
+ if(this._activeRequests <= 0){
+ this.fire('load', {
+ bounds: bounds
+ });
+ }
+ }, this);
+ },
+
+ _cacheKey: function (coords){
+ return coords.z + ':' + coords.x + ':' +coords.y;
+ },
+
+ _addFeatures: function(features, coords){
+ var key = this._cacheKey(coords);
+ this._cache[key] = this._cache[key] || [];
+
+ for (var i = features.length - 1; i >= 0; i--) {
+ var id = features[i].id;
+ this._currentSnapshot.push(id);
+ this._cache[key].push(id);
+ }
+
+ if(this.options.timeField){
+ this._buildTimeIndexes(features);
+ }
+
+ var zoom = this._map.getZoom();
+
+ if (zoom > this.options.maxZoom ||
+ zoom < this.options.minZoom) { return; }
+
+ this.createLayers(features);
+ },
+
+ _buildQuery: function(bounds){
+ var query = this._service.query().intersects(bounds).where(this.options.where).fields(this.options.fields).precision(this.options.precision);
+
+ if(this.options.simplifyFactor){
+ query.simplify(this._map, this.options.simplifyFactor);
+ }
+
+ if(this.options.timeFilterMode === 'server' && this.options.from && this.options.to){
+ query.between(this.options.from, this.options.to);
+ }
+
+ return query;
+ },
+
+ /**
+ * Where Methods
+ */
+
+ setWhere: function(where, callback, context){
+
+ this.options.where = (where && where.length) ? where : '1=1';
+
+ var oldSnapshot = [];
+ var newShapshot = [];
+ var pendingRequests = 0;
+ var requestError = null;
+ var requestCallback = L.Util.bind(function(error, featureCollection){
+ if(error){
+ requestError = error;
+ }
+
+ if(featureCollection){
+ for (var i = featureCollection.features.length - 1; i >= 0; i--) {
+ newShapshot.push(featureCollection.features[i].id);
+ }
+ }
+
+ pendingRequests--;
+
+ if(pendingRequests <= 0){
+ this._currentSnapshot = newShapshot;
+ // schedule adding features until the next animation frame
+ EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){
+ this.removeLayers(oldSnapshot);
+ this.addLayers(newShapshot);
+ if(callback) {
+ callback.call(context, requestError);
+ }
+ }, this));
+
+ }
+ }, this);
+
+ for (var i = this._currentSnapshot.length - 1; i >= 0; i--) {
+ oldSnapshot.push(this._currentSnapshot[i]);
+ }
+
+ for(var key in this._activeCells){
+ pendingRequests++;
+ var coords = this._keyToCellCoords(key);
+ var bounds = this._cellCoordsToBounds(coords);
+ this._requestFeatures(bounds, key, requestCallback);
+ }
+
+ return this;
+ },
+
+ getWhere: function(){
+ return this.options.where;
+ },
+
+ /**
+ * Time Range Methods
+ */
+
+ getTimeRange: function(){
+ return [this.options.from, this.options.to];
+ },
+
+ setTimeRange: function(from, to, callback, context){
+ var oldFrom = this.options.from;
+ var oldTo = this.options.to;
+ var pendingRequests = 0;
+ var requestError = null;
+ var requestCallback = L.Util.bind(function(error){
+ if(error){
+ requestError = error;
+ }
+ this._filterExistingFeatures(oldFrom, oldTo, from, to);
+
+ pendingRequests--;
+
+ if(callback && pendingRequests <= 0){
+ callback.call(context, requestError);
+ }
+ }, this);
+
+ this.options.from = from;
+ this.options.to = to;
+
+ this._filterExistingFeatures(oldFrom, oldTo, from, to);
+
+ if(this.options.timeFilterMode === 'server') {
+ for(var key in this._activeCells){
+ pendingRequests++;
+ var coords = this._keyToCellCoords(key);
+ var bounds = this._cellCoordsToBounds(coords);
+ this._requestFeatures(bounds, key, requestCallback);
+ }
+ }
+ },
+
+ refresh: function(){
+ for(var key in this._activeCells){
+ var coords = this._keyToCellCoords(key);
+ var bounds = this._cellCoordsToBounds(coords);
+ this._requestFeatures(bounds, key);
+ }
+ },
+
+ _filterExistingFeatures: function (oldFrom, oldTo, newFrom, newTo) {
+ var layersToRemove = (oldFrom && oldTo) ? this._getFeaturesInTimeRange(oldFrom, oldTo) : this._currentSnapshot;
+ var layersToAdd = this._getFeaturesInTimeRange(newFrom, newTo);
+
+ if(layersToAdd.indexOf){
+ for (var i = 0; i < layersToAdd.length; i++) {
+ var shouldRemoveLayer = layersToRemove.indexOf(layersToAdd[i]);
+ if(shouldRemoveLayer >= 0){
+ layersToRemove.splice(shouldRemoveLayer, 1);
+ }
+ }
+ }
+
+ // schedule adding features until the next animation frame
+ EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){
+ this.removeLayers(layersToRemove);
+ this.addLayers(layersToAdd);
+ }, this));
+ },
+
+ _getFeaturesInTimeRange: function(start, end){
+ var ids = [];
+ var search;
+
+ if(this.options.timeField.start && this.options.timeField.end){
+ var startTimes = this._startTimeIndex.between(start, end);
+ var endTimes = this._endTimeIndex.between(start, end);
+ search = startTimes.concat(endTimes);
+ } else {
+ search = this._timeIndex.between(start, end);
+ }
+
+ for (var i = search.length - 1; i >= 0; i--) {
+ ids.push(search[i].id);
+ }
+
+ return ids;
+ },
+
+ _buildTimeIndexes: function(geojson){
+ var i;
+ var feature;
+ if(this.options.timeField.start && this.options.timeField.end){
+ var startTimeEntries = [];
+ var endTimeEntries = [];
+ for (i = geojson.length - 1; i >= 0; i--) {
+ feature = geojson[i];
+ startTimeEntries.push( {
+ id: feature.id,
+ value: new Date(feature.properties[this.options.timeField.start])
+ });
+ endTimeEntries.push( {
+ id: feature.id,
+ value: new Date(feature.properties[this.options.timeField.end])
+ });
+ }
+ this._startTimeIndex.bulkAdd(startTimeEntries);
+ this._endTimeIndex.bulkAdd(endTimeEntries);
+ } else {
+ var timeEntries = [];
+ for (i = geojson.length - 1; i >= 0; i--) {
+ feature = geojson[i];
+ timeEntries.push( {
+ id: feature.id,
+ value: new Date(feature.properties[this.options.timeField])
+ });
+ }
+
+ this._timeIndex.bulkAdd(timeEntries);
+ }
+ },
+
+ _featureWithinTimeRange: function(feature){
+ if(!this.options.from || !this.options.to){
+ return true;
+ }
+
+ var from = +this.options.from.valueOf();
+ var to = +this.options.to.valueOf();
+
+ if(typeof this.options.timeField === 'string'){
+ var date = +feature.properties[this.options.timeField];
+ return (date >= from) && (date <= to);
+ }
+
+ if(this.options.timeField.start && this.options.timeField.end){
+ var startDate = +feature.properties[this.options.timeField.start];
+ var endDate = +feature.properties[this.options.timeField.end];
+ return ((startDate >= from) && (startDate <= to)) || ((endDate >= from) && (endDate <= to));
+ }
+ },
+
+ /**
+ * Service Methods
+ */
+
+ authenticate: function(token){
+ this._service.authenticate(token);
+ return this;
+ },
+
+ metadata: function(callback, context){
+ this._service.metadata(callback, context);
+ return this;
+ },
+
+ query: function(){
+ return this._service.query();
+ },
+
+ addFeature: function(feature, callback, context){
+ this._service.addFeature(feature, function(error, response){
+ if(!error){
+ this.refresh();
+ }
+ if(callback){
+ callback.call(context, error, response);
+ }
+ }, this);
+ return this;
+ },
+
+ updateFeature: function(feature, callback, context){
+ return this._service.updateFeature(feature, function(error, response){
+ if(!error){
+ this.refresh();
+ }
+ if(callback){
+ callback.call(context, error, response);
+ }
+ }, this);
+ },
+
+ deleteFeature: function(id, callback, context){
+ return this._service.deleteFeature(id, function(error, response){
+ if(!error && response.objectId){
+ this.removeLayers([response.objectId], true);
+ }
+ if(callback){
+ callback.call(context, error, response);
+ }
+ }, this);
+ }
+ });
+
+ /**
+ * Temporal Binary Search Index
+ */
+
+ function BinarySearchIndex(values) {
+ this.values = values || [];
+ }
+
+ BinarySearchIndex.prototype._query = function(query){
+ var minIndex = 0;
+ var maxIndex = this.values.length - 1;
+ var currentIndex;
+ var currentElement;
+ var resultIndex;
+
+ while (minIndex <= maxIndex) {
+ resultIndex = currentIndex = (minIndex + maxIndex) / 2 | 0;
+ currentElement = this.values[Math.round(currentIndex)];
+ if (+currentElement.value < +query) {
+ minIndex = currentIndex + 1;
+ } else if (+currentElement.value > +query) {
+ maxIndex = currentIndex - 1;
+ } else {
+ return currentIndex;
+ }
+ }
+
+ return ~maxIndex;
+ };
+
+ BinarySearchIndex.prototype.sort = function(){
+ this.values.sort(function(a, b) {
+ return +b.value - +a.value;
+ }).reverse();
+ this.dirty = false;
+ };
+
+ BinarySearchIndex.prototype.between = function(start, end){
+ if(this.dirty){
+ this.sort();
+ }
+
+ var startIndex = this._query(start);
+ var endIndex = this._query(end);
+
+ if(startIndex === 0 && endIndex === 0){
+ return [];
+ }
+
+ startIndex = Math.abs(startIndex);
+ endIndex = (endIndex < 0) ? Math.abs(endIndex): endIndex + 1;
+
+ return this.values.slice(startIndex, endIndex);
+ };
+
+ BinarySearchIndex.prototype.bulkAdd = function(items){
+ this.dirty = true;
+ this.values = this.values.concat(items);
+ };
+
+})(EsriLeaflet);
+
+EsriLeaflet.Layers.FeatureLayer = EsriLeaflet.Layers.FeatureManager.extend({
+
+ statics: {
+ EVENTS: 'click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose'
+ },
+
+ options: {
+ cacheLayers: true
+ },
+
+ /**
+ * Constructor
+ */
+
+ initialize: function (url, options) {
+ EsriLeaflet.Layers.FeatureManager.prototype.initialize.call(this, url, options);
+
+ options = L.setOptions(this, options);
+
+ this._layers = {};
+ this._leafletIds = {};
+ this._key = 'c'+(Math.random() * 1e9).toString(36).replace('.', '_');
+ },
+
+ /**
+ * Layer Interface
+ */
+
+ onAdd: function(map){
+ map.on('zoomstart zoomend', function(e){
+ this._zooming = (e.type === 'zoomstart');
+ }, this);
+ return EsriLeaflet.Layers.FeatureManager.prototype.onAdd.call(this, map);
+ },
+
+ onRemove: function(map){
+ for (var i in this._layers) {
+ map.removeLayer(this._layers[i]);
+ }
+
+ return EsriLeaflet.Layers.FeatureManager.prototype.onRemove.call(this, map);
+ },
+
+ createNewLayer: function(geojson){
+ // @TODO Leaflet 0.8
+ //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);
+ return L.GeoJSON.geometryToLayer(geojson, this.options.pointToLayer, L.GeoJSON.coordsToLatLng, this.options);
+ },
+
+ /**
+ * Feature Managment Methods
+ */
+
+ createLayers: function(features){
+ for (var i = features.length - 1; i >= 0; i--) {
+
+ var geojson = features[i];
+
+ var layer = this._layers[geojson.id];
+ var newLayer;
+
+ if(layer && !this._map.hasLayer(layer)){
+ this._map.addLayer(layer);
+ }
+
+ if (layer && layer.setLatLngs) {
+ // @TODO Leaflet 0.8
+ //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);
+
+ var updateGeo = this.createNewLayer(geojson);
+ layer.setLatLngs(updateGeo.getLatLngs());
+ }
+
+ if(!layer){
+ // @TODO Leaflet 0.8
+ //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);
+
+ newLayer = this.createNewLayer(geojson);
+ newLayer.feature = geojson;
+ newLayer.defaultOptions = newLayer.options;
+ newLayer._leaflet_id = this._key + '_' + geojson.id;
+
+ this._leafletIds[newLayer._leaflet_id] = geojson.id;
+
+ // bubble events from layers to this
+ // @TODO Leaflet 0.8
+ // newLayer.addEventParent(this);
+
+ newLayer.on(EsriLeaflet.Layers.FeatureLayer.EVENTS, this._propagateEvent, this);
+
+ // bind a popup if we have one
+ if(this._popup && newLayer.bindPopup){
+ newLayer.bindPopup(this._popup(newLayer.feature, newLayer), this._popupOptions);
+ }
+
+ if(this.options.onEachFeature){
+ this.options.onEachFeature(newLayer.feature, newLayer);
+ }
+
+ // cache the layer
+ this._layers[newLayer.feature.id] = newLayer;
+
+ // style the layer
+ this.resetStyle(newLayer.feature.id);
+
+ this.fire('createfeature', {
+ feature: newLayer.feature
+ });
+
+ // add the layer if it is within the time bounds or our layer is not time enabled
+ if(!this.options.timeField || (this.options.timeField && this._featureWithinTimeRange(geojson)) ){
+ this._map.addLayer(newLayer);
+ }
+ }
+ }
+ },
+
+ addLayers: function(ids){
+ for (var i = ids.length - 1; i >= 0; i--) {
+ var layer = this._layers[ids[i]];
+ if(layer){
+ this.fire('addfeature', {
+ feature: layer.feature
+ });
+ this._map.addLayer(layer);
+ }
+ }
+ },
+
+ removeLayers: function(ids, permanent){
+ for (var i = ids.length - 1; i >= 0; i--) {
+ var id = ids[i];
+ var layer = this._layers[id];
+ if(layer){
+ this.fire('removefeature', {
+ feature: layer.feature,
+ permanent: permanent
+ });
+ this._map.removeLayer(layer);
+ }
+ if(layer && permanent){
+ delete this._layers[id];
+ }
+ }
+ },
+
+ cellEnter: function(bounds, coords){
+ if(!this._zooming){
+ EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){
+ var cacheKey = this._cacheKey(coords);
+ var cellKey = this._cellCoordsToKey(coords);
+ var layers = this._cache[cacheKey];
+ if(this._activeCells[cellKey] && layers){
+ this.addLayers(layers);
+ }
+ }, this));
+ }
+ },
+
+ cellLeave: function(bounds, coords){
+ if(!this._zooming){
+ EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){
+ var cacheKey = this._cacheKey(coords);
+ var cellKey = this._cellCoordsToKey(coords);
+ var layers = this._cache[cacheKey];
+ var mapBounds = this._map.getBounds();
+ if(!this._activeCells[cellKey] && layers){
+ var removable = true;
+
+ for (var i = 0; i < layers.length; i++) {
+ var layer = this._layers[layers[i]];
+ if(layer && layer.getBounds && mapBounds.intersects(layer.getBounds())){
+ removable = false;
+ }
+ }
+
+ if(removable){
+ this.removeLayers(layers, !this.options.cacheLayers);
+ }
+
+ if(!this.options.cacheLayers && removable){
+ delete this._cache[cacheKey];
+ delete this._cells[cellKey];
+ delete this._activeCells[cellKey];
+ }
+ }
+ }, this));
+ }
+ },
+
+ /**
+ * Styling Methods
+ */
+
+ resetStyle: function (id) {
+ var layer = this._layers[id];
+
+ if(layer){
+ layer.options = layer.defaultOptions;
+ this.setFeatureStyle(layer.feature.id, this.options.style);
+ }
+
+ return this;
+ },
+
+ setStyle: function (style) {
+ this.options.style = style;
+ this.eachFeature(function (layer) {
+ this.setFeatureStyle(layer.feature.id, style);
+ }, this);
+ return this;
+ },
+
+ setFeatureStyle: function (id, style) {
+ var layer = this._layers[id];
+
+ if (typeof style === 'function') {
+ style = style(layer.feature);
+ }
+
+ /*trap inability to access default style options from MultiLine/MultiPolygon
+ please revisit at Leaflet 1.0*/
+ else if (!style && !layer.defaultOptions) {
+ var dummyPath = new L.Path();
+ style = L.Path.prototype.options;
+ style.fill = true; //not set by default
+ }
+
+ if (layer.setStyle) {
+ layer.setStyle(style);
+ }
+ },
+
+ /**
+ * Popup Methods
+ */
+
+ bindPopup: function (fn, options) {
+ this._popup = fn;
+ this._popupOptions = options;
+ for (var i in this._layers) {
+ var layer = this._layers[i];
+ var popupContent = this._popup(layer.feature, layer);
+ layer.bindPopup(popupContent, options);
+ }
+ return this;
+ },
+
+ unbindPopup: function () {
+ this._popup = false;
+ for (var i in this._layers) {
+ var layer = this._layers[i];
+ if (layer.unbindPopup) {
+ layer.unbindPopup();
+ } else if (layer.getLayers) {
+ var groupLayers = layer.getLayers();
+ for (var j in groupLayers) {
+ var gLayer = groupLayers[j];
+ gLayer.unbindPopup();
+ }
+ }
+ }
+ return this;
+ },
+
+ /**
+ * Utility Methods
+ */
+
+ eachFeature: function (fn, context) {
+ for (var i in this._layers) {
+ fn.call(context, this._layers[i]);
+ }
+ return this;
+ },
+
+ getFeature: function (id) {
+ return this._layers[id];
+ },
+
+ // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js
+ // @TODO remove at Leaflet 0.8
+ _propagateEvent: function (e) {
+ e.layer = this._layers[this._leafletIds[e.target._leaflet_id]];
+ e.target = this;
+ this.fire(e.type, e);
+ }
+});
+
+EsriLeaflet.FeatureLayer = EsriLeaflet.Layers.FeatureLayer;
+
+EsriLeaflet.Layers.featureLayer = function(url, options){
+ return new EsriLeaflet.Layers.FeatureLayer(url, options);
+};
+
+EsriLeaflet.featureLayer = function(url, options){
+ return new EsriLeaflet.Layers.FeatureLayer(url, options);
+};
+
+ return EsriLeaflet;
+}));
+//# sourceMappingURL=esri-leaflet-feature-layer-src.js.map
\ No newline at end of file
diff --git a/dist/builds/feature-layer/esri-leaflet-feature-layer-src.js.map b/dist/builds/feature-layer/esri-leaflet-feature-layer-src.js.map
new file mode 100644
index 000000000..2f24feca5
--- /dev/null
+++ b/dist/builds/feature-layer/esri-leaflet-feature-layer-src.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["../../../src/EsriLeaflet.js","../../../src/Util.js","../../../src/Request.js","../../../src/Services/Service.js","../../../src/Services/FeatureLayer.js","../../../src/Tasks/Task.js","../../../src/Tasks/Query.js","../../../src/Layers/FeatureLayer/FeatureGrid.js","../../../src/Layers/FeatureLayer/FeatureManager.js","../../../src/Layers/FeatureLayer/FeatureLayer.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI;AACxC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;AACxB,EAAE,MAAM,CAAC,CAAC,GAAG;AACb,EAAE,QAAQ,CAAC,CAAC,GAAG;AACf,EAAE,QAAQ,CAAC,CAAC,GAAG;AACf,EAAE,KAAK,CAAC,CAAC,GAAG;AACZ,EAAE,IAAI,CAAC,CAAC,GAAG;AACX,EAAE,OAAO,CAAC,CAAC,CAAC;AACZ,IAAI,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,cAAc,IAAI;AACjF,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Layers: {},\n Services: {},\n Controls: {},\n Tasks: {},\n Util: {},\n Support: {\n CORS: !!(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()),\n pointerEvents: document.documentElement.style.pointerEvents === ''\n }\n};\n\nif(typeof window !== 'undefined' && window.L){\n window.L.esri = EsriLeaflet;\n}\n","(function(EsriLeaflet){\n\n // normalize request animation frame\n var raf = window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function(cb) { return window.setTimeout(cb, 1000 / 60); };\n\n // shallow object clone for feature properties and attributes\n // from http://jsperf.com/cloning-an-object/2\n function clone(obj) {\n var target = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n target[i] = obj[i];\n }\n }\n return target;\n }\n\n // checks if 2 x,y points are equal\n function pointsEqual(a, b) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n }\n\n // checks if the first and last points of a ring are equal and closes the ring\n function closeRing(coordinates) {\n if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {\n coordinates.push(coordinates[0]);\n }\n return coordinates;\n }\n\n // determine if polygon ring coordinates are clockwise. clockwise signifies outer ring, counter-clockwise an inner ring\n // or hole. this logic was found at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-\n // points-are-in-clockwise-order\n function ringIsClockwise(ringToTest) {\n var total = 0,i = 0;\n var rLength = ringToTest.length;\n var pt1 = ringToTest[i];\n var pt2;\n for (i; i < rLength - 1; i++) {\n pt2 = ringToTest[i + 1];\n total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);\n pt1 = pt2;\n }\n return (total >= 0);\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L504-L519\n function vertexIntersectsVertex(a1, a2, b1, b2) {\n var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);\n var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);\n var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);\n\n if ( uB !== 0 ) {\n var ua = uaT / uB;\n var ub = ubT / uB;\n\n if ( 0 <= ua && ua <= 1 && 0 <= ub && ub <= 1 ) {\n return true;\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L521-L531\n function arrayIntersectsArray(a, b) {\n for (var i = 0; i < a.length - 1; i++) {\n for (var j = 0; j < b.length - 1; j++) {\n if (vertexIntersectsVertex(a[i], a[i + 1], b[j], b[j + 1])) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L470-L480\n function coordinatesContainPoint(coordinates, point) {\n var contains = false;\n for(var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {\n if (((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||\n (coordinates[j][1] <= point[1] && point[1] < coordinates[i][1])) &&\n (point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0])) {\n contains = !contains;\n }\n }\n return contains;\n }\n\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L106-L113\n function coordinatesContainCoordinates(outer, inner){\n var intersects = arrayIntersectsArray(outer, inner);\n var contains = coordinatesContainPoint(outer, inner[0]);\n if(!intersects && contains){\n return true;\n }\n return false;\n }\n\n // do any polygons in this array contain any other polygons in this array?\n // used for checking for holes in arcgis rings\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L117-L172\n function convertRingsToGeoJSON(rings){\n var outerRings = [];\n var holes = [];\n var x; // iterator\n var outerRing; // current outer ring being evaluated\n var hole; // current hole being evaluated\n\n // for each ring\n for (var r = 0; r < rings.length; r++) {\n var ring = closeRing(rings[r].slice(0));\n if(ring.length < 4){\n continue;\n }\n // is this ring an outer ring? is it clockwise?\n if(ringIsClockwise(ring)){\n var polygon = [ ring ];\n outerRings.push(polygon); // push to outer rings\n } else {\n holes.push(ring); // counterclockwise push to holes\n }\n }\n\n var uncontainedHoles = [];\n\n // while there are holes left...\n while(holes.length){\n // pop a hole off out stack\n hole = holes.pop();\n\n // loop over all outer rings and see if they contain our hole.\n var contained = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(coordinatesContainCoordinates(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n contained = true;\n break;\n }\n }\n\n // ring is not contained in any outer ring\n // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320\n if(!contained){\n uncontainedHoles.push(hole);\n }\n }\n\n // if we couldn't match any holes using contains we can try intersects...\n while(uncontainedHoles.length){\n // pop a hole off out stack\n hole = uncontainedHoles.pop();\n\n // loop over all outer rings and see if any intersect our hole.\n var intersects = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(arrayIntersectsArray(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n intersects = true;\n break;\n }\n }\n\n if(!intersects) {\n outerRings.push([hole.reverse()]);\n }\n }\n\n if(outerRings.length === 1){\n return {\n type: 'Polygon',\n coordinates: outerRings[0]\n };\n } else {\n return {\n type: 'MultiPolygon',\n coordinates: outerRings\n };\n }\n }\n\n // This function ensures that rings are oriented in the right directions\n // outer rings are clockwise, holes are counterclockwise\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function orientRings(poly){\n var output = [];\n var polygon = poly.slice(0);\n var outerRing = closeRing(polygon.shift().slice(0));\n if(outerRing.length >= 4){\n if(!ringIsClockwise(outerRing)){\n outerRing.reverse();\n }\n\n output.push(outerRing);\n\n for (var i = 0; i < polygon.length; i++) {\n var hole = closeRing(polygon[i].slice(0));\n if(hole.length >= 4){\n if(ringIsClockwise(hole)){\n hole.reverse();\n }\n output.push(hole);\n }\n }\n }\n\n return output;\n }\n\n // This function flattens holes in multipolygons to one array of polygons\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function flattenMultiPolygonRings(rings){\n var output = [];\n for (var i = 0; i < rings.length; i++) {\n var polygon = orientRings(rings[i]);\n for (var x = polygon.length - 1; x >= 0; x--) {\n var ring = polygon[x].slice(0);\n output.push(ring);\n }\n }\n return output;\n }\n\n // convert an extent (ArcGIS) to LatLngBounds (Leaflet)\n EsriLeaflet.Util.extentToBounds = function(extent){\n var sw = new L.LatLng(extent.ymin, extent.xmin);\n var ne = new L.LatLng(extent.ymax, extent.xmax);\n return new L.LatLngBounds(sw, ne);\n };\n\n // convert an LatLngBounds (Leaflet) to extent (ArcGIS)\n EsriLeaflet.Util.boundsToExtent = function(bounds) {\n bounds = L.latLngBounds(bounds);\n return {\n 'xmin': bounds.getSouthWest().lng,\n 'ymin': bounds.getSouthWest().lat,\n 'xmax': bounds.getNorthEast().lng,\n 'ymax': bounds.getNorthEast().lat,\n 'spatialReference': {\n 'wkid' : 4326\n }\n };\n };\n\n EsriLeaflet.Util.arcgisToGeojson = function (arcgis, idAttribute){\n var geojson = {};\n\n if(typeof arcgis.x === 'number' && typeof arcgis.y === 'number'){\n geojson.type = 'Point';\n geojson.coordinates = [arcgis.x, arcgis.y];\n }\n\n if(arcgis.points){\n geojson.type = 'MultiPoint';\n geojson.coordinates = arcgis.points.slice(0);\n }\n\n if(arcgis.paths) {\n if(arcgis.paths.length === 1){\n geojson.type = 'LineString';\n geojson.coordinates = arcgis.paths[0].slice(0);\n } else {\n geojson.type = 'MultiLineString';\n geojson.coordinates = arcgis.paths.slice(0);\n }\n }\n\n if(arcgis.rings) {\n geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));\n }\n\n if(arcgis.geometry || arcgis.attributes) {\n geojson.type = 'Feature';\n geojson.geometry = (arcgis.geometry) ? EsriLeaflet.Util.arcgisToGeojson(arcgis.geometry) : null;\n geojson.properties = (arcgis.attributes) ? clone(arcgis.attributes) : null;\n if(arcgis.attributes) {\n geojson.id = arcgis.attributes[idAttribute] || arcgis.attributes.OBJECTID || arcgis.attributes.FID;\n }\n }\n\n return geojson;\n };\n\n // GeoJSON -> ArcGIS\n EsriLeaflet.Util.geojsonToArcGIS = function(geojson, idAttribute){\n idAttribute = idAttribute || 'OBJECTID';\n var spatialReference = { wkid: 4326 };\n var result = {};\n var i;\n\n switch(geojson.type){\n case 'Point':\n result.x = geojson.coordinates[0];\n result.y = geojson.coordinates[1];\n result.spatialReference = spatialReference;\n break;\n case 'MultiPoint':\n result.points = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'LineString':\n result.paths = [geojson.coordinates.slice(0)];\n result.spatialReference = spatialReference;\n break;\n case 'MultiLineString':\n result.paths = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'Polygon':\n result.rings = orientRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'MultiPolygon':\n result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'Feature':\n if(geojson.geometry) {\n result.geometry = EsriLeaflet.Util.geojsonToArcGIS(geojson.geometry, idAttribute);\n }\n result.attributes = (geojson.properties) ? clone(geojson.properties) : {};\n if(geojson.id){\n result.attributes[idAttribute] = geojson.id;\n }\n break;\n case 'FeatureCollection':\n result = [];\n for (i = 0; i < geojson.features.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.features[i], idAttribute));\n }\n break;\n case 'GeometryCollection':\n result = [];\n for (i = 0; i < geojson.geometries.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.geometries[i], idAttribute));\n }\n break;\n }\n\n return result;\n };\n\n EsriLeaflet.Util.responseToFeatureCollection = function(response, idAttribute){\n var objectIdField;\n\n if(idAttribute){\n objectIdField = idAttribute;\n } else if(response.objectIdFieldName){\n objectIdField = response.objectIdFieldName;\n } else if(response.fields) {\n for (var j = 0; j <= response.fields.length - 1; j++) {\n if(response.fields[j].type === 'esriFieldTypeOID') {\n objectIdField = response.fields[j].name;\n break;\n }\n }\n } else {\n objectIdField = 'OBJECTID';\n }\n\n var featureCollection = {\n type: 'FeatureCollection',\n features: []\n };\n var features = response.features || response.results;\n if(features.length){\n for (var i = features.length - 1; i >= 0; i--) {\n featureCollection.features.push(EsriLeaflet.Util.arcgisToGeojson(features[i], objectIdField));\n }\n }\n\n return featureCollection;\n };\n\n // trim whitespace and add a tailing slash is needed to a url\n EsriLeaflet.Util.cleanUrl = function(url){\n url = url.replace(/\\s\\s*/g, '');\n\n //add a trailing slash to the url if the user omitted it\n if(url[url.length-1] !== '/'){\n url += '/';\n }\n\n return url;\n };\n\n EsriLeaflet.Util.isArcgisOnline = function(url){\n return (/\\.arcgis\\.com/g).test(url);\n };\n\n EsriLeaflet.Util.geojsonTypeToArcGIS = function (geoJsonType) {\n var arcgisGeometryType;\n switch (geoJsonType) {\n case 'Point':\n arcgisGeometryType = 'esriGeometryPoint';\n break;\n case 'MultiPoint':\n arcgisGeometryType = 'esriGeometryMultipoint';\n break;\n case 'LineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'MultiLineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'Polygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n case 'MultiPolygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n }\n return arcgisGeometryType;\n };\n\n EsriLeaflet.Util.requestAnimationFrame = L.Util.bind(raf, window);\n\n})(EsriLeaflet);","(function(EsriLeaflet){\n\n var callbacks = 0;\n\n window._EsriLeafletCallbacks = {};\n\n function serialize(params){\n var data = '';\n\n params.f = params.f || 'json';\n\n for (var key in params){\n if(params.hasOwnProperty(key)){\n var param = params[key];\n var type = Object.prototype.toString.call(param);\n var value;\n\n if(data.length){\n data += '&';\n }\n\n if (type === '[object Array]'){\n value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');\n } else if (type === '[object Object]') {\n value = JSON.stringify(param);\n } else if (type === '[object Date]'){\n value = param.valueOf();\n } else {\n value = param;\n }\n\n data += encodeURIComponent(key) + '=' + encodeURIComponent(value);\n }\n }\n\n return data;\n }\n\n function createRequest(callback, context){\n var httpRequest = new XMLHttpRequest();\n\n httpRequest.onerror = function(e) {\n httpRequest.onreadystatechange = L.Util.falseFn;\n\n callback.call(context, {\n error: {\n code: 500,\n message: 'XMLHttpRequest error'\n }\n }, null);\n };\n\n httpRequest.onreadystatechange = function(){\n var response;\n var error;\n\n if (httpRequest.readyState === 4) {\n try {\n response = JSON.parse(httpRequest.responseText);\n } catch(e) {\n response = null;\n error = {\n code: 500,\n message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'\n };\n }\n\n if (!error && response.error) {\n error = response.error;\n response = null;\n }\n\n httpRequest.onerror = L.Util.falseFn;\n\n callback.call(context, error, response);\n }\n };\n\n return httpRequest;\n }\n\n // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)\n EsriLeaflet.Request = {\n request: function(url, params, callback, context){\n var paramString = serialize(params);\n var httpRequest = createRequest(callback, context);\n var requestLength = (url + '?' + paramString).length;\n\n // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest\n if(requestLength <= 2000 && L.esri.Support.CORS){\n httpRequest.open('GET', url + '?' + paramString);\n httpRequest.send(null);\n\n // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest\n } else if (requestLength > 2000 && L.esri.Support.CORS){\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(paramString);\n\n // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request\n } else if(requestLength <= 2000 && !L.esri.Support.CORS){\n return L.esri.Request.get.JSONP(url, params, callback, context);\n\n // request is longer then 2000 characters and the browser does not support CORS, log a warning\n } else {\n if(console && console.warn){\n console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');\n return;\n }\n }\n\n return httpRequest;\n },\n post: {\n XMLHTTP: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(serialize(params));\n\n return httpRequest;\n }\n },\n\n get: {\n CORS: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n\n httpRequest.open('GET', url + '?' + serialize(params), true);\n httpRequest.send(null);\n\n return httpRequest;\n },\n JSONP: function(url, params, callback, context){\n var callbackId = 'c' + callbacks;\n\n params.callback = 'window._EsriLeafletCallbacks.' + callbackId;\n\n var script = L.DomUtil.create('script', null, document.body);\n script.type = 'text/javascript';\n script.src = url + '?' + serialize(params);\n script.id = callbackId;\n\n window._EsriLeafletCallbacks[callbackId] = function(response){\n if(window._EsriLeafletCallbacks[callbackId] !== true){\n var error;\n var responseType = Object.prototype.toString.call(response);\n\n if(!(responseType === '[object Object]' || responseType === '[object Array]')){\n error = {\n error: {\n code: 500,\n message: 'Expected array or object as JSONP response'\n }\n };\n response = null;\n }\n\n if (!error && response.error) {\n error = response;\n response = null;\n }\n\n callback.call(context, error, response);\n window._EsriLeafletCallbacks[callbackId] = true;\n }\n };\n\n callbacks++;\n\n return {\n id: callbackId,\n url: script.src,\n abort: function(){\n window._EsriLeafletCallbacks._callback[callbackId]({\n code: 0,\n message: 'Request aborted.'\n });\n }\n };\n }\n }\n };\n\n // choose the correct AJAX handler depending on CORS support\n EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;\n\n // always use XMLHttpRequest for posts\n EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;\n\n // expose a common request method the uses GET\\POST based on request length\n EsriLeaflet.request = EsriLeaflet.Request.request;\n\n})(EsriLeaflet);","EsriLeaflet.Services.Service = L.Class.extend({\n\n includes: L.Mixin.Events,\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n initialize: function (options) {\n options = options || {};\n this._requestQueue = [];\n this._authenticating = false;\n L.Util.setOptions(this, options);\n this.options.url = EsriLeaflet.Util.cleanUrl(this.options.url);\n },\n\n get: function (path, params, callback, context) {\n return this._request('get', path, params, callback, context);\n },\n\n post: function (path, params, callback, context) {\n return this._request('post', path, params, callback, context);\n },\n\n request: function (path, params, callback, context) {\n return this._request('request', path, params, callback, context);\n },\n\n metadata: function (callback, context) {\n return this._request('get', '', {}, callback, context);\n },\n\n authenticate: function(token){\n this._authenticating = false;\n this.options.token = token;\n this._runQueue();\n return this;\n },\n\n _request: function(method, path, params, callback, context){\n this.fire('requeststart', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n\n var wrappedCallback = this._createServiceCallback(method, path, params, callback, context);\n\n if (this.options.token) {\n params.token = this.options.token;\n }\n\n if (this._authenticating) {\n this._requestQueue.push([method, path, params, callback, context]);\n return;\n } else {\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, wrappedCallback);\n } else {\n return EsriLeaflet[method](url, params, wrappedCallback);\n }\n }\n },\n\n _createServiceCallback: function(method, path, params, callback, context){\n var request = [method, path, params, callback, context];\n\n return L.Util.bind(function(error, response){\n\n if (error && (error.code === 499 || error.code === 498)) {\n this._authenticating = true;\n\n this._requestQueue.push(request);\n\n this.fire('authenticationrequired', {\n authenticate: L.Util.bind(this.authenticate, this)\n });\n } else {\n callback.call(context, error, response);\n\n if(error) {\n this.fire('requesterror', {\n url: this.options.url + path,\n params: params,\n message: error.message,\n code: error.code,\n method: method\n });\n } else {\n this.fire('requestsuccess', {\n url: this.options.url + path,\n params: params,\n response: response,\n method: method\n });\n }\n\n this.fire('requestend', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n }\n }, this);\n },\n\n _runQueue: function(){\n for (var i = this._requestQueue.length - 1; i >= 0; i--) {\n var request = this._requestQueue[i];\n var method = request.shift();\n this[method].apply(this, request);\n }\n this._requestQueue = [];\n }\n\n});\n\nEsriLeaflet.Services.service = function(params){\n return new EsriLeaflet.Services.Service(params);\n};","EsriLeaflet.Services.FeatureLayer = EsriLeaflet.Services.Service.extend({\n\n options: {\n idAttribute: 'OBJECTID'\n },\n\n query: function(){\n return new EsriLeaflet.Tasks.Query(this);\n },\n\n addFeature: function(feature, callback, context) {\n delete feature.id;\n\n feature = EsriLeaflet.Util.geojsonToArcGIS(feature);\n\n return this.post('addFeatures', {\n features: [feature]\n }, function(error, response){\n var result = (response && response.addResults) ? response.addResults[0] : undefined;\n if(callback){\n callback.call(this, error || response.addResults[0].error, result);\n }\n }, context);\n },\n\n updateFeature: function(feature, callback, context) {\n feature = EsriLeaflet.Util.geojsonToArcGIS(feature, this.options.idAttribute);\n\n return this.post('updateFeatures', {\n features: [feature]\n }, function(error, response){\n var result = (response && response.updateResults) ? response.updateResults[0] : undefined;\n if(callback){\n callback.call(context, error || response.updateResults[0].error, result);\n }\n }, context);\n },\n\n deleteFeature: function(id, callback, context) {\n return this.post('deleteFeatures', {\n objectIds: id\n }, function(error, response){\n var result = (response && response.deleteResults) ? response.deleteResults[0] : undefined;\n if(callback){\n callback.call(context, error || response.deleteResults[0].error, result);\n }\n }, context);\n }\n\n});\n\nEsriLeaflet.Services.featureLayer = function(options) {\n return new EsriLeaflet.Services.FeatureLayer(options);\n};","EsriLeaflet.Tasks.Task = L.Class.extend({\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n //Generate a method for each methodName:paramName in the setters for this task.\n generateSetter: function(param, context){\n return L.Util.bind(function(value){\n this.params[param] = value;\n return this;\n }, context);\n },\n\n initialize: function(endpoint){\n // endpoint can be either a url (and options) for an ArcGIS Rest Service or an instance of EsriLeaflet.Service\n if(endpoint.request && endpoint.options){\n this._service = endpoint;\n L.Util.setOptions(this, endpoint.options);\n } else {\n L.Util.setOptions(this, endpoint);\n this.options.url = L.esri.Util.cleanUrl(endpoint.url);\n }\n\n // clone default params into this object\n this.params = L.Util.extend({}, this.params || {});\n\n // generate setter methods based on the setters object implimented a child class\n if(this.setters){\n for (var setter in this.setters){\n var param = this.setters[setter];\n this[setter] = this.generateSetter(param, this);\n }\n }\n },\n\n token: function(token){\n if(this._service){\n this._service.authenticate(token);\n } else {\n this.params.token = token;\n }\n return this;\n },\n\n request: function(callback, context){\n if(this._service){\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n },\n\n _request: function(method, path, params, callback, context){\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, callback, context);\n } else{\n return EsriLeaflet[method](url, params, callback, context);\n }\n }\n});","EsriLeaflet.Tasks.Query = EsriLeaflet.Tasks.Task.extend({\n setters: {\n 'offset': 'offset',\n 'limit': 'limit',\n 'fields': 'outFields',\n 'precision': 'geometryPrecision',\n 'featureIds': 'objectIds',\n 'returnGeometry': 'returnGeometry',\n 'token': 'token'\n },\n\n path: 'query',\n\n params: {\n returnGeometry: true,\n where: '1=1',\n outSr: 4326,\n outFields: '*'\n },\n\n within: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelContains'; // will make code read layer within geometry, to the api this will reads geometry contains layer\n return this;\n },\n\n intersects: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelIntersects';\n return this;\n },\n\n contains: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelWithin'; // will make code read layer contains geometry, to the api this will reads geometry within layer\n return this;\n },\n\n // crosses: function(geometry){\n // this._setGeometry(geometry);\n // this.params.spatialRel = 'esriSpatialRelCrosses';\n // return this;\n // },\n\n // touches: function(geometry){\n // this._setGeometry(geometry);\n // this.params.spatialRel = 'esriSpatialRelTouches';\n // return this;\n // },\n\n overlaps: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelOverlaps';\n return this;\n },\n\n // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online\n nearby: function(latlng, radius){\n latlng = L.latLng(latlng);\n this.params.geometry = [latlng.lng, latlng.lat];\n this.params.geometryType = 'esriGeometryPoint';\n this.params.spatialRel = 'esriSpatialRelIntersects';\n this.params.units = 'esriSRUnit_Meter';\n this.params.distance = radius;\n this.params.inSr = 4326;\n return this;\n },\n\n where: function(string){\n this.params.where = string.replace(/\"/g, \"\\'\"); // jshint ignore:line\n return this;\n },\n\n between: function(start, end){\n this.params.time = [start.valueOf(), end.valueOf()];\n return this;\n },\n\n simplify: function(map, factor){\n var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());\n this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;\n return this;\n },\n\n orderBy: function(fieldName, order){\n order = order || 'ASC';\n this.params.orderByFields = (this.params.orderByFields) ? this.params.orderByFields + ',' : '';\n this.params.orderByFields += ([fieldName, order]).join(' ');\n return this;\n },\n\n run: function(callback, context){\n this._cleanParams();\n\n // if the service is hosted on arcgis online request geojson directly\n if(EsriLeaflet.Util.isArcgisOnline(this.options.url)){\n this.params.f = 'geojson';\n\n return this.request(function(error, response){\n callback.call(context, error, response, response);\n }, context);\n\n // otherwise convert it in the callback then pass it on\n } else {\n return this.request(function(error, response){\n callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);\n }, context);\n }\n },\n\n count: function(callback, context){\n this._cleanParams();\n this.params.returnCountOnly = true;\n return this.request(function(error, response){\n callback.call(this, error, (response && response.count), response);\n }, context);\n },\n\n ids: function(callback, context){\n this._cleanParams();\n this.params.returnIdsOnly = true;\n return this.request(function(error, response){\n callback.call(this, error, (response && response.objectIds), response);\n }, context);\n },\n\n // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online\n bounds: function(callback, context){\n this._cleanParams();\n this.params.returnExtentOnly = true;\n return this.request(function(error, response){\n callback.call(context, error, (response && response.extent && EsriLeaflet.Util.extentToBounds(response.extent)), response);\n }, context);\n },\n\n // only valid for image services\n pixelSize: function(point){\n point = L.point(point);\n this.params.pixelSize = [point.x,point.y];\n return this;\n },\n\n // only valid for map services\n layer: function(layer){\n this.path = layer + '/query';\n return this;\n },\n\n _cleanParams: function(){\n delete this.params.returnIdsOnly;\n delete this.params.returnExtentOnly;\n delete this.params.returnCountOnly;\n },\n\n _setGeometry: function(geometry) {\n this.params.inSr = 4326;\n\n // convert bounds to extent and finish\n if ( geometry instanceof L.LatLngBounds ) {\n // set geometry + geometryType\n this.params.geometry = EsriLeaflet.Util.boundsToExtent(geometry);\n this.params.geometryType = 'esriGeometryEnvelope';\n return;\n }\n\n // convert L.Marker > L.LatLng\n if(geometry.getLatLng){\n geometry = geometry.getLatLng();\n }\n\n // convert L.LatLng to a geojson point and continue;\n if (geometry instanceof L.LatLng) {\n geometry = {\n type: 'Point',\n coordinates: [geometry.lng, geometry.lat]\n };\n }\n\n // handle L.GeoJSON, pull out the first geometry\n if ( geometry instanceof L.GeoJSON ) {\n //reassign geometry to the GeoJSON value (we are assuming that only one feature is present)\n geometry = geometry.getLayers()[0].feature.geometry;\n this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);\n this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);\n }\n\n // Handle L.Polyline and L.Polygon\n if (geometry.toGeoJSON) {\n geometry = geometry.toGeoJSON();\n }\n\n // handle GeoJSON feature by pulling out the geometry\n if ( geometry.type === 'Feature' ) {\n // get the geometry of the geojson feature\n geometry = geometry.geometry;\n }\n\n // confirm that our GeoJSON is a point, line or polygon\n if ( geometry.type === 'Point' || geometry.type === 'LineString' || geometry.type === 'Polygon') {\n this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);\n this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);\n return;\n }\n\n // warn the user if we havn't found a\n /* global console */\n if(console && console.warn) {\n console.warn('invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object');\n }\n\n return;\n }\n});\n\nEsriLeaflet.Tasks.query = function(params){\n return new EsriLeaflet.Tasks.Query(params);\n};","EsriLeaflet.Layers.FeatureGrid = L.Class.extend({\n\n includes: L.Mixin.Events,\n\n options: {\n cellSize: 512,\n updateInterval: 150\n },\n\n initialize: function (options) {\n options = L.setOptions(this, options);\n },\n\n onAdd: function (map) {\n this._map = map;\n this._update = L.Util.limitExecByInterval(this._update, this.options.updateInterval, this);\n\n // @TODO remove for leaflet 0.8\n this._map.addEventListener(this.getEvents(), this);\n\n this._reset();\n this._update();\n },\n\n onRemove: function(){\n this._map.removeEventListener(this.getEvents(), this);\n this._removeCells();\n },\n\n getEvents: function () {\n var events = {\n viewreset: this._reset,\n moveend: this._update,\n zoomend : this._onZoom\n };\n\n return events;\n },\n\n addTo: function(map){\n map.addLayer(this);\n return this;\n },\n\n removeFrom: function(map){\n map.removeLayer(this);\n return this;\n },\n\n _onZoom : function () {\n var zoom = this._map.getZoom();\n\n if (zoom > this.options.maxZoom ||\n zoom < this.options.minZoom) {\n this.removeFrom(this._map);\n this._map.addEventListener('zoomend', this.getEvents().zoomend, this);\n } else if (!this._map.hasLayer(this)) {\n this._map.removeEventListener('zoomend', this.getEvents().zoomend, this);\n this.addTo(this._map);\n }\n\n },\n\n _reset: function () {\n this._removeCells();\n\n this._cells = {};\n this._activeCells = {};\n this._cellsToLoad = 0;\n this._cellsTotal = 0;\n\n // @TODO enable at Leaflet 0.8\n // this._cellNumBounds = this._getCellNumBounds();\n\n this._resetWrap();\n },\n\n _resetWrap: function () {\n var map = this._map,\n crs = map.options.crs;\n\n if (crs.infinite) { return; }\n\n var cellSize = this._getCellSize();\n\n if (crs.wrapLng) {\n this._wrapLng = [\n Math.floor(map.project([0, crs.wrapLng[0]]).x / cellSize),\n Math.ceil(map.project([0, crs.wrapLng[1]]).x / cellSize)\n ];\n }\n\n if (crs.wrapLat) {\n this._wrapLat = [\n Math.floor(map.project([crs.wrapLat[0], 0]).y / cellSize),\n Math.ceil(map.project([crs.wrapLat[1], 0]).y / cellSize)\n ];\n }\n },\n\n _getCellSize: function () {\n return this.options.cellSize;\n },\n\n _update: function () {\n if (!this._map) { return; }\n\n var bounds = this._map.getPixelBounds(),\n zoom = this._map.getZoom(),\n cellSize = this._getCellSize(),\n cellPadding = [cellSize/2,cellSize/2];\n // cellPadding = [0,0]\n\n if (zoom > this.options.maxZoom ||\n zoom < this.options.minZoom) { return; }\n\n // cell coordinates range for the current view\n var topLeft = bounds.min.subtract(cellPadding).divideBy(cellSize).floor();\n topLeft.x = Math.max(topLeft.x, 0);\n topLeft.y = Math.max(topLeft.y, 0);\n\n var cellBounds = L.bounds(topLeft, bounds.max.add(cellPadding).divideBy(cellSize).floor());\n\n // remove any present cells that are off the specified bounds\n this._removeOtherCells(cellBounds);\n this._addCells(cellBounds);\n },\n\n _addCells: function (bounds) {\n var queue = [],\n center = bounds.getCenter(),\n zoom = this._map.getZoom();\n\n var j, i, coords;\n // create a queue of coordinates to load cells from\n for (j = bounds.min.y; j <= bounds.max.y; j++) {\n for (i = bounds.min.x; i <= bounds.max.x; i++) {\n coords = new L.Point(i, j);\n coords.z = zoom;\n\n // @TODO enable at Leaflet 0.8\n // if (this._isValidCell(coords)) {\n // queue.push(coords);\n // }\n\n queue.push(coords);\n }\n }\n var cellsToLoad = queue.length;\n\n if (cellsToLoad === 0) { return; }\n\n this._cellsToLoad += cellsToLoad;\n this._cellsTotal += cellsToLoad;\n\n // sort cell queue to load cells in order of their distance to center\n queue.sort(function (a, b) {\n return a.distanceTo(center) - b.distanceTo(center);\n });\n\n for (i = 0; i < cellsToLoad; i++) {\n this._addCell(queue[i]);\n }\n },\n\n // @TODO enable at Leaflet 0.8\n // _isValidCell: function (coords) {\n // var crs = this._map.options.crs;\n\n // if (!crs.infinite) {\n // // don't load cell if it's out of bounds and not wrapped\n // var bounds = this._cellNumBounds;\n // if (\n // (!crs.wrapLng && (coords.x < bounds.min.x || coords.x > bounds.max.x)) ||\n // (!crs.wrapLat && (coords.y < bounds.min.y || coords.y > bounds.max.y))\n // ) {\n // return false;\n // }\n // }\n\n // if (!this.options.bounds) {\n // return true;\n // }\n\n // // don't load cell if it doesn't intersect the bounds in options\n // var cellBounds = this._cellCoordsToBounds(coords);\n // return L.latLngBounds(this.options.bounds).intersects(cellBounds);\n // },\n\n // converts cell coordinates to its geographical bounds\n _cellCoordsToBounds: function (coords) {\n var map = this._map,\n cellSize = this.options.cellSize,\n\n nwPoint = coords.multiplyBy(cellSize),\n sePoint = nwPoint.add([cellSize, cellSize]),\n\n // @TODO for Leaflet 0.8\n // nw = map.wrapLatLng(map.unproject(nwPoint, coords.z)),\n // se = map.wrapLatLng(map.unproject(sePoint, coords.z));\n\n nw = map.unproject(nwPoint, coords.z).wrap(),\n se = map.unproject(sePoint, coords.z).wrap();\n\n return new L.LatLngBounds(nw, se);\n },\n\n // converts cell coordinates to key for the cell cache\n _cellCoordsToKey: function (coords) {\n return coords.x + ':' + coords.y;\n },\n\n // converts cell cache key to coordiantes\n _keyToCellCoords: function (key) {\n var kArr = key.split(':'),\n x = parseInt(kArr[0], 10),\n y = parseInt(kArr[1], 10);\n\n return new L.Point(x, y);\n },\n\n // remove any present cells that are off the specified bounds\n _removeOtherCells: function (bounds) {\n for (var key in this._cells) {\n if (!bounds.contains(this._keyToCellCoords(key))) {\n this._removeCell(key);\n }\n }\n },\n\n _removeCell: function (key) {\n var cell = this._activeCells[key];\n if(cell){\n delete this._activeCells[key];\n\n if (this.cellLeave) {\n this.cellLeave(cell.bounds, cell.coords);\n }\n\n this.fire('cellleave', {\n bounds: cell.bounds,\n coords: cell.coords\n });\n }\n },\n\n _removeCells: function(){\n for (var key in this._cells) {\n var bounds = this._cells[key].bounds;\n var coords = this._cells[key].coords;\n\n if (this.cellLeave) {\n this.cellLeave(bounds, coords);\n }\n\n this.fire('cellleave', {\n bounds: bounds,\n coords: coords\n });\n }\n },\n\n _addCell: function (coords) {\n\n // wrap cell coords if necessary (depending on CRS)\n this._wrapCoords(coords);\n\n // generate the cell key\n var key = this._cellCoordsToKey(coords);\n\n // get the cell from the cache\n var cell = this._cells[key];\n // if this cell should be shown as isnt active yet (enter)\n\n if (cell && !this._activeCells[key]) {\n if (this.cellEnter) {\n this.cellEnter(cell.bounds, coords);\n }\n\n this.fire('cellenter', {\n bounds: cell.bounds,\n coords: coords\n });\n\n this._activeCells[key] = cell;\n }\n\n // if we dont have this cell in the cache yet (create)\n if (!cell) {\n cell = {\n coords: coords,\n bounds: this._cellCoordsToBounds(coords)\n };\n\n this._cells[key] = cell;\n this._activeCells[key] = cell;\n\n if(this.createCell){\n this.createCell(cell.bounds, coords);\n }\n\n this.fire('cellcreate', {\n bounds: cell.bounds,\n coords: coords\n });\n }\n },\n\n _wrapCoords: function (coords) {\n coords.x = this._wrapLng ? L.Util.wrapNum(coords.x, this._wrapLng) : coords.x;\n coords.y = this._wrapLat ? L.Util.wrapNum(coords.y, this._wrapLat) : coords.y;\n }\n\n // get the global cell coordinates range for the current zoom\n // @TODO enable at Leaflet 0.8\n // _getCellNumBounds: function () {\n // // @TODO for Leaflet 0.8\n // // var bounds = this._map.getPixelWorldBounds(),\n // // size = this._getCellSize();\n // //\n // // return bounds ? L.bounds(\n // // bounds.min.divideBy(size).floor(),\n // // bounds.max.divideBy(size).ceil().subtract([1, 1])) : null;\n // }\n\n});","(function(EsriLeaflet){\n\n EsriLeaflet.Layers.FeatureManager = EsriLeaflet.Layers.FeatureGrid.extend({\n\n /**\n * Options\n */\n\n options: {\n where: '1=1',\n fields: ['*'],\n from: false,\n to: false,\n timeField: false,\n timeFilterMode: 'server',\n simplifyFactor: 0,\n precision: 6\n },\n\n /**\n * Constructor\n */\n\n initialize: function (url, options) {\n EsriLeaflet.Layers.FeatureGrid.prototype.initialize.call(this, options);\n\n options = options || {};\n options.url = EsriLeaflet.Util.cleanUrl(url);\n options = L.setOptions(this, options);\n\n this._service = new EsriLeaflet.Services.FeatureLayer(options);\n\n //use case insensitive regex to look for common fieldnames used for indexing\n /*global console */\n if (this.options.fields[0] !== '*'){\n var oidCheck = false;\n for (var i = 0; i < this.options.fields.length; i++){\n if (this.options.fields[i].match(/^(OBJECTID|FID|OID|ID)$/i)){\n oidCheck = true;\n }\n }\n if (oidCheck === false && console && console.warn){\n console.warn('no known esriFieldTypeOID field detected in fields Array. Please add an attribute field containing unique IDs to ensure the layer can be drawn correctly.');\n }\n }\n\n // Leaflet 0.8 change to new propagation\n this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', function (e) {\n e = L.extend({\n target: this\n }, e);\n this.fire(e.type, e);\n }, this);\n\n if(this.options.timeField.start && this.options.timeField.end){\n this._startTimeIndex = new BinarySearchIndex();\n this._endTimeIndex = new BinarySearchIndex();\n } else if(this.options.timeField){\n this._timeIndex = new BinarySearchIndex();\n }\n\n this._cache = {};\n this._currentSnapshot = []; // cache of what layers should be active\n this._activeRequests = 0;\n this._pendingRequests = [];\n },\n\n /**\n * Layer Interface\n */\n\n onAdd: function(map){\n return EsriLeaflet.Layers.FeatureGrid.prototype.onAdd.call(this, map);\n },\n\n onRemove: function(map){\n return EsriLeaflet.Layers.FeatureGrid.prototype.onRemove.call(this, map);\n },\n\n getAttribution: function () {\n return this.options.attribution;\n },\n\n /**\n * Feature Managment\n */\n\n createCell: function(bounds, coords){\n this._requestFeatures(bounds, coords);\n },\n\n _requestFeatures: function(bounds, coords, callback){\n this._activeRequests++;\n\n // our first active request fires loading\n if(this._activeRequests === 1){\n this.fire('loading', {\n bounds: bounds\n });\n }\n\n return this._buildQuery(bounds).run(function(error, featureCollection, response){\n if(response && response.exceededTransferLimit){\n this.fire('drawlimitexceeded');\n }\n\n //deincriment the request counter\n this._activeRequests--;\n\n if(!error && featureCollection.features.length){\n // schedule adding features until the next animation frame\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n this._addFeatures(featureCollection.features, coords);\n }, this));\n }\n\n if(callback){\n callback.call(this, error, featureCollection);\n }\n\n // if there are no more active requests fire a load event for this view\n if(this._activeRequests <= 0){\n this.fire('load', {\n bounds: bounds\n });\n }\n }, this);\n },\n\n _cacheKey: function (coords){\n return coords.z + ':' + coords.x + ':' +coords.y;\n },\n\n _addFeatures: function(features, coords){\n var key = this._cacheKey(coords);\n this._cache[key] = this._cache[key] || [];\n\n for (var i = features.length - 1; i >= 0; i--) {\n var id = features[i].id;\n this._currentSnapshot.push(id);\n this._cache[key].push(id);\n }\n\n if(this.options.timeField){\n this._buildTimeIndexes(features);\n }\n\n var zoom = this._map.getZoom();\n\n if (zoom > this.options.maxZoom ||\n zoom < this.options.minZoom) { return; }\n\n this.createLayers(features);\n },\n\n _buildQuery: function(bounds){\n var query = this._service.query().intersects(bounds).where(this.options.where).fields(this.options.fields).precision(this.options.precision);\n\n if(this.options.simplifyFactor){\n query.simplify(this._map, this.options.simplifyFactor);\n }\n\n if(this.options.timeFilterMode === 'server' && this.options.from && this.options.to){\n query.between(this.options.from, this.options.to);\n }\n\n return query;\n },\n\n /**\n * Where Methods\n */\n\n setWhere: function(where, callback, context){\n\n this.options.where = (where && where.length) ? where : '1=1';\n\n var oldSnapshot = [];\n var newShapshot = [];\n var pendingRequests = 0;\n var requestError = null;\n var requestCallback = L.Util.bind(function(error, featureCollection){\n if(error){\n requestError = error;\n }\n\n if(featureCollection){\n for (var i = featureCollection.features.length - 1; i >= 0; i--) {\n newShapshot.push(featureCollection.features[i].id);\n }\n }\n\n pendingRequests--;\n\n if(pendingRequests <= 0){\n this._currentSnapshot = newShapshot;\n // schedule adding features until the next animation frame\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n this.removeLayers(oldSnapshot);\n this.addLayers(newShapshot);\n if(callback) {\n callback.call(context, requestError);\n }\n }, this));\n\n }\n }, this);\n\n for (var i = this._currentSnapshot.length - 1; i >= 0; i--) {\n oldSnapshot.push(this._currentSnapshot[i]);\n }\n\n for(var key in this._activeCells){\n pendingRequests++;\n var coords = this._keyToCellCoords(key);\n var bounds = this._cellCoordsToBounds(coords);\n this._requestFeatures(bounds, key, requestCallback);\n }\n\n return this;\n },\n\n getWhere: function(){\n return this.options.where;\n },\n\n /**\n * Time Range Methods\n */\n\n getTimeRange: function(){\n return [this.options.from, this.options.to];\n },\n\n setTimeRange: function(from, to, callback, context){\n var oldFrom = this.options.from;\n var oldTo = this.options.to;\n var pendingRequests = 0;\n var requestError = null;\n var requestCallback = L.Util.bind(function(error){\n if(error){\n requestError = error;\n }\n this._filterExistingFeatures(oldFrom, oldTo, from, to);\n\n pendingRequests--;\n\n if(callback && pendingRequests <= 0){\n callback.call(context, requestError);\n }\n }, this);\n\n this.options.from = from;\n this.options.to = to;\n\n this._filterExistingFeatures(oldFrom, oldTo, from, to);\n\n if(this.options.timeFilterMode === 'server') {\n for(var key in this._activeCells){\n pendingRequests++;\n var coords = this._keyToCellCoords(key);\n var bounds = this._cellCoordsToBounds(coords);\n this._requestFeatures(bounds, key, requestCallback);\n }\n }\n },\n\n refresh: function(){\n for(var key in this._activeCells){\n var coords = this._keyToCellCoords(key);\n var bounds = this._cellCoordsToBounds(coords);\n this._requestFeatures(bounds, key);\n }\n },\n\n _filterExistingFeatures: function (oldFrom, oldTo, newFrom, newTo) {\n var layersToRemove = (oldFrom && oldTo) ? this._getFeaturesInTimeRange(oldFrom, oldTo) : this._currentSnapshot;\n var layersToAdd = this._getFeaturesInTimeRange(newFrom, newTo);\n\n if(layersToAdd.indexOf){\n for (var i = 0; i < layersToAdd.length; i++) {\n var shouldRemoveLayer = layersToRemove.indexOf(layersToAdd[i]);\n if(shouldRemoveLayer >= 0){\n layersToRemove.splice(shouldRemoveLayer, 1);\n }\n }\n }\n\n // schedule adding features until the next animation frame\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n this.removeLayers(layersToRemove);\n this.addLayers(layersToAdd);\n }, this));\n },\n\n _getFeaturesInTimeRange: function(start, end){\n var ids = [];\n var search;\n\n if(this.options.timeField.start && this.options.timeField.end){\n var startTimes = this._startTimeIndex.between(start, end);\n var endTimes = this._endTimeIndex.between(start, end);\n search = startTimes.concat(endTimes);\n } else {\n search = this._timeIndex.between(start, end);\n }\n\n for (var i = search.length - 1; i >= 0; i--) {\n ids.push(search[i].id);\n }\n\n return ids;\n },\n\n _buildTimeIndexes: function(geojson){\n var i;\n var feature;\n if(this.options.timeField.start && this.options.timeField.end){\n var startTimeEntries = [];\n var endTimeEntries = [];\n for (i = geojson.length - 1; i >= 0; i--) {\n feature = geojson[i];\n startTimeEntries.push( {\n id: feature.id,\n value: new Date(feature.properties[this.options.timeField.start])\n });\n endTimeEntries.push( {\n id: feature.id,\n value: new Date(feature.properties[this.options.timeField.end])\n });\n }\n this._startTimeIndex.bulkAdd(startTimeEntries);\n this._endTimeIndex.bulkAdd(endTimeEntries);\n } else {\n var timeEntries = [];\n for (i = geojson.length - 1; i >= 0; i--) {\n feature = geojson[i];\n timeEntries.push( {\n id: feature.id,\n value: new Date(feature.properties[this.options.timeField])\n });\n }\n\n this._timeIndex.bulkAdd(timeEntries);\n }\n },\n\n _featureWithinTimeRange: function(feature){\n if(!this.options.from || !this.options.to){\n return true;\n }\n\n var from = +this.options.from.valueOf();\n var to = +this.options.to.valueOf();\n\n if(typeof this.options.timeField === 'string'){\n var date = +feature.properties[this.options.timeField];\n return (date >= from) && (date <= to);\n }\n\n if(this.options.timeField.start && this.options.timeField.end){\n var startDate = +feature.properties[this.options.timeField.start];\n var endDate = +feature.properties[this.options.timeField.end];\n return ((startDate >= from) && (startDate <= to)) || ((endDate >= from) && (endDate <= to));\n }\n },\n\n /**\n * Service Methods\n */\n\n authenticate: function(token){\n this._service.authenticate(token);\n return this;\n },\n\n metadata: function(callback, context){\n this._service.metadata(callback, context);\n return this;\n },\n\n query: function(){\n return this._service.query();\n },\n\n addFeature: function(feature, callback, context){\n this._service.addFeature(feature, function(error, response){\n if(!error){\n this.refresh();\n }\n if(callback){\n callback.call(context, error, response);\n }\n }, this);\n return this;\n },\n\n updateFeature: function(feature, callback, context){\n return this._service.updateFeature(feature, function(error, response){\n if(!error){\n this.refresh();\n }\n if(callback){\n callback.call(context, error, response);\n }\n }, this);\n },\n\n deleteFeature: function(id, callback, context){\n return this._service.deleteFeature(id, function(error, response){\n if(!error && response.objectId){\n this.removeLayers([response.objectId], true);\n }\n if(callback){\n callback.call(context, error, response);\n }\n }, this);\n }\n });\n\n /**\n * Temporal Binary Search Index\n */\n\n function BinarySearchIndex(values) {\n this.values = values || [];\n }\n\n BinarySearchIndex.prototype._query = function(query){\n var minIndex = 0;\n var maxIndex = this.values.length - 1;\n var currentIndex;\n var currentElement;\n var resultIndex;\n\n while (minIndex <= maxIndex) {\n resultIndex = currentIndex = (minIndex + maxIndex) / 2 | 0;\n currentElement = this.values[Math.round(currentIndex)];\n if (+currentElement.value < +query) {\n minIndex = currentIndex + 1;\n } else if (+currentElement.value > +query) {\n maxIndex = currentIndex - 1;\n } else {\n return currentIndex;\n }\n }\n\n return ~maxIndex;\n };\n\n BinarySearchIndex.prototype.sort = function(){\n this.values.sort(function(a, b) {\n return +b.value - +a.value;\n }).reverse();\n this.dirty = false;\n };\n\n BinarySearchIndex.prototype.between = function(start, end){\n if(this.dirty){\n this.sort();\n }\n\n var startIndex = this._query(start);\n var endIndex = this._query(end);\n\n if(startIndex === 0 && endIndex === 0){\n return [];\n }\n\n startIndex = Math.abs(startIndex);\n endIndex = (endIndex < 0) ? Math.abs(endIndex): endIndex + 1;\n\n return this.values.slice(startIndex, endIndex);\n };\n\n BinarySearchIndex.prototype.bulkAdd = function(items){\n this.dirty = true;\n this.values = this.values.concat(items);\n };\n\n})(EsriLeaflet);","EsriLeaflet.Layers.FeatureLayer = EsriLeaflet.Layers.FeatureManager.extend({\n\n statics: {\n EVENTS: 'click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose'\n },\n\n options: {\n cacheLayers: true\n },\n\n /**\n * Constructor\n */\n\n initialize: function (url, options) {\n EsriLeaflet.Layers.FeatureManager.prototype.initialize.call(this, url, options);\n\n options = L.setOptions(this, options);\n\n this._layers = {};\n this._leafletIds = {};\n this._key = 'c'+(Math.random() * 1e9).toString(36).replace('.', '_');\n },\n\n /**\n * Layer Interface\n */\n\n onAdd: function(map){\n map.on('zoomstart zoomend', function(e){\n this._zooming = (e.type === 'zoomstart');\n }, this);\n return EsriLeaflet.Layers.FeatureManager.prototype.onAdd.call(this, map);\n },\n\n onRemove: function(map){\n for (var i in this._layers) {\n map.removeLayer(this._layers[i]);\n }\n\n return EsriLeaflet.Layers.FeatureManager.prototype.onRemove.call(this, map);\n },\n\n createNewLayer: function(geojson){\n // @TODO Leaflet 0.8\n //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);\n return L.GeoJSON.geometryToLayer(geojson, this.options.pointToLayer, L.GeoJSON.coordsToLatLng, this.options);\n },\n\n /**\n * Feature Managment Methods\n */\n\n createLayers: function(features){\n for (var i = features.length - 1; i >= 0; i--) {\n\n var geojson = features[i];\n\n var layer = this._layers[geojson.id];\n var newLayer;\n\n if(layer && !this._map.hasLayer(layer)){\n this._map.addLayer(layer);\n }\n\n if (layer && layer.setLatLngs) {\n // @TODO Leaflet 0.8\n //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);\n\n var updateGeo = this.createNewLayer(geojson);\n layer.setLatLngs(updateGeo.getLatLngs());\n }\n\n if(!layer){\n // @TODO Leaflet 0.8\n //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);\n\n newLayer = this.createNewLayer(geojson);\n newLayer.feature = geojson;\n newLayer.defaultOptions = newLayer.options;\n newLayer._leaflet_id = this._key + '_' + geojson.id;\n\n this._leafletIds[newLayer._leaflet_id] = geojson.id;\n\n // bubble events from layers to this\n // @TODO Leaflet 0.8\n // newLayer.addEventParent(this);\n\n newLayer.on(EsriLeaflet.Layers.FeatureLayer.EVENTS, this._propagateEvent, this);\n\n // bind a popup if we have one\n if(this._popup && newLayer.bindPopup){\n newLayer.bindPopup(this._popup(newLayer.feature, newLayer), this._popupOptions);\n }\n\n if(this.options.onEachFeature){\n this.options.onEachFeature(newLayer.feature, newLayer);\n }\n\n // cache the layer\n this._layers[newLayer.feature.id] = newLayer;\n\n // style the layer\n this.resetStyle(newLayer.feature.id);\n\n this.fire('createfeature', {\n feature: newLayer.feature\n });\n\n // add the layer if it is within the time bounds or our layer is not time enabled\n if(!this.options.timeField || (this.options.timeField && this._featureWithinTimeRange(geojson)) ){\n this._map.addLayer(newLayer);\n }\n }\n }\n },\n\n addLayers: function(ids){\n for (var i = ids.length - 1; i >= 0; i--) {\n var layer = this._layers[ids[i]];\n if(layer){\n this.fire('addfeature', {\n feature: layer.feature\n });\n this._map.addLayer(layer);\n }\n }\n },\n\n removeLayers: function(ids, permanent){\n for (var i = ids.length - 1; i >= 0; i--) {\n var id = ids[i];\n var layer = this._layers[id];\n if(layer){\n this.fire('removefeature', {\n feature: layer.feature,\n permanent: permanent\n });\n this._map.removeLayer(layer);\n }\n if(layer && permanent){\n delete this._layers[id];\n }\n }\n },\n\n cellEnter: function(bounds, coords){\n if(!this._zooming){\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n var cacheKey = this._cacheKey(coords);\n var cellKey = this._cellCoordsToKey(coords);\n var layers = this._cache[cacheKey];\n if(this._activeCells[cellKey] && layers){\n this.addLayers(layers);\n }\n }, this));\n }\n },\n\n cellLeave: function(bounds, coords){\n if(!this._zooming){\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n var cacheKey = this._cacheKey(coords);\n var cellKey = this._cellCoordsToKey(coords);\n var layers = this._cache[cacheKey];\n var mapBounds = this._map.getBounds();\n if(!this._activeCells[cellKey] && layers){\n var removable = true;\n\n for (var i = 0; i < layers.length; i++) {\n var layer = this._layers[layers[i]];\n if(layer && layer.getBounds && mapBounds.intersects(layer.getBounds())){\n removable = false;\n }\n }\n\n if(removable){\n this.removeLayers(layers, !this.options.cacheLayers);\n }\n\n if(!this.options.cacheLayers && removable){\n delete this._cache[cacheKey];\n delete this._cells[cellKey];\n delete this._activeCells[cellKey];\n }\n }\n }, this));\n }\n },\n\n /**\n * Styling Methods\n */\n\n resetStyle: function (id) {\n var layer = this._layers[id];\n\n if(layer){\n layer.options = layer.defaultOptions;\n this.setFeatureStyle(layer.feature.id, this.options.style);\n }\n\n return this;\n },\n\n setStyle: function (style) {\n this.options.style = style;\n this.eachFeature(function (layer) {\n this.setFeatureStyle(layer.feature.id, style);\n }, this);\n return this;\n },\n\n setFeatureStyle: function (id, style) {\n var layer = this._layers[id];\n\n if (typeof style === 'function') {\n style = style(layer.feature);\n }\n\n /*trap inability to access default style options from MultiLine/MultiPolygon\n please revisit at Leaflet 1.0*/\n else if (!style && !layer.defaultOptions) {\n var dummyPath = new L.Path();\n style = L.Path.prototype.options;\n style.fill = true; //not set by default\n }\n\n if (layer.setStyle) {\n layer.setStyle(style);\n }\n },\n\n /**\n * Popup Methods\n */\n\n bindPopup: function (fn, options) {\n this._popup = fn;\n this._popupOptions = options;\n for (var i in this._layers) {\n var layer = this._layers[i];\n var popupContent = this._popup(layer.feature, layer);\n layer.bindPopup(popupContent, options);\n }\n return this;\n },\n\n unbindPopup: function () {\n this._popup = false;\n for (var i in this._layers) {\n var layer = this._layers[i];\n if (layer.unbindPopup) {\n layer.unbindPopup();\n } else if (layer.getLayers) {\n var groupLayers = layer.getLayers();\n for (var j in groupLayers) {\n var gLayer = groupLayers[j];\n gLayer.unbindPopup();\n }\n }\n }\n return this;\n },\n\n /**\n * Utility Methods\n */\n\n eachFeature: function (fn, context) {\n for (var i in this._layers) {\n fn.call(context, this._layers[i]);\n }\n return this;\n },\n\n getFeature: function (id) {\n return this._layers[id];\n },\n\n // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js\n // @TODO remove at Leaflet 0.8\n _propagateEvent: function (e) {\n e.layer = this._layers[this._leafletIds[e.target._leaflet_id]];\n e.target = this;\n this.fire(e.type, e);\n }\n});\n\nEsriLeaflet.FeatureLayer = EsriLeaflet.Layers.FeatureLayer;\n\nEsriLeaflet.Layers.featureLayer = function(url, options){\n return new EsriLeaflet.Layers.FeatureLayer(url, options);\n};\n\nEsriLeaflet.featureLayer = function(url, options){\n return new EsriLeaflet.Layers.FeatureLayer(url, options);\n};"]}
\ No newline at end of file
diff --git a/dist/builds/feature-layer/esri-leaflet-feature-layer.js b/dist/builds/feature-layer/esri-leaflet-feature-layer.js
new file mode 100644
index 000000000..095ed4bf1
--- /dev/null
+++ b/dist/builds/feature-layer/esri-leaflet-feature-layer.js
@@ -0,0 +1,24 @@
+/*! esri-leaflet - v1.0.0-rc.6 - 2015-03-05
+* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
+* Apache License*/
+(function (factory) {
+ //define an AMD module that relies on 'leaflet'
+ if (typeof define === 'function' && define.amd) {
+ define(['leaflet'], function (L) {
+ return factory(L);
+ });
+ //define a common js module that relies on 'leaflet'
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ module.exports = factory(require('leaflet'));
+ }
+
+ if(typeof window !== 'undefined' && window.L){
+ factory(window.L);
+ }
+}(function (L) {
+
+var EsriLeaflet={VERSION:"1.0.0-rc.5",Layers:{},Services:{},Controls:{},Tasks:{},Util:{},Support:{CORS:!!(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),pointerEvents:""===document.documentElement.style.pointerEvents}};"undefined"!=typeof window&&window.L&&(window.L.esri=EsriLeaflet),function(a){function b(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function c(a,b){for(var c=0;cd;d++)b=a[d+1],c+=(b[0]-f[0])*(b[1]+f[1]),f=b;return c>=0}function f(a,b,c,d){var e=(d[0]-c[0])*(a[1]-c[1])-(d[1]-c[1])*(a[0]-c[0]),f=(b[0]-a[0])*(a[1]-c[1])-(b[1]-a[1])*(a[0]-c[0]),g=(d[1]-c[1])*(b[0]-a[0])-(d[0]-c[0])*(b[1]-a[1]);if(0!==g){var h=e/g,i=f/g;if(h>=0&&1>=h&&i>=0&&1>=i)return!0}return!1}function g(a,b){for(var c=0;c=0;b--)if(c=h[b][0],i(c,f)){h[b].push(f),o=!0;break}o||n.push(f)}for(;n.length;){f=n.pop();var p=!1;for(b=h.length-1;b>=0;b--)if(c=h[b][0],g(c,f)){h[b].push(f),p=!0;break}p||h.push([f.reverse()])}return 1===h.length?{type:"Polygon",coordinates:h[0]}:{type:"MultiPolygon",coordinates:h}}function k(a){var b=[],c=a.slice(0),f=d(c.shift().slice(0));if(f.length>=4){e(f)||f.reverse(),b.push(f);for(var g=0;g=4&&(e(h)&&h.reverse(),b.push(h))}}return b}function l(a){for(var b=[],c=0;c=0;e--){var f=d[e].slice(0);b.push(f)}return b}var m=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(a){return window.setTimeout(a,1e3/60)};a.Util.extentToBounds=function(a){var b=new L.LatLng(a.ymin,a.xmin),c=new L.LatLng(a.ymax,a.xmax);return new L.LatLngBounds(b,c)},a.Util.boundsToExtent=function(a){return a=L.latLngBounds(a),{xmin:a.getSouthWest().lng,ymin:a.getSouthWest().lat,xmax:a.getNorthEast().lng,ymax:a.getNorthEast().lat,spatialReference:{wkid:4326}}},a.Util.arcgisToGeojson=function(c,d){var e={};return"number"==typeof c.x&&"number"==typeof c.y&&(e.type="Point",e.coordinates=[c.x,c.y]),c.points&&(e.type="MultiPoint",e.coordinates=c.points.slice(0)),c.paths&&(1===c.paths.length?(e.type="LineString",e.coordinates=c.paths[0].slice(0)):(e.type="MultiLineString",e.coordinates=c.paths.slice(0))),c.rings&&(e=j(c.rings.slice(0))),(c.geometry||c.attributes)&&(e.type="Feature",e.geometry=c.geometry?a.Util.arcgisToGeojson(c.geometry):null,e.properties=c.attributes?b(c.attributes):null,c.attributes&&(e.id=c.attributes[d]||c.attributes.OBJECTID||c.attributes.FID)),e},a.Util.geojsonToArcGIS=function(c,d){d=d||"OBJECTID";var e,f={wkid:4326},g={};switch(c.type){case"Point":g.x=c.coordinates[0],g.y=c.coordinates[1],g.spatialReference=f;break;case"MultiPoint":g.points=c.coordinates.slice(0),g.spatialReference=f;break;case"LineString":g.paths=[c.coordinates.slice(0)],g.spatialReference=f;break;case"MultiLineString":g.paths=c.coordinates.slice(0),g.spatialReference=f;break;case"Polygon":g.rings=k(c.coordinates.slice(0)),g.spatialReference=f;break;case"MultiPolygon":g.rings=l(c.coordinates.slice(0)),g.spatialReference=f;break;case"Feature":c.geometry&&(g.geometry=a.Util.geojsonToArcGIS(c.geometry,d)),g.attributes=c.properties?b(c.properties):{},c.id&&(g.attributes[d]=c.id);break;case"FeatureCollection":for(g=[],e=0;e=0;h--)f.features.push(a.Util.arcgisToGeojson(g[h],d));return f},a.Util.cleanUrl=function(a){return a=a.replace(/\s\s*/g,""),"/"!==a[a.length-1]&&(a+="/"),a},a.Util.isArcgisOnline=function(a){return/\.arcgis\.com/g.test(a)},a.Util.geojsonTypeToArcGIS=function(a){var b;switch(a){case"Point":b="esriGeometryPoint";break;case"MultiPoint":b="esriGeometryMultipoint";break;case"LineString":b="esriGeometryPolyline";break;case"MultiLineString":b="esriGeometryPolyline";break;case"Polygon":b="esriGeometryPolygon";break;case"MultiPolygon":b="esriGeometryPolygon"}return b},a.Util.requestAnimationFrame=L.Util.bind(m,window)}(EsriLeaflet),function(a){function b(a){var b="";a.f=a.f||"json";for(var c in a)if(a.hasOwnProperty(c)){var d,e=a[c],f=Object.prototype.toString.call(e);b.length&&(b+="&"),d="[object Array]"===f?"[object Object]"===Object.prototype.toString.call(e[0])?JSON.stringify(e):e.join(","):"[object Object]"===f?JSON.stringify(e):"[object Date]"===f?e.valueOf():e,b+=encodeURIComponent(c)+"="+encodeURIComponent(d)}return b}function c(a,b){var c=new XMLHttpRequest;return c.onerror=function(){c.onreadystatechange=L.Util.falseFn,a.call(b,{error:{code:500,message:"XMLHttpRequest error"}},null)},c.onreadystatechange=function(){var d,e;if(4===c.readyState){try{d=JSON.parse(c.responseText)}catch(f){d=null,e={code:500,message:"Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error."}}!e&&d.error&&(e=d.error,d=null),c.onerror=L.Util.falseFn,a.call(b,e,d)}},c}var d=0;window._EsriLeafletCallbacks={},a.Request={request:function(a,d,e,f){var g=b(d),h=c(e,f),i=(a+"?"+g).length;if(2e3>=i&&L.esri.Support.CORS)h.open("GET",a+"?"+g),h.send(null);else if(i>2e3&&L.esri.Support.CORS)h.open("POST",a),h.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),h.send(g);else{if(2e3>=i&&!L.esri.Support.CORS)return L.esri.Request.get.JSONP(a,d,e,f);if(console&&console.warn)return void console.warn("a request to "+a+" was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html")}return h},post:{XMLHTTP:function(a,d,e,f){var g=c(e,f);return g.open("POST",a),g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),g.send(b(d)),g}},get:{CORS:function(a,d,e,f){var g=c(e,f);return g.open("GET",a+"?"+b(d),!0),g.send(null),g},JSONP:function(a,c,e,f){var g="c"+d;c.callback="window._EsriLeafletCallbacks."+g;var h=L.DomUtil.create("script",null,document.body);return h.type="text/javascript",h.src=a+"?"+b(c),h.id=g,window._EsriLeafletCallbacks[g]=function(a){if(window._EsriLeafletCallbacks[g]!==!0){var b,c=Object.prototype.toString.call(a);"[object Object]"!==c&&"[object Array]"!==c&&(b={error:{code:500,message:"Expected array or object as JSONP response"}},a=null),!b&&a.error&&(b=a,a=null),e.call(f,b,a),window._EsriLeafletCallbacks[g]=!0}},d++,{id:g,url:h.src,abort:function(){window._EsriLeafletCallbacks._callback[g]({code:0,message:"Request aborted."})}}}}},a.get=a.Support.CORS?a.Request.get.CORS:a.Request.get.JSONP,a.post=a.Request.post.XMLHTTP,a.request=a.Request.request}(EsriLeaflet),EsriLeaflet.Services.Service=L.Class.extend({includes:L.Mixin.Events,options:{proxy:!1,useCors:EsriLeaflet.Support.CORS},initialize:function(a){a=a||{},this._requestQueue=[],this._authenticating=!1,L.Util.setOptions(this,a),this.options.url=EsriLeaflet.Util.cleanUrl(this.options.url)},get:function(a,b,c,d){return this._request("get",a,b,c,d)},post:function(a,b,c,d){return this._request("post",a,b,c,d)},request:function(a,b,c,d){return this._request("request",a,b,c,d)},metadata:function(a,b){return this._request("get","",{},a,b)},authenticate:function(a){return this._authenticating=!1,this.options.token=a,this._runQueue(),this},_request:function(a,b,c,d,e){this.fire("requeststart",{url:this.options.url+b,params:c,method:a});var f=this._createServiceCallback(a,b,c,d,e);if(this.options.token&&(c.token=this.options.token),this._authenticating)return void this._requestQueue.push([a,b,c,d,e]);var g=this.options.proxy?this.options.proxy+"?"+this.options.url+b:this.options.url+b;return"get"!==a&&"request"!==a||this.options.useCors?EsriLeaflet[a](g,c,f):EsriLeaflet.Request.get.JSONP(g,c,f)},_createServiceCallback:function(a,b,c,d,e){var f=[a,b,c,d,e];return L.Util.bind(function(g,h){!g||499!==g.code&&498!==g.code?(d.call(e,g,h),g?this.fire("requesterror",{url:this.options.url+b,params:c,message:g.message,code:g.code,method:a}):this.fire("requestsuccess",{url:this.options.url+b,params:c,response:h,method:a}),this.fire("requestend",{url:this.options.url+b,params:c,method:a})):(this._authenticating=!0,this._requestQueue.push(f),this.fire("authenticationrequired",{authenticate:L.Util.bind(this.authenticate,this)}))},this)},_runQueue:function(){for(var a=this._requestQueue.length-1;a>=0;a--){var b=this._requestQueue[a],c=b.shift();this[c].apply(this,b)}this._requestQueue=[]}}),EsriLeaflet.Services.service=function(a){return new EsriLeaflet.Services.Service(a)},EsriLeaflet.Services.FeatureLayer=EsriLeaflet.Services.Service.extend({options:{idAttribute:"OBJECTID"},query:function(){return new EsriLeaflet.Tasks.Query(this)},addFeature:function(a,b,c){return delete a.id,a=EsriLeaflet.Util.geojsonToArcGIS(a),this.post("addFeatures",{features:[a]},function(a,c){var d=c&&c.addResults?c.addResults[0]:void 0;b&&b.call(this,a||c.addResults[0].error,d)},c)},updateFeature:function(a,b,c){return a=EsriLeaflet.Util.geojsonToArcGIS(a,this.options.idAttribute),this.post("updateFeatures",{features:[a]},function(a,d){var e=d&&d.updateResults?d.updateResults[0]:void 0;b&&b.call(c,a||d.updateResults[0].error,e)},c)},deleteFeature:function(a,b,c){return this.post("deleteFeatures",{objectIds:a},function(a,d){var e=d&&d.deleteResults?d.deleteResults[0]:void 0;b&&b.call(c,a||d.deleteResults[0].error,e)},c)}}),EsriLeaflet.Services.featureLayer=function(a){return new EsriLeaflet.Services.FeatureLayer(a)},EsriLeaflet.Tasks.Task=L.Class.extend({options:{proxy:!1,useCors:EsriLeaflet.Support.CORS},generateSetter:function(a,b){return L.Util.bind(function(b){return this.params[a]=b,this},b)},initialize:function(a){if(a.request&&a.options?(this._service=a,L.Util.setOptions(this,a.options)):(L.Util.setOptions(this,a),this.options.url=L.esri.Util.cleanUrl(a.url)),this.params=L.Util.extend({},this.params||{}),this.setters)for(var b in this.setters){var c=this.setters[b];this[b]=this.generateSetter(c,this)}},token:function(a){return this._service?this._service.authenticate(a):this.params.token=a,this},request:function(a,b){return this._service?this._service.request(this.path,this.params,a,b):this._request("request",this.path,this.params,a,b)},_request:function(a,b,c,d,e){var f=this.options.proxy?this.options.proxy+"?"+this.options.url+b:this.options.url+b;return"get"!==a&&"request"!==a||this.options.useCors?EsriLeaflet[a](f,c,d,e):EsriLeaflet.Request.get.JSONP(f,c,d,e)}}),EsriLeaflet.Tasks.Query=EsriLeaflet.Tasks.Task.extend({setters:{offset:"offset",limit:"limit",fields:"outFields",precision:"geometryPrecision",featureIds:"objectIds",returnGeometry:"returnGeometry",token:"token"},path:"query",params:{returnGeometry:!0,where:"1=1",outSr:4326,outFields:"*"},within:function(a){return this._setGeometry(a),this.params.spatialRel="esriSpatialRelContains",this},intersects:function(a){return this._setGeometry(a),this.params.spatialRel="esriSpatialRelIntersects",this},contains:function(a){return this._setGeometry(a),this.params.spatialRel="esriSpatialRelWithin",this},overlaps:function(a){return this._setGeometry(a),this.params.spatialRel="esriSpatialRelOverlaps",this},nearby:function(a,b){return a=L.latLng(a),this.params.geometry=[a.lng,a.lat],this.params.geometryType="esriGeometryPoint",this.params.spatialRel="esriSpatialRelIntersects",this.params.units="esriSRUnit_Meter",this.params.distance=b,this.params.inSr=4326,this},where:function(a){return this.params.where=a.replace(/"/g,"'"),this},between:function(a,b){return this.params.time=[a.valueOf(),b.valueOf()],this},simplify:function(a,b){var c=Math.abs(a.getBounds().getWest()-a.getBounds().getEast());return this.params.maxAllowableOffset=c/a.getSize().y*b,this},orderBy:function(a,b){return b=b||"ASC",this.params.orderByFields=this.params.orderByFields?this.params.orderByFields+",":"",this.params.orderByFields+=[a,b].join(" "),this},run:function(a,b){return this._cleanParams(),EsriLeaflet.Util.isArcgisOnline(this.options.url)?(this.params.f="geojson",this.request(function(c,d){a.call(b,c,d,d)},b)):this.request(function(c,d){a.call(b,c,d&&EsriLeaflet.Util.responseToFeatureCollection(d),d)},b)},count:function(a,b){return this._cleanParams(),this.params.returnCountOnly=!0,this.request(function(b,c){a.call(this,b,c&&c.count,c)},b)},ids:function(a,b){return this._cleanParams(),this.params.returnIdsOnly=!0,this.request(function(b,c){a.call(this,b,c&&c.objectIds,c)},b)},bounds:function(a,b){return this._cleanParams(),this.params.returnExtentOnly=!0,this.request(function(c,d){a.call(b,c,d&&d.extent&&EsriLeaflet.Util.extentToBounds(d.extent),d)},b)},pixelSize:function(a){return a=L.point(a),this.params.pixelSize=[a.x,a.y],this},layer:function(a){return this.path=a+"/query",this},_cleanParams:function(){delete this.params.returnIdsOnly,delete this.params.returnExtentOnly,delete this.params.returnCountOnly},_setGeometry:function(a){return this.params.inSr=4326,a instanceof L.LatLngBounds?(this.params.geometry=EsriLeaflet.Util.boundsToExtent(a),void(this.params.geometryType="esriGeometryEnvelope")):(a.getLatLng&&(a=a.getLatLng()),a instanceof L.LatLng&&(a={type:"Point",coordinates:[a.lng,a.lat]}),a instanceof L.GeoJSON&&(a=a.getLayers()[0].feature.geometry,this.params.geometry=EsriLeaflet.Util.geojsonToArcGIS(a),this.params.geometryType=EsriLeaflet.Util.geojsonTypeToArcGIS(a.type)),a.toGeoJSON&&(a=a.toGeoJSON()),"Feature"===a.type&&(a=a.geometry),"Point"===a.type||"LineString"===a.type||"Polygon"===a.type?(this.params.geometry=EsriLeaflet.Util.geojsonToArcGIS(a),void(this.params.geometryType=EsriLeaflet.Util.geojsonTypeToArcGIS(a.type))):void(console&&console.warn&&console.warn("invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object")))}}),EsriLeaflet.Tasks.query=function(a){return new EsriLeaflet.Tasks.Query(a)},EsriLeaflet.Layers.FeatureGrid=L.Class.extend({includes:L.Mixin.Events,options:{cellSize:512,updateInterval:150},initialize:function(a){a=L.setOptions(this,a)},onAdd:function(a){this._map=a,this._update=L.Util.limitExecByInterval(this._update,this.options.updateInterval,this),this._map.addEventListener(this.getEvents(),this),this._reset(),this._update()},onRemove:function(){this._map.removeEventListener(this.getEvents(),this),this._removeCells()},getEvents:function(){var a={viewreset:this._reset,moveend:this._update,zoomend:this._onZoom};return a},addTo:function(a){return a.addLayer(this),this},removeFrom:function(a){return a.removeLayer(this),this},_onZoom:function(){var a=this._map.getZoom();a>this.options.maxZoom||athis.options.maxZoom||bc;c++)this._addCell(e[c])},_cellCoordsToBounds:function(a){var b=this._map,c=this.options.cellSize,d=a.multiplyBy(c),e=d.add([c,c]),f=b.unproject(d,a.z).wrap(),g=b.unproject(e,a.z).wrap();return new L.LatLngBounds(f,g)},_cellCoordsToKey:function(a){return a.x+":"+a.y},_keyToCellCoords:function(a){var b=a.split(":"),c=parseInt(b[0],10),d=parseInt(b[1],10);return new L.Point(c,d)},_removeOtherCells:function(a){for(var b in this._cells)a.contains(this._keyToCellCoords(b))||this._removeCell(b)},_removeCell:function(a){var b=this._activeCells[a];b&&(delete this._activeCells[a],this.cellLeave&&this.cellLeave(b.bounds,b.coords),this.fire("cellleave",{bounds:b.bounds,coords:b.coords}))},_removeCells:function(){for(var a in this._cells){var b=this._cells[a].bounds,c=this._cells[a].coords;this.cellLeave&&this.cellLeave(b,c),this.fire("cellleave",{bounds:b,coords:c})}},_addCell:function(a){this._wrapCoords(a);var b=this._cellCoordsToKey(a),c=this._cells[b];c&&!this._activeCells[b]&&(this.cellEnter&&this.cellEnter(c.bounds,a),this.fire("cellenter",{bounds:c.bounds,coords:a}),this._activeCells[b]=c),c||(c={coords:a,bounds:this._cellCoordsToBounds(a)},this._cells[b]=c,this._activeCells[b]=c,this.createCell&&this.createCell(c.bounds,a),this.fire("cellcreate",{bounds:c.bounds,coords:a}))},_wrapCoords:function(a){a.x=this._wrapLng?L.Util.wrapNum(a.x,this._wrapLng):a.x,a.y=this._wrapLat?L.Util.wrapNum(a.y,this._wrapLat):a.y}}),function(a){function b(a){this.values=a||[]}a.Layers.FeatureManager=a.Layers.FeatureGrid.extend({options:{where:"1=1",fields:["*"],from:!1,to:!1,timeField:!1,timeFilterMode:"server",simplifyFactor:0,precision:6},initialize:function(c,d){if(a.Layers.FeatureGrid.prototype.initialize.call(this,d),d=d||{},d.url=a.Util.cleanUrl(c),d=L.setOptions(this,d),this._service=new a.Services.FeatureLayer(d),"*"!==this.options.fields[0]){for(var e=!1,f=0;f=0;d--){var e=a[d].id;this._currentSnapshot.push(e),this._cache[c].push(e)}this.options.timeField&&this._buildTimeIndexes(a);var f=this._map.getZoom();f>this.options.maxZoom||f=0;j--)f.push(i.features[j].id);g--,0>=g&&(this._currentSnapshot=f,a.Util.requestAnimationFrame(L.Util.bind(function(){this.removeLayers(e),this.addLayers(f),c&&c.call(d,h)},this)))},this),j=this._currentSnapshot.length-1;j>=0;j--)e.push(this._currentSnapshot[j]);for(var k in this._activeCells){g++;var l=this._keyToCellCoords(k),m=this._cellCoordsToBounds(l);this._requestFeatures(m,k,i)}return this},getWhere:function(){return this.options.where},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(a,b,c,d){var e=this.options.from,f=this.options.to,g=0,h=null,i=L.Util.bind(function(i){i&&(h=i),this._filterExistingFeatures(e,f,a,b),g--,c&&0>=g&&c.call(d,h)},this);if(this.options.from=a,this.options.to=b,this._filterExistingFeatures(e,f,a,b),"server"===this.options.timeFilterMode)for(var j in this._activeCells){g++;var k=this._keyToCellCoords(j),l=this._cellCoordsToBounds(k);this._requestFeatures(l,j,i)}},refresh:function(){for(var a in this._activeCells){var b=this._keyToCellCoords(a),c=this._cellCoordsToBounds(b);this._requestFeatures(c,a)}},_filterExistingFeatures:function(b,c,d,e){var f=b&&c?this._getFeaturesInTimeRange(b,c):this._currentSnapshot,g=this._getFeaturesInTimeRange(d,e);if(g.indexOf)for(var h=0;h=0&&f.splice(i,1)}a.Util.requestAnimationFrame(L.Util.bind(function(){this.removeLayers(f),this.addLayers(g)},this))},_getFeaturesInTimeRange:function(a,b){var c,d=[];if(this.options.timeField.start&&this.options.timeField.end){var e=this._startTimeIndex.between(a,b),f=this._endTimeIndex.between(a,b);c=e.concat(f)}else c=this._timeIndex.between(a,b);for(var g=c.length-1;g>=0;g--)d.push(c[g].id);return d},_buildTimeIndexes:function(a){var b,c;if(this.options.timeField.start&&this.options.timeField.end){var d=[],e=[];for(b=a.length-1;b>=0;b--)c=a[b],d.push({id:c.id,value:new Date(c.properties[this.options.timeField.start])}),e.push({id:c.id,value:new Date(c.properties[this.options.timeField.end])});this._startTimeIndex.bulkAdd(d),this._endTimeIndex.bulkAdd(e)}else{var f=[];for(b=a.length-1;b>=0;b--)c=a[b],f.push({id:c.id,value:new Date(c.properties[this.options.timeField])});this._timeIndex.bulkAdd(f)}},_featureWithinTimeRange:function(a){if(!this.options.from||!this.options.to)return!0;var b=+this.options.from.valueOf(),c=+this.options.to.valueOf();if("string"==typeof this.options.timeField){var d=+a.properties[this.options.timeField];return d>=b&&c>=d}if(this.options.timeField.start&&this.options.timeField.end){var e=+a.properties[this.options.timeField.start],f=+a.properties[this.options.timeField.end];return e>=b&&c>=e||f>=b&&c>=f}},authenticate:function(a){return this._service.authenticate(a),this},metadata:function(a,b){return this._service.metadata(a,b),this},query:function(){return this._service.query()},addFeature:function(a,b,c){return this._service.addFeature(a,function(a,d){a||this.refresh(),b&&b.call(c,a,d)},this),this},updateFeature:function(a,b,c){return this._service.updateFeature(a,function(a,d){a||this.refresh(),b&&b.call(c,a,d)},this)},deleteFeature:function(a,b,c){return this._service.deleteFeature(a,function(a,d){!a&&d.objectId&&this.removeLayers([d.objectId],!0),b&&b.call(c,a,d)},this)}}),b.prototype._query=function(a){for(var b,c,d,e=0,f=this.values.length-1;f>=e;)if(d=b=(e+f)/2|0,c=this.values[Math.round(b)],+c.value<+a)e=b+1;else{if(!(+c.value>+a))return b;f=b-1}return~f},b.prototype.sort=function(){this.values.sort(function(a,b){return+b.value-+a.value}).reverse(),this.dirty=!1},b.prototype.between=function(a,b){this.dirty&&this.sort();var c=this._query(a),d=this._query(b);return 0===c&&0===d?[]:(c=Math.abs(c),d=0>d?Math.abs(d):d+1,this.values.slice(c,d))},b.prototype.bulkAdd=function(a){this.dirty=!0,this.values=this.values.concat(a)}}(EsriLeaflet),EsriLeaflet.Layers.FeatureLayer=EsriLeaflet.Layers.FeatureManager.extend({statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},options:{cacheLayers:!0},initialize:function(a,b){EsriLeaflet.Layers.FeatureManager.prototype.initialize.call(this,a,b),b=L.setOptions(this,b),this._layers={},this._leafletIds={},this._key="c"+(1e9*Math.random()).toString(36).replace(".","_")},onAdd:function(a){return a.on("zoomstart zoomend",function(a){this._zooming="zoomstart"===a.type},this),EsriLeaflet.Layers.FeatureManager.prototype.onAdd.call(this,a)},onRemove:function(a){for(var b in this._layers)a.removeLayer(this._layers[b]);return EsriLeaflet.Layers.FeatureManager.prototype.onRemove.call(this,a)},createNewLayer:function(a){return L.GeoJSON.geometryToLayer(a,this.options.pointToLayer,L.GeoJSON.coordsToLatLng,this.options)},createLayers:function(a){for(var b=a.length-1;b>=0;b--){var c,d=a[b],e=this._layers[d.id];if(e&&!this._map.hasLayer(e)&&this._map.addLayer(e),e&&e.setLatLngs){var f=this.createNewLayer(d);e.setLatLngs(f.getLatLngs())}e||(c=this.createNewLayer(d),c.feature=d,c.defaultOptions=c.options,c._leaflet_id=this._key+"_"+d.id,this._leafletIds[c._leaflet_id]=d.id,c.on(EsriLeaflet.Layers.FeatureLayer.EVENTS,this._propagateEvent,this),this._popup&&c.bindPopup&&c.bindPopup(this._popup(c.feature,c),this._popupOptions),this.options.onEachFeature&&this.options.onEachFeature(c.feature,c),this._layers[c.feature.id]=c,this.resetStyle(c.feature.id),this.fire("createfeature",{feature:c.feature}),(!this.options.timeField||this.options.timeField&&this._featureWithinTimeRange(d))&&this._map.addLayer(c))}},addLayers:function(a){for(var b=a.length-1;b>=0;b--){var c=this._layers[a[b]];c&&(this.fire("addfeature",{feature:c.feature}),this._map.addLayer(c))}},removeLayers:function(a,b){for(var c=a.length-1;c>=0;c--){var d=a[c],e=this._layers[d];e&&(this.fire("removefeature",{feature:e.feature,permanent:b}),this._map.removeLayer(e)),e&&b&&delete this._layers[d]}},cellEnter:function(a,b){this._zooming||EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){var a=this._cacheKey(b),c=this._cellCoordsToKey(b),d=this._cache[a];this._activeCells[c]&&d&&this.addLayers(d)},this))},cellLeave:function(a,b){this._zooming||EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){var a=this._cacheKey(b),c=this._cellCoordsToKey(b),d=this._cache[a],e=this._map.getBounds();if(!this._activeCells[c]&&d){for(var f=!0,g=0;g= 0);\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L504-L519\n function vertexIntersectsVertex(a1, a2, b1, b2) {\n var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);\n var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);\n var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);\n\n if ( uB !== 0 ) {\n var ua = uaT / uB;\n var ub = ubT / uB;\n\n if ( 0 <= ua && ua <= 1 && 0 <= ub && ub <= 1 ) {\n return true;\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L521-L531\n function arrayIntersectsArray(a, b) {\n for (var i = 0; i < a.length - 1; i++) {\n for (var j = 0; j < b.length - 1; j++) {\n if (vertexIntersectsVertex(a[i], a[i + 1], b[j], b[j + 1])) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L470-L480\n function coordinatesContainPoint(coordinates, point) {\n var contains = false;\n for(var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {\n if (((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||\n (coordinates[j][1] <= point[1] && point[1] < coordinates[i][1])) &&\n (point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0])) {\n contains = !contains;\n }\n }\n return contains;\n }\n\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L106-L113\n function coordinatesContainCoordinates(outer, inner){\n var intersects = arrayIntersectsArray(outer, inner);\n var contains = coordinatesContainPoint(outer, inner[0]);\n if(!intersects && contains){\n return true;\n }\n return false;\n }\n\n // do any polygons in this array contain any other polygons in this array?\n // used for checking for holes in arcgis rings\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L117-L172\n function convertRingsToGeoJSON(rings){\n var outerRings = [];\n var holes = [];\n var x; // iterator\n var outerRing; // current outer ring being evaluated\n var hole; // current hole being evaluated\n\n // for each ring\n for (var r = 0; r < rings.length; r++) {\n var ring = closeRing(rings[r].slice(0));\n if(ring.length < 4){\n continue;\n }\n // is this ring an outer ring? is it clockwise?\n if(ringIsClockwise(ring)){\n var polygon = [ ring ];\n outerRings.push(polygon); // push to outer rings\n } else {\n holes.push(ring); // counterclockwise push to holes\n }\n }\n\n var uncontainedHoles = [];\n\n // while there are holes left...\n while(holes.length){\n // pop a hole off out stack\n hole = holes.pop();\n\n // loop over all outer rings and see if they contain our hole.\n var contained = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(coordinatesContainCoordinates(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n contained = true;\n break;\n }\n }\n\n // ring is not contained in any outer ring\n // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320\n if(!contained){\n uncontainedHoles.push(hole);\n }\n }\n\n // if we couldn't match any holes using contains we can try intersects...\n while(uncontainedHoles.length){\n // pop a hole off out stack\n hole = uncontainedHoles.pop();\n\n // loop over all outer rings and see if any intersect our hole.\n var intersects = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(arrayIntersectsArray(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n intersects = true;\n break;\n }\n }\n\n if(!intersects) {\n outerRings.push([hole.reverse()]);\n }\n }\n\n if(outerRings.length === 1){\n return {\n type: 'Polygon',\n coordinates: outerRings[0]\n };\n } else {\n return {\n type: 'MultiPolygon',\n coordinates: outerRings\n };\n }\n }\n\n // This function ensures that rings are oriented in the right directions\n // outer rings are clockwise, holes are counterclockwise\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function orientRings(poly){\n var output = [];\n var polygon = poly.slice(0);\n var outerRing = closeRing(polygon.shift().slice(0));\n if(outerRing.length >= 4){\n if(!ringIsClockwise(outerRing)){\n outerRing.reverse();\n }\n\n output.push(outerRing);\n\n for (var i = 0; i < polygon.length; i++) {\n var hole = closeRing(polygon[i].slice(0));\n if(hole.length >= 4){\n if(ringIsClockwise(hole)){\n hole.reverse();\n }\n output.push(hole);\n }\n }\n }\n\n return output;\n }\n\n // This function flattens holes in multipolygons to one array of polygons\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function flattenMultiPolygonRings(rings){\n var output = [];\n for (var i = 0; i < rings.length; i++) {\n var polygon = orientRings(rings[i]);\n for (var x = polygon.length - 1; x >= 0; x--) {\n var ring = polygon[x].slice(0);\n output.push(ring);\n }\n }\n return output;\n }\n\n // convert an extent (ArcGIS) to LatLngBounds (Leaflet)\n EsriLeaflet.Util.extentToBounds = function(extent){\n var sw = new L.LatLng(extent.ymin, extent.xmin);\n var ne = new L.LatLng(extent.ymax, extent.xmax);\n return new L.LatLngBounds(sw, ne);\n };\n\n // convert an LatLngBounds (Leaflet) to extent (ArcGIS)\n EsriLeaflet.Util.boundsToExtent = function(bounds) {\n bounds = L.latLngBounds(bounds);\n return {\n 'xmin': bounds.getSouthWest().lng,\n 'ymin': bounds.getSouthWest().lat,\n 'xmax': bounds.getNorthEast().lng,\n 'ymax': bounds.getNorthEast().lat,\n 'spatialReference': {\n 'wkid' : 4326\n }\n };\n };\n\n EsriLeaflet.Util.arcgisToGeojson = function (arcgis, idAttribute){\n var geojson = {};\n\n if(typeof arcgis.x === 'number' && typeof arcgis.y === 'number'){\n geojson.type = 'Point';\n geojson.coordinates = [arcgis.x, arcgis.y];\n }\n\n if(arcgis.points){\n geojson.type = 'MultiPoint';\n geojson.coordinates = arcgis.points.slice(0);\n }\n\n if(arcgis.paths) {\n if(arcgis.paths.length === 1){\n geojson.type = 'LineString';\n geojson.coordinates = arcgis.paths[0].slice(0);\n } else {\n geojson.type = 'MultiLineString';\n geojson.coordinates = arcgis.paths.slice(0);\n }\n }\n\n if(arcgis.rings) {\n geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));\n }\n\n if(arcgis.geometry || arcgis.attributes) {\n geojson.type = 'Feature';\n geojson.geometry = (arcgis.geometry) ? EsriLeaflet.Util.arcgisToGeojson(arcgis.geometry) : null;\n geojson.properties = (arcgis.attributes) ? clone(arcgis.attributes) : null;\n if(arcgis.attributes) {\n geojson.id = arcgis.attributes[idAttribute] || arcgis.attributes.OBJECTID || arcgis.attributes.FID;\n }\n }\n\n return geojson;\n };\n\n // GeoJSON -> ArcGIS\n EsriLeaflet.Util.geojsonToArcGIS = function(geojson, idAttribute){\n idAttribute = idAttribute || 'OBJECTID';\n var spatialReference = { wkid: 4326 };\n var result = {};\n var i;\n\n switch(geojson.type){\n case 'Point':\n result.x = geojson.coordinates[0];\n result.y = geojson.coordinates[1];\n result.spatialReference = spatialReference;\n break;\n case 'MultiPoint':\n result.points = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'LineString':\n result.paths = [geojson.coordinates.slice(0)];\n result.spatialReference = spatialReference;\n break;\n case 'MultiLineString':\n result.paths = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'Polygon':\n result.rings = orientRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'MultiPolygon':\n result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'Feature':\n if(geojson.geometry) {\n result.geometry = EsriLeaflet.Util.geojsonToArcGIS(geojson.geometry, idAttribute);\n }\n result.attributes = (geojson.properties) ? clone(geojson.properties) : {};\n if(geojson.id){\n result.attributes[idAttribute] = geojson.id;\n }\n break;\n case 'FeatureCollection':\n result = [];\n for (i = 0; i < geojson.features.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.features[i], idAttribute));\n }\n break;\n case 'GeometryCollection':\n result = [];\n for (i = 0; i < geojson.geometries.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.geometries[i], idAttribute));\n }\n break;\n }\n\n return result;\n };\n\n EsriLeaflet.Util.responseToFeatureCollection = function(response, idAttribute){\n var objectIdField;\n\n if(idAttribute){\n objectIdField = idAttribute;\n } else if(response.objectIdFieldName){\n objectIdField = response.objectIdFieldName;\n } else if(response.fields) {\n for (var j = 0; j <= response.fields.length - 1; j++) {\n if(response.fields[j].type === 'esriFieldTypeOID') {\n objectIdField = response.fields[j].name;\n break;\n }\n }\n } else {\n objectIdField = 'OBJECTID';\n }\n\n var featureCollection = {\n type: 'FeatureCollection',\n features: []\n };\n var features = response.features || response.results;\n if(features.length){\n for (var i = features.length - 1; i >= 0; i--) {\n featureCollection.features.push(EsriLeaflet.Util.arcgisToGeojson(features[i], objectIdField));\n }\n }\n\n return featureCollection;\n };\n\n // trim whitespace and add a tailing slash is needed to a url\n EsriLeaflet.Util.cleanUrl = function(url){\n url = url.replace(/\\s\\s*/g, '');\n\n //add a trailing slash to the url if the user omitted it\n if(url[url.length-1] !== '/'){\n url += '/';\n }\n\n return url;\n };\n\n EsriLeaflet.Util.isArcgisOnline = function(url){\n return (/\\.arcgis\\.com/g).test(url);\n };\n\n EsriLeaflet.Util.geojsonTypeToArcGIS = function (geoJsonType) {\n var arcgisGeometryType;\n switch (geoJsonType) {\n case 'Point':\n arcgisGeometryType = 'esriGeometryPoint';\n break;\n case 'MultiPoint':\n arcgisGeometryType = 'esriGeometryMultipoint';\n break;\n case 'LineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'MultiLineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'Polygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n case 'MultiPolygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n }\n return arcgisGeometryType;\n };\n\n EsriLeaflet.Util.requestAnimationFrame = L.Util.bind(raf, window);\n\n})(EsriLeaflet);","(function(EsriLeaflet){\n\n var callbacks = 0;\n\n window._EsriLeafletCallbacks = {};\n\n function serialize(params){\n var data = '';\n\n params.f = params.f || 'json';\n\n for (var key in params){\n if(params.hasOwnProperty(key)){\n var param = params[key];\n var type = Object.prototype.toString.call(param);\n var value;\n\n if(data.length){\n data += '&';\n }\n\n if (type === '[object Array]'){\n value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');\n } else if (type === '[object Object]') {\n value = JSON.stringify(param);\n } else if (type === '[object Date]'){\n value = param.valueOf();\n } else {\n value = param;\n }\n\n data += encodeURIComponent(key) + '=' + encodeURIComponent(value);\n }\n }\n\n return data;\n }\n\n function createRequest(callback, context){\n var httpRequest = new XMLHttpRequest();\n\n httpRequest.onerror = function(e) {\n httpRequest.onreadystatechange = L.Util.falseFn;\n\n callback.call(context, {\n error: {\n code: 500,\n message: 'XMLHttpRequest error'\n }\n }, null);\n };\n\n httpRequest.onreadystatechange = function(){\n var response;\n var error;\n\n if (httpRequest.readyState === 4) {\n try {\n response = JSON.parse(httpRequest.responseText);\n } catch(e) {\n response = null;\n error = {\n code: 500,\n message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'\n };\n }\n\n if (!error && response.error) {\n error = response.error;\n response = null;\n }\n\n httpRequest.onerror = L.Util.falseFn;\n\n callback.call(context, error, response);\n }\n };\n\n return httpRequest;\n }\n\n // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)\n EsriLeaflet.Request = {\n request: function(url, params, callback, context){\n var paramString = serialize(params);\n var httpRequest = createRequest(callback, context);\n var requestLength = (url + '?' + paramString).length;\n\n // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest\n if(requestLength <= 2000 && L.esri.Support.CORS){\n httpRequest.open('GET', url + '?' + paramString);\n httpRequest.send(null);\n\n // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest\n } else if (requestLength > 2000 && L.esri.Support.CORS){\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(paramString);\n\n // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request\n } else if(requestLength <= 2000 && !L.esri.Support.CORS){\n return L.esri.Request.get.JSONP(url, params, callback, context);\n\n // request is longer then 2000 characters and the browser does not support CORS, log a warning\n } else {\n if(console && console.warn){\n console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');\n return;\n }\n }\n\n return httpRequest;\n },\n post: {\n XMLHTTP: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(serialize(params));\n\n return httpRequest;\n }\n },\n\n get: {\n CORS: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n\n httpRequest.open('GET', url + '?' + serialize(params), true);\n httpRequest.send(null);\n\n return httpRequest;\n },\n JSONP: function(url, params, callback, context){\n var callbackId = 'c' + callbacks;\n\n params.callback = 'window._EsriLeafletCallbacks.' + callbackId;\n\n var script = L.DomUtil.create('script', null, document.body);\n script.type = 'text/javascript';\n script.src = url + '?' + serialize(params);\n script.id = callbackId;\n\n window._EsriLeafletCallbacks[callbackId] = function(response){\n if(window._EsriLeafletCallbacks[callbackId] !== true){\n var error;\n var responseType = Object.prototype.toString.call(response);\n\n if(!(responseType === '[object Object]' || responseType === '[object Array]')){\n error = {\n error: {\n code: 500,\n message: 'Expected array or object as JSONP response'\n }\n };\n response = null;\n }\n\n if (!error && response.error) {\n error = response;\n response = null;\n }\n\n callback.call(context, error, response);\n window._EsriLeafletCallbacks[callbackId] = true;\n }\n };\n\n callbacks++;\n\n return {\n id: callbackId,\n url: script.src,\n abort: function(){\n window._EsriLeafletCallbacks._callback[callbackId]({\n code: 0,\n message: 'Request aborted.'\n });\n }\n };\n }\n }\n };\n\n // choose the correct AJAX handler depending on CORS support\n EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;\n\n // always use XMLHttpRequest for posts\n EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;\n\n // expose a common request method the uses GET\\POST based on request length\n EsriLeaflet.request = EsriLeaflet.Request.request;\n\n})(EsriLeaflet);","EsriLeaflet.Services.Service = L.Class.extend({\n\n includes: L.Mixin.Events,\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n initialize: function (options) {\n options = options || {};\n this._requestQueue = [];\n this._authenticating = false;\n L.Util.setOptions(this, options);\n this.options.url = EsriLeaflet.Util.cleanUrl(this.options.url);\n },\n\n get: function (path, params, callback, context) {\n return this._request('get', path, params, callback, context);\n },\n\n post: function (path, params, callback, context) {\n return this._request('post', path, params, callback, context);\n },\n\n request: function (path, params, callback, context) {\n return this._request('request', path, params, callback, context);\n },\n\n metadata: function (callback, context) {\n return this._request('get', '', {}, callback, context);\n },\n\n authenticate: function(token){\n this._authenticating = false;\n this.options.token = token;\n this._runQueue();\n return this;\n },\n\n _request: function(method, path, params, callback, context){\n this.fire('requeststart', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n\n var wrappedCallback = this._createServiceCallback(method, path, params, callback, context);\n\n if (this.options.token) {\n params.token = this.options.token;\n }\n\n if (this._authenticating) {\n this._requestQueue.push([method, path, params, callback, context]);\n return;\n } else {\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, wrappedCallback);\n } else {\n return EsriLeaflet[method](url, params, wrappedCallback);\n }\n }\n },\n\n _createServiceCallback: function(method, path, params, callback, context){\n var request = [method, path, params, callback, context];\n\n return L.Util.bind(function(error, response){\n\n if (error && (error.code === 499 || error.code === 498)) {\n this._authenticating = true;\n\n this._requestQueue.push(request);\n\n this.fire('authenticationrequired', {\n authenticate: L.Util.bind(this.authenticate, this)\n });\n } else {\n callback.call(context, error, response);\n\n if(error) {\n this.fire('requesterror', {\n url: this.options.url + path,\n params: params,\n message: error.message,\n code: error.code,\n method: method\n });\n } else {\n this.fire('requestsuccess', {\n url: this.options.url + path,\n params: params,\n response: response,\n method: method\n });\n }\n\n this.fire('requestend', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n }\n }, this);\n },\n\n _runQueue: function(){\n for (var i = this._requestQueue.length - 1; i >= 0; i--) {\n var request = this._requestQueue[i];\n var method = request.shift();\n this[method].apply(this, request);\n }\n this._requestQueue = [];\n }\n\n});\n\nEsriLeaflet.Services.service = function(params){\n return new EsriLeaflet.Services.Service(params);\n};","EsriLeaflet.Services.FeatureLayer = EsriLeaflet.Services.Service.extend({\n\n options: {\n idAttribute: 'OBJECTID'\n },\n\n query: function(){\n return new EsriLeaflet.Tasks.Query(this);\n },\n\n addFeature: function(feature, callback, context) {\n delete feature.id;\n\n feature = EsriLeaflet.Util.geojsonToArcGIS(feature);\n\n return this.post('addFeatures', {\n features: [feature]\n }, function(error, response){\n var result = (response && response.addResults) ? response.addResults[0] : undefined;\n if(callback){\n callback.call(this, error || response.addResults[0].error, result);\n }\n }, context);\n },\n\n updateFeature: function(feature, callback, context) {\n feature = EsriLeaflet.Util.geojsonToArcGIS(feature, this.options.idAttribute);\n\n return this.post('updateFeatures', {\n features: [feature]\n }, function(error, response){\n var result = (response && response.updateResults) ? response.updateResults[0] : undefined;\n if(callback){\n callback.call(context, error || response.updateResults[0].error, result);\n }\n }, context);\n },\n\n deleteFeature: function(id, callback, context) {\n return this.post('deleteFeatures', {\n objectIds: id\n }, function(error, response){\n var result = (response && response.deleteResults) ? response.deleteResults[0] : undefined;\n if(callback){\n callback.call(context, error || response.deleteResults[0].error, result);\n }\n }, context);\n }\n\n});\n\nEsriLeaflet.Services.featureLayer = function(options) {\n return new EsriLeaflet.Services.FeatureLayer(options);\n};","EsriLeaflet.Tasks.Task = L.Class.extend({\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n //Generate a method for each methodName:paramName in the setters for this task.\n generateSetter: function(param, context){\n return L.Util.bind(function(value){\n this.params[param] = value;\n return this;\n }, context);\n },\n\n initialize: function(endpoint){\n // endpoint can be either a url (and options) for an ArcGIS Rest Service or an instance of EsriLeaflet.Service\n if(endpoint.request && endpoint.options){\n this._service = endpoint;\n L.Util.setOptions(this, endpoint.options);\n } else {\n L.Util.setOptions(this, endpoint);\n this.options.url = L.esri.Util.cleanUrl(endpoint.url);\n }\n\n // clone default params into this object\n this.params = L.Util.extend({}, this.params || {});\n\n // generate setter methods based on the setters object implimented a child class\n if(this.setters){\n for (var setter in this.setters){\n var param = this.setters[setter];\n this[setter] = this.generateSetter(param, this);\n }\n }\n },\n\n token: function(token){\n if(this._service){\n this._service.authenticate(token);\n } else {\n this.params.token = token;\n }\n return this;\n },\n\n request: function(callback, context){\n if(this._service){\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n },\n\n _request: function(method, path, params, callback, context){\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, callback, context);\n } else{\n return EsriLeaflet[method](url, params, callback, context);\n }\n }\n});","EsriLeaflet.Tasks.Query = EsriLeaflet.Tasks.Task.extend({\n setters: {\n 'offset': 'offset',\n 'limit': 'limit',\n 'fields': 'outFields',\n 'precision': 'geometryPrecision',\n 'featureIds': 'objectIds',\n 'returnGeometry': 'returnGeometry',\n 'token': 'token'\n },\n\n path: 'query',\n\n params: {\n returnGeometry: true,\n where: '1=1',\n outSr: 4326,\n outFields: '*'\n },\n\n within: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelContains'; // will make code read layer within geometry, to the api this will reads geometry contains layer\n return this;\n },\n\n intersects: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelIntersects';\n return this;\n },\n\n contains: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelWithin'; // will make code read layer contains geometry, to the api this will reads geometry within layer\n return this;\n },\n\n // crosses: function(geometry){\n // this._setGeometry(geometry);\n // this.params.spatialRel = 'esriSpatialRelCrosses';\n // return this;\n // },\n\n // touches: function(geometry){\n // this._setGeometry(geometry);\n // this.params.spatialRel = 'esriSpatialRelTouches';\n // return this;\n // },\n\n overlaps: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelOverlaps';\n return this;\n },\n\n // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online\n nearby: function(latlng, radius){\n latlng = L.latLng(latlng);\n this.params.geometry = [latlng.lng, latlng.lat];\n this.params.geometryType = 'esriGeometryPoint';\n this.params.spatialRel = 'esriSpatialRelIntersects';\n this.params.units = 'esriSRUnit_Meter';\n this.params.distance = radius;\n this.params.inSr = 4326;\n return this;\n },\n\n where: function(string){\n this.params.where = string.replace(/\"/g, \"\\'\"); // jshint ignore:line\n return this;\n },\n\n between: function(start, end){\n this.params.time = [start.valueOf(), end.valueOf()];\n return this;\n },\n\n simplify: function(map, factor){\n var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());\n this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;\n return this;\n },\n\n orderBy: function(fieldName, order){\n order = order || 'ASC';\n this.params.orderByFields = (this.params.orderByFields) ? this.params.orderByFields + ',' : '';\n this.params.orderByFields += ([fieldName, order]).join(' ');\n return this;\n },\n\n run: function(callback, context){\n this._cleanParams();\n\n // if the service is hosted on arcgis online request geojson directly\n if(EsriLeaflet.Util.isArcgisOnline(this.options.url)){\n this.params.f = 'geojson';\n\n return this.request(function(error, response){\n callback.call(context, error, response, response);\n }, context);\n\n // otherwise convert it in the callback then pass it on\n } else {\n return this.request(function(error, response){\n callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);\n }, context);\n }\n },\n\n count: function(callback, context){\n this._cleanParams();\n this.params.returnCountOnly = true;\n return this.request(function(error, response){\n callback.call(this, error, (response && response.count), response);\n }, context);\n },\n\n ids: function(callback, context){\n this._cleanParams();\n this.params.returnIdsOnly = true;\n return this.request(function(error, response){\n callback.call(this, error, (response && response.objectIds), response);\n }, context);\n },\n\n // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online\n bounds: function(callback, context){\n this._cleanParams();\n this.params.returnExtentOnly = true;\n return this.request(function(error, response){\n callback.call(context, error, (response && response.extent && EsriLeaflet.Util.extentToBounds(response.extent)), response);\n }, context);\n },\n\n // only valid for image services\n pixelSize: function(point){\n point = L.point(point);\n this.params.pixelSize = [point.x,point.y];\n return this;\n },\n\n // only valid for map services\n layer: function(layer){\n this.path = layer + '/query';\n return this;\n },\n\n _cleanParams: function(){\n delete this.params.returnIdsOnly;\n delete this.params.returnExtentOnly;\n delete this.params.returnCountOnly;\n },\n\n _setGeometry: function(geometry) {\n this.params.inSr = 4326;\n\n // convert bounds to extent and finish\n if ( geometry instanceof L.LatLngBounds ) {\n // set geometry + geometryType\n this.params.geometry = EsriLeaflet.Util.boundsToExtent(geometry);\n this.params.geometryType = 'esriGeometryEnvelope';\n return;\n }\n\n // convert L.Marker > L.LatLng\n if(geometry.getLatLng){\n geometry = geometry.getLatLng();\n }\n\n // convert L.LatLng to a geojson point and continue;\n if (geometry instanceof L.LatLng) {\n geometry = {\n type: 'Point',\n coordinates: [geometry.lng, geometry.lat]\n };\n }\n\n // handle L.GeoJSON, pull out the first geometry\n if ( geometry instanceof L.GeoJSON ) {\n //reassign geometry to the GeoJSON value (we are assuming that only one feature is present)\n geometry = geometry.getLayers()[0].feature.geometry;\n this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);\n this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);\n }\n\n // Handle L.Polyline and L.Polygon\n if (geometry.toGeoJSON) {\n geometry = geometry.toGeoJSON();\n }\n\n // handle GeoJSON feature by pulling out the geometry\n if ( geometry.type === 'Feature' ) {\n // get the geometry of the geojson feature\n geometry = geometry.geometry;\n }\n\n // confirm that our GeoJSON is a point, line or polygon\n if ( geometry.type === 'Point' || geometry.type === 'LineString' || geometry.type === 'Polygon') {\n this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);\n this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);\n return;\n }\n\n // warn the user if we havn't found a\n /* global console */\n if(console && console.warn) {\n console.warn('invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object');\n }\n\n return;\n }\n});\n\nEsriLeaflet.Tasks.query = function(params){\n return new EsriLeaflet.Tasks.Query(params);\n};","EsriLeaflet.Layers.FeatureGrid = L.Class.extend({\n\n includes: L.Mixin.Events,\n\n options: {\n cellSize: 512,\n updateInterval: 150\n },\n\n initialize: function (options) {\n options = L.setOptions(this, options);\n },\n\n onAdd: function (map) {\n this._map = map;\n this._update = L.Util.limitExecByInterval(this._update, this.options.updateInterval, this);\n\n // @TODO remove for leaflet 0.8\n this._map.addEventListener(this.getEvents(), this);\n\n this._reset();\n this._update();\n },\n\n onRemove: function(){\n this._map.removeEventListener(this.getEvents(), this);\n this._removeCells();\n },\n\n getEvents: function () {\n var events = {\n viewreset: this._reset,\n moveend: this._update,\n zoomend : this._onZoom\n };\n\n return events;\n },\n\n addTo: function(map){\n map.addLayer(this);\n return this;\n },\n\n removeFrom: function(map){\n map.removeLayer(this);\n return this;\n },\n\n _onZoom : function () {\n var zoom = this._map.getZoom();\n\n if (zoom > this.options.maxZoom ||\n zoom < this.options.minZoom) {\n this.removeFrom(this._map);\n this._map.addEventListener('zoomend', this.getEvents().zoomend, this);\n } else if (!this._map.hasLayer(this)) {\n this._map.removeEventListener('zoomend', this.getEvents().zoomend, this);\n this.addTo(this._map);\n }\n\n },\n\n _reset: function () {\n this._removeCells();\n\n this._cells = {};\n this._activeCells = {};\n this._cellsToLoad = 0;\n this._cellsTotal = 0;\n\n // @TODO enable at Leaflet 0.8\n // this._cellNumBounds = this._getCellNumBounds();\n\n this._resetWrap();\n },\n\n _resetWrap: function () {\n var map = this._map,\n crs = map.options.crs;\n\n if (crs.infinite) { return; }\n\n var cellSize = this._getCellSize();\n\n if (crs.wrapLng) {\n this._wrapLng = [\n Math.floor(map.project([0, crs.wrapLng[0]]).x / cellSize),\n Math.ceil(map.project([0, crs.wrapLng[1]]).x / cellSize)\n ];\n }\n\n if (crs.wrapLat) {\n this._wrapLat = [\n Math.floor(map.project([crs.wrapLat[0], 0]).y / cellSize),\n Math.ceil(map.project([crs.wrapLat[1], 0]).y / cellSize)\n ];\n }\n },\n\n _getCellSize: function () {\n return this.options.cellSize;\n },\n\n _update: function () {\n if (!this._map) { return; }\n\n var bounds = this._map.getPixelBounds(),\n zoom = this._map.getZoom(),\n cellSize = this._getCellSize(),\n cellPadding = [cellSize/2,cellSize/2];\n // cellPadding = [0,0]\n\n if (zoom > this.options.maxZoom ||\n zoom < this.options.minZoom) { return; }\n\n // cell coordinates range for the current view\n var topLeft = bounds.min.subtract(cellPadding).divideBy(cellSize).floor();\n topLeft.x = Math.max(topLeft.x, 0);\n topLeft.y = Math.max(topLeft.y, 0);\n\n var cellBounds = L.bounds(topLeft, bounds.max.add(cellPadding).divideBy(cellSize).floor());\n\n // remove any present cells that are off the specified bounds\n this._removeOtherCells(cellBounds);\n this._addCells(cellBounds);\n },\n\n _addCells: function (bounds) {\n var queue = [],\n center = bounds.getCenter(),\n zoom = this._map.getZoom();\n\n var j, i, coords;\n // create a queue of coordinates to load cells from\n for (j = bounds.min.y; j <= bounds.max.y; j++) {\n for (i = bounds.min.x; i <= bounds.max.x; i++) {\n coords = new L.Point(i, j);\n coords.z = zoom;\n\n // @TODO enable at Leaflet 0.8\n // if (this._isValidCell(coords)) {\n // queue.push(coords);\n // }\n\n queue.push(coords);\n }\n }\n var cellsToLoad = queue.length;\n\n if (cellsToLoad === 0) { return; }\n\n this._cellsToLoad += cellsToLoad;\n this._cellsTotal += cellsToLoad;\n\n // sort cell queue to load cells in order of their distance to center\n queue.sort(function (a, b) {\n return a.distanceTo(center) - b.distanceTo(center);\n });\n\n for (i = 0; i < cellsToLoad; i++) {\n this._addCell(queue[i]);\n }\n },\n\n // @TODO enable at Leaflet 0.8\n // _isValidCell: function (coords) {\n // var crs = this._map.options.crs;\n\n // if (!crs.infinite) {\n // // don't load cell if it's out of bounds and not wrapped\n // var bounds = this._cellNumBounds;\n // if (\n // (!crs.wrapLng && (coords.x < bounds.min.x || coords.x > bounds.max.x)) ||\n // (!crs.wrapLat && (coords.y < bounds.min.y || coords.y > bounds.max.y))\n // ) {\n // return false;\n // }\n // }\n\n // if (!this.options.bounds) {\n // return true;\n // }\n\n // // don't load cell if it doesn't intersect the bounds in options\n // var cellBounds = this._cellCoordsToBounds(coords);\n // return L.latLngBounds(this.options.bounds).intersects(cellBounds);\n // },\n\n // converts cell coordinates to its geographical bounds\n _cellCoordsToBounds: function (coords) {\n var map = this._map,\n cellSize = this.options.cellSize,\n\n nwPoint = coords.multiplyBy(cellSize),\n sePoint = nwPoint.add([cellSize, cellSize]),\n\n // @TODO for Leaflet 0.8\n // nw = map.wrapLatLng(map.unproject(nwPoint, coords.z)),\n // se = map.wrapLatLng(map.unproject(sePoint, coords.z));\n\n nw = map.unproject(nwPoint, coords.z).wrap(),\n se = map.unproject(sePoint, coords.z).wrap();\n\n return new L.LatLngBounds(nw, se);\n },\n\n // converts cell coordinates to key for the cell cache\n _cellCoordsToKey: function (coords) {\n return coords.x + ':' + coords.y;\n },\n\n // converts cell cache key to coordiantes\n _keyToCellCoords: function (key) {\n var kArr = key.split(':'),\n x = parseInt(kArr[0], 10),\n y = parseInt(kArr[1], 10);\n\n return new L.Point(x, y);\n },\n\n // remove any present cells that are off the specified bounds\n _removeOtherCells: function (bounds) {\n for (var key in this._cells) {\n if (!bounds.contains(this._keyToCellCoords(key))) {\n this._removeCell(key);\n }\n }\n },\n\n _removeCell: function (key) {\n var cell = this._activeCells[key];\n if(cell){\n delete this._activeCells[key];\n\n if (this.cellLeave) {\n this.cellLeave(cell.bounds, cell.coords);\n }\n\n this.fire('cellleave', {\n bounds: cell.bounds,\n coords: cell.coords\n });\n }\n },\n\n _removeCells: function(){\n for (var key in this._cells) {\n var bounds = this._cells[key].bounds;\n var coords = this._cells[key].coords;\n\n if (this.cellLeave) {\n this.cellLeave(bounds, coords);\n }\n\n this.fire('cellleave', {\n bounds: bounds,\n coords: coords\n });\n }\n },\n\n _addCell: function (coords) {\n\n // wrap cell coords if necessary (depending on CRS)\n this._wrapCoords(coords);\n\n // generate the cell key\n var key = this._cellCoordsToKey(coords);\n\n // get the cell from the cache\n var cell = this._cells[key];\n // if this cell should be shown as isnt active yet (enter)\n\n if (cell && !this._activeCells[key]) {\n if (this.cellEnter) {\n this.cellEnter(cell.bounds, coords);\n }\n\n this.fire('cellenter', {\n bounds: cell.bounds,\n coords: coords\n });\n\n this._activeCells[key] = cell;\n }\n\n // if we dont have this cell in the cache yet (create)\n if (!cell) {\n cell = {\n coords: coords,\n bounds: this._cellCoordsToBounds(coords)\n };\n\n this._cells[key] = cell;\n this._activeCells[key] = cell;\n\n if(this.createCell){\n this.createCell(cell.bounds, coords);\n }\n\n this.fire('cellcreate', {\n bounds: cell.bounds,\n coords: coords\n });\n }\n },\n\n _wrapCoords: function (coords) {\n coords.x = this._wrapLng ? L.Util.wrapNum(coords.x, this._wrapLng) : coords.x;\n coords.y = this._wrapLat ? L.Util.wrapNum(coords.y, this._wrapLat) : coords.y;\n }\n\n // get the global cell coordinates range for the current zoom\n // @TODO enable at Leaflet 0.8\n // _getCellNumBounds: function () {\n // // @TODO for Leaflet 0.8\n // // var bounds = this._map.getPixelWorldBounds(),\n // // size = this._getCellSize();\n // //\n // // return bounds ? L.bounds(\n // // bounds.min.divideBy(size).floor(),\n // // bounds.max.divideBy(size).ceil().subtract([1, 1])) : null;\n // }\n\n});","(function(EsriLeaflet){\n\n EsriLeaflet.Layers.FeatureManager = EsriLeaflet.Layers.FeatureGrid.extend({\n\n /**\n * Options\n */\n\n options: {\n where: '1=1',\n fields: ['*'],\n from: false,\n to: false,\n timeField: false,\n timeFilterMode: 'server',\n simplifyFactor: 0,\n precision: 6\n },\n\n /**\n * Constructor\n */\n\n initialize: function (url, options) {\n EsriLeaflet.Layers.FeatureGrid.prototype.initialize.call(this, options);\n\n options = options || {};\n options.url = EsriLeaflet.Util.cleanUrl(url);\n options = L.setOptions(this, options);\n\n this._service = new EsriLeaflet.Services.FeatureLayer(options);\n\n //use case insensitive regex to look for common fieldnames used for indexing\n /*global console */\n if (this.options.fields[0] !== '*'){\n var oidCheck = false;\n for (var i = 0; i < this.options.fields.length; i++){\n if (this.options.fields[i].match(/^(OBJECTID|FID|OID|ID)$/i)){\n oidCheck = true;\n }\n }\n if (oidCheck === false && console && console.warn){\n console.warn('no known esriFieldTypeOID field detected in fields Array. Please add an attribute field containing unique IDs to ensure the layer can be drawn correctly.');\n }\n }\n\n // Leaflet 0.8 change to new propagation\n this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', function (e) {\n e = L.extend({\n target: this\n }, e);\n this.fire(e.type, e);\n }, this);\n\n if(this.options.timeField.start && this.options.timeField.end){\n this._startTimeIndex = new BinarySearchIndex();\n this._endTimeIndex = new BinarySearchIndex();\n } else if(this.options.timeField){\n this._timeIndex = new BinarySearchIndex();\n }\n\n this._cache = {};\n this._currentSnapshot = []; // cache of what layers should be active\n this._activeRequests = 0;\n this._pendingRequests = [];\n },\n\n /**\n * Layer Interface\n */\n\n onAdd: function(map){\n return EsriLeaflet.Layers.FeatureGrid.prototype.onAdd.call(this, map);\n },\n\n onRemove: function(map){\n return EsriLeaflet.Layers.FeatureGrid.prototype.onRemove.call(this, map);\n },\n\n getAttribution: function () {\n return this.options.attribution;\n },\n\n /**\n * Feature Managment\n */\n\n createCell: function(bounds, coords){\n this._requestFeatures(bounds, coords);\n },\n\n _requestFeatures: function(bounds, coords, callback){\n this._activeRequests++;\n\n // our first active request fires loading\n if(this._activeRequests === 1){\n this.fire('loading', {\n bounds: bounds\n });\n }\n\n return this._buildQuery(bounds).run(function(error, featureCollection, response){\n if(response && response.exceededTransferLimit){\n this.fire('drawlimitexceeded');\n }\n\n //deincriment the request counter\n this._activeRequests--;\n\n if(!error && featureCollection.features.length){\n // schedule adding features until the next animation frame\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n this._addFeatures(featureCollection.features, coords);\n }, this));\n }\n\n if(callback){\n callback.call(this, error, featureCollection);\n }\n\n // if there are no more active requests fire a load event for this view\n if(this._activeRequests <= 0){\n this.fire('load', {\n bounds: bounds\n });\n }\n }, this);\n },\n\n _cacheKey: function (coords){\n return coords.z + ':' + coords.x + ':' +coords.y;\n },\n\n _addFeatures: function(features, coords){\n var key = this._cacheKey(coords);\n this._cache[key] = this._cache[key] || [];\n\n for (var i = features.length - 1; i >= 0; i--) {\n var id = features[i].id;\n this._currentSnapshot.push(id);\n this._cache[key].push(id);\n }\n\n if(this.options.timeField){\n this._buildTimeIndexes(features);\n }\n\n var zoom = this._map.getZoom();\n\n if (zoom > this.options.maxZoom ||\n zoom < this.options.minZoom) { return; }\n\n this.createLayers(features);\n },\n\n _buildQuery: function(bounds){\n var query = this._service.query().intersects(bounds).where(this.options.where).fields(this.options.fields).precision(this.options.precision);\n\n if(this.options.simplifyFactor){\n query.simplify(this._map, this.options.simplifyFactor);\n }\n\n if(this.options.timeFilterMode === 'server' && this.options.from && this.options.to){\n query.between(this.options.from, this.options.to);\n }\n\n return query;\n },\n\n /**\n * Where Methods\n */\n\n setWhere: function(where, callback, context){\n\n this.options.where = (where && where.length) ? where : '1=1';\n\n var oldSnapshot = [];\n var newShapshot = [];\n var pendingRequests = 0;\n var requestError = null;\n var requestCallback = L.Util.bind(function(error, featureCollection){\n if(error){\n requestError = error;\n }\n\n if(featureCollection){\n for (var i = featureCollection.features.length - 1; i >= 0; i--) {\n newShapshot.push(featureCollection.features[i].id);\n }\n }\n\n pendingRequests--;\n\n if(pendingRequests <= 0){\n this._currentSnapshot = newShapshot;\n // schedule adding features until the next animation frame\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n this.removeLayers(oldSnapshot);\n this.addLayers(newShapshot);\n if(callback) {\n callback.call(context, requestError);\n }\n }, this));\n\n }\n }, this);\n\n for (var i = this._currentSnapshot.length - 1; i >= 0; i--) {\n oldSnapshot.push(this._currentSnapshot[i]);\n }\n\n for(var key in this._activeCells){\n pendingRequests++;\n var coords = this._keyToCellCoords(key);\n var bounds = this._cellCoordsToBounds(coords);\n this._requestFeatures(bounds, key, requestCallback);\n }\n\n return this;\n },\n\n getWhere: function(){\n return this.options.where;\n },\n\n /**\n * Time Range Methods\n */\n\n getTimeRange: function(){\n return [this.options.from, this.options.to];\n },\n\n setTimeRange: function(from, to, callback, context){\n var oldFrom = this.options.from;\n var oldTo = this.options.to;\n var pendingRequests = 0;\n var requestError = null;\n var requestCallback = L.Util.bind(function(error){\n if(error){\n requestError = error;\n }\n this._filterExistingFeatures(oldFrom, oldTo, from, to);\n\n pendingRequests--;\n\n if(callback && pendingRequests <= 0){\n callback.call(context, requestError);\n }\n }, this);\n\n this.options.from = from;\n this.options.to = to;\n\n this._filterExistingFeatures(oldFrom, oldTo, from, to);\n\n if(this.options.timeFilterMode === 'server') {\n for(var key in this._activeCells){\n pendingRequests++;\n var coords = this._keyToCellCoords(key);\n var bounds = this._cellCoordsToBounds(coords);\n this._requestFeatures(bounds, key, requestCallback);\n }\n }\n },\n\n refresh: function(){\n for(var key in this._activeCells){\n var coords = this._keyToCellCoords(key);\n var bounds = this._cellCoordsToBounds(coords);\n this._requestFeatures(bounds, key);\n }\n },\n\n _filterExistingFeatures: function (oldFrom, oldTo, newFrom, newTo) {\n var layersToRemove = (oldFrom && oldTo) ? this._getFeaturesInTimeRange(oldFrom, oldTo) : this._currentSnapshot;\n var layersToAdd = this._getFeaturesInTimeRange(newFrom, newTo);\n\n if(layersToAdd.indexOf){\n for (var i = 0; i < layersToAdd.length; i++) {\n var shouldRemoveLayer = layersToRemove.indexOf(layersToAdd[i]);\n if(shouldRemoveLayer >= 0){\n layersToRemove.splice(shouldRemoveLayer, 1);\n }\n }\n }\n\n // schedule adding features until the next animation frame\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n this.removeLayers(layersToRemove);\n this.addLayers(layersToAdd);\n }, this));\n },\n\n _getFeaturesInTimeRange: function(start, end){\n var ids = [];\n var search;\n\n if(this.options.timeField.start && this.options.timeField.end){\n var startTimes = this._startTimeIndex.between(start, end);\n var endTimes = this._endTimeIndex.between(start, end);\n search = startTimes.concat(endTimes);\n } else {\n search = this._timeIndex.between(start, end);\n }\n\n for (var i = search.length - 1; i >= 0; i--) {\n ids.push(search[i].id);\n }\n\n return ids;\n },\n\n _buildTimeIndexes: function(geojson){\n var i;\n var feature;\n if(this.options.timeField.start && this.options.timeField.end){\n var startTimeEntries = [];\n var endTimeEntries = [];\n for (i = geojson.length - 1; i >= 0; i--) {\n feature = geojson[i];\n startTimeEntries.push( {\n id: feature.id,\n value: new Date(feature.properties[this.options.timeField.start])\n });\n endTimeEntries.push( {\n id: feature.id,\n value: new Date(feature.properties[this.options.timeField.end])\n });\n }\n this._startTimeIndex.bulkAdd(startTimeEntries);\n this._endTimeIndex.bulkAdd(endTimeEntries);\n } else {\n var timeEntries = [];\n for (i = geojson.length - 1; i >= 0; i--) {\n feature = geojson[i];\n timeEntries.push( {\n id: feature.id,\n value: new Date(feature.properties[this.options.timeField])\n });\n }\n\n this._timeIndex.bulkAdd(timeEntries);\n }\n },\n\n _featureWithinTimeRange: function(feature){\n if(!this.options.from || !this.options.to){\n return true;\n }\n\n var from = +this.options.from.valueOf();\n var to = +this.options.to.valueOf();\n\n if(typeof this.options.timeField === 'string'){\n var date = +feature.properties[this.options.timeField];\n return (date >= from) && (date <= to);\n }\n\n if(this.options.timeField.start && this.options.timeField.end){\n var startDate = +feature.properties[this.options.timeField.start];\n var endDate = +feature.properties[this.options.timeField.end];\n return ((startDate >= from) && (startDate <= to)) || ((endDate >= from) && (endDate <= to));\n }\n },\n\n /**\n * Service Methods\n */\n\n authenticate: function(token){\n this._service.authenticate(token);\n return this;\n },\n\n metadata: function(callback, context){\n this._service.metadata(callback, context);\n return this;\n },\n\n query: function(){\n return this._service.query();\n },\n\n addFeature: function(feature, callback, context){\n this._service.addFeature(feature, function(error, response){\n if(!error){\n this.refresh();\n }\n if(callback){\n callback.call(context, error, response);\n }\n }, this);\n return this;\n },\n\n updateFeature: function(feature, callback, context){\n return this._service.updateFeature(feature, function(error, response){\n if(!error){\n this.refresh();\n }\n if(callback){\n callback.call(context, error, response);\n }\n }, this);\n },\n\n deleteFeature: function(id, callback, context){\n return this._service.deleteFeature(id, function(error, response){\n if(!error && response.objectId){\n this.removeLayers([response.objectId], true);\n }\n if(callback){\n callback.call(context, error, response);\n }\n }, this);\n }\n });\n\n /**\n * Temporal Binary Search Index\n */\n\n function BinarySearchIndex(values) {\n this.values = values || [];\n }\n\n BinarySearchIndex.prototype._query = function(query){\n var minIndex = 0;\n var maxIndex = this.values.length - 1;\n var currentIndex;\n var currentElement;\n var resultIndex;\n\n while (minIndex <= maxIndex) {\n resultIndex = currentIndex = (minIndex + maxIndex) / 2 | 0;\n currentElement = this.values[Math.round(currentIndex)];\n if (+currentElement.value < +query) {\n minIndex = currentIndex + 1;\n } else if (+currentElement.value > +query) {\n maxIndex = currentIndex - 1;\n } else {\n return currentIndex;\n }\n }\n\n return ~maxIndex;\n };\n\n BinarySearchIndex.prototype.sort = function(){\n this.values.sort(function(a, b) {\n return +b.value - +a.value;\n }).reverse();\n this.dirty = false;\n };\n\n BinarySearchIndex.prototype.between = function(start, end){\n if(this.dirty){\n this.sort();\n }\n\n var startIndex = this._query(start);\n var endIndex = this._query(end);\n\n if(startIndex === 0 && endIndex === 0){\n return [];\n }\n\n startIndex = Math.abs(startIndex);\n endIndex = (endIndex < 0) ? Math.abs(endIndex): endIndex + 1;\n\n return this.values.slice(startIndex, endIndex);\n };\n\n BinarySearchIndex.prototype.bulkAdd = function(items){\n this.dirty = true;\n this.values = this.values.concat(items);\n };\n\n})(EsriLeaflet);","EsriLeaflet.Layers.FeatureLayer = EsriLeaflet.Layers.FeatureManager.extend({\n\n statics: {\n EVENTS: 'click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose'\n },\n\n options: {\n cacheLayers: true\n },\n\n /**\n * Constructor\n */\n\n initialize: function (url, options) {\n EsriLeaflet.Layers.FeatureManager.prototype.initialize.call(this, url, options);\n\n options = L.setOptions(this, options);\n\n this._layers = {};\n this._leafletIds = {};\n this._key = 'c'+(Math.random() * 1e9).toString(36).replace('.', '_');\n },\n\n /**\n * Layer Interface\n */\n\n onAdd: function(map){\n map.on('zoomstart zoomend', function(e){\n this._zooming = (e.type === 'zoomstart');\n }, this);\n return EsriLeaflet.Layers.FeatureManager.prototype.onAdd.call(this, map);\n },\n\n onRemove: function(map){\n for (var i in this._layers) {\n map.removeLayer(this._layers[i]);\n }\n\n return EsriLeaflet.Layers.FeatureManager.prototype.onRemove.call(this, map);\n },\n\n createNewLayer: function(geojson){\n // @TODO Leaflet 0.8\n //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);\n return L.GeoJSON.geometryToLayer(geojson, this.options.pointToLayer, L.GeoJSON.coordsToLatLng, this.options);\n },\n\n /**\n * Feature Managment Methods\n */\n\n createLayers: function(features){\n for (var i = features.length - 1; i >= 0; i--) {\n\n var geojson = features[i];\n\n var layer = this._layers[geojson.id];\n var newLayer;\n\n if(layer && !this._map.hasLayer(layer)){\n this._map.addLayer(layer);\n }\n\n if (layer && layer.setLatLngs) {\n // @TODO Leaflet 0.8\n //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);\n\n var updateGeo = this.createNewLayer(geojson);\n layer.setLatLngs(updateGeo.getLatLngs());\n }\n\n if(!layer){\n // @TODO Leaflet 0.8\n //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);\n\n newLayer = this.createNewLayer(geojson);\n newLayer.feature = geojson;\n newLayer.defaultOptions = newLayer.options;\n newLayer._leaflet_id = this._key + '_' + geojson.id;\n\n this._leafletIds[newLayer._leaflet_id] = geojson.id;\n\n // bubble events from layers to this\n // @TODO Leaflet 0.8\n // newLayer.addEventParent(this);\n\n newLayer.on(EsriLeaflet.Layers.FeatureLayer.EVENTS, this._propagateEvent, this);\n\n // bind a popup if we have one\n if(this._popup && newLayer.bindPopup){\n newLayer.bindPopup(this._popup(newLayer.feature, newLayer), this._popupOptions);\n }\n\n if(this.options.onEachFeature){\n this.options.onEachFeature(newLayer.feature, newLayer);\n }\n\n // cache the layer\n this._layers[newLayer.feature.id] = newLayer;\n\n // style the layer\n this.resetStyle(newLayer.feature.id);\n\n this.fire('createfeature', {\n feature: newLayer.feature\n });\n\n // add the layer if it is within the time bounds or our layer is not time enabled\n if(!this.options.timeField || (this.options.timeField && this._featureWithinTimeRange(geojson)) ){\n this._map.addLayer(newLayer);\n }\n }\n }\n },\n\n addLayers: function(ids){\n for (var i = ids.length - 1; i >= 0; i--) {\n var layer = this._layers[ids[i]];\n if(layer){\n this.fire('addfeature', {\n feature: layer.feature\n });\n this._map.addLayer(layer);\n }\n }\n },\n\n removeLayers: function(ids, permanent){\n for (var i = ids.length - 1; i >= 0; i--) {\n var id = ids[i];\n var layer = this._layers[id];\n if(layer){\n this.fire('removefeature', {\n feature: layer.feature,\n permanent: permanent\n });\n this._map.removeLayer(layer);\n }\n if(layer && permanent){\n delete this._layers[id];\n }\n }\n },\n\n cellEnter: function(bounds, coords){\n if(!this._zooming){\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n var cacheKey = this._cacheKey(coords);\n var cellKey = this._cellCoordsToKey(coords);\n var layers = this._cache[cacheKey];\n if(this._activeCells[cellKey] && layers){\n this.addLayers(layers);\n }\n }, this));\n }\n },\n\n cellLeave: function(bounds, coords){\n if(!this._zooming){\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n var cacheKey = this._cacheKey(coords);\n var cellKey = this._cellCoordsToKey(coords);\n var layers = this._cache[cacheKey];\n var mapBounds = this._map.getBounds();\n if(!this._activeCells[cellKey] && layers){\n var removable = true;\n\n for (var i = 0; i < layers.length; i++) {\n var layer = this._layers[layers[i]];\n if(layer && layer.getBounds && mapBounds.intersects(layer.getBounds())){\n removable = false;\n }\n }\n\n if(removable){\n this.removeLayers(layers, !this.options.cacheLayers);\n }\n\n if(!this.options.cacheLayers && removable){\n delete this._cache[cacheKey];\n delete this._cells[cellKey];\n delete this._activeCells[cellKey];\n }\n }\n }, this));\n }\n },\n\n /**\n * Styling Methods\n */\n\n resetStyle: function (id) {\n var layer = this._layers[id];\n\n if(layer){\n layer.options = layer.defaultOptions;\n this.setFeatureStyle(layer.feature.id, this.options.style);\n }\n\n return this;\n },\n\n setStyle: function (style) {\n this.options.style = style;\n this.eachFeature(function (layer) {\n this.setFeatureStyle(layer.feature.id, style);\n }, this);\n return this;\n },\n\n setFeatureStyle: function (id, style) {\n var layer = this._layers[id];\n\n if (typeof style === 'function') {\n style = style(layer.feature);\n }\n\n /*trap inability to access default style options from MultiLine/MultiPolygon\n please revisit at Leaflet 1.0*/\n else if (!style && !layer.defaultOptions) {\n var dummyPath = new L.Path();\n style = L.Path.prototype.options;\n style.fill = true; //not set by default\n }\n\n if (layer.setStyle) {\n layer.setStyle(style);\n }\n },\n\n /**\n * Popup Methods\n */\n\n bindPopup: function (fn, options) {\n this._popup = fn;\n this._popupOptions = options;\n for (var i in this._layers) {\n var layer = this._layers[i];\n var popupContent = this._popup(layer.feature, layer);\n layer.bindPopup(popupContent, options);\n }\n return this;\n },\n\n unbindPopup: function () {\n this._popup = false;\n for (var i in this._layers) {\n var layer = this._layers[i];\n if (layer.unbindPopup) {\n layer.unbindPopup();\n } else if (layer.getLayers) {\n var groupLayers = layer.getLayers();\n for (var j in groupLayers) {\n var gLayer = groupLayers[j];\n gLayer.unbindPopup();\n }\n }\n }\n return this;\n },\n\n /**\n * Utility Methods\n */\n\n eachFeature: function (fn, context) {\n for (var i in this._layers) {\n fn.call(context, this._layers[i]);\n }\n return this;\n },\n\n getFeature: function (id) {\n return this._layers[id];\n },\n\n // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js\n // @TODO remove at Leaflet 0.8\n _propagateEvent: function (e) {\n e.layer = this._layers[this._leafletIds[e.target._leaflet_id]];\n e.target = this;\n this.fire(e.type, e);\n }\n});\n\nEsriLeaflet.FeatureLayer = EsriLeaflet.Layers.FeatureLayer;\n\nEsriLeaflet.Layers.featureLayer = function(url, options){\n return new EsriLeaflet.Layers.FeatureLayer(url, options);\n};\n\nEsriLeaflet.featureLayer = function(url, options){\n return new EsriLeaflet.Layers.FeatureLayer(url, options);\n};"]}
\ No newline at end of file
diff --git a/dist/builds/image-service/esri-leaflet-image-service-src.js b/dist/builds/image-service/esri-leaflet-image-service-src.js
new file mode 100644
index 000000000..4ec2dc08c
--- /dev/null
+++ b/dist/builds/image-service/esri-leaflet-image-service-src.js
@@ -0,0 +1,1535 @@
+/*! esri-leaflet - v1.0.0-rc.6 - 2015-03-05
+* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
+* Apache License*/
+(function (factory) {
+ //define an AMD module that relies on 'leaflet'
+ if (typeof define === 'function' && define.amd) {
+ define(['leaflet'], function (L) {
+ return factory(L);
+ });
+ //define a common js module that relies on 'leaflet'
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ module.exports = factory(require('leaflet'));
+ }
+
+ if(typeof window !== 'undefined' && window.L){
+ factory(window.L);
+ }
+}(function (L) {
+var EsriLeaflet = { //jshint ignore:line
+ VERSION: '1.0.0-rc.5',
+ Layers: {},
+ Services: {},
+ Controls: {},
+ Tasks: {},
+ Util: {},
+ Support: {
+ CORS: !!(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()),
+ pointerEvents: document.documentElement.style.pointerEvents === ''
+ }
+};
+
+if(typeof window !== 'undefined' && window.L){
+ window.L.esri = EsriLeaflet;
+}
+
+
+(function(EsriLeaflet){
+
+ // normalize request animation frame
+ var raf = window.requestAnimationFrame ||
+ window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.msRequestAnimationFrame ||
+ function(cb) { return window.setTimeout(cb, 1000 / 60); };
+
+ // shallow object clone for feature properties and attributes
+ // from http://jsperf.com/cloning-an-object/2
+ function clone(obj) {
+ var target = {};
+ for (var i in obj) {
+ if (obj.hasOwnProperty(i)) {
+ target[i] = obj[i];
+ }
+ }
+ return target;
+ }
+
+ // checks if 2 x,y points are equal
+ function pointsEqual(a, b) {
+ for (var i = 0; i < a.length; i++) {
+ if (a[i] !== b[i]) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ // checks if the first and last points of a ring are equal and closes the ring
+ function closeRing(coordinates) {
+ if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {
+ coordinates.push(coordinates[0]);
+ }
+ return coordinates;
+ }
+
+ // determine if polygon ring coordinates are clockwise. clockwise signifies outer ring, counter-clockwise an inner ring
+ // or hole. this logic was found at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-
+ // points-are-in-clockwise-order
+ function ringIsClockwise(ringToTest) {
+ var total = 0,i = 0;
+ var rLength = ringToTest.length;
+ var pt1 = ringToTest[i];
+ var pt2;
+ for (i; i < rLength - 1; i++) {
+ pt2 = ringToTest[i + 1];
+ total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);
+ pt1 = pt2;
+ }
+ return (total >= 0);
+ }
+
+ // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L504-L519
+ function vertexIntersectsVertex(a1, a2, b1, b2) {
+ var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);
+ var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);
+ var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);
+
+ if ( uB !== 0 ) {
+ var ua = uaT / uB;
+ var ub = ubT / uB;
+
+ if ( 0 <= ua && ua <= 1 && 0 <= ub && ub <= 1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L521-L531
+ function arrayIntersectsArray(a, b) {
+ for (var i = 0; i < a.length - 1; i++) {
+ for (var j = 0; j < b.length - 1; j++) {
+ if (vertexIntersectsVertex(a[i], a[i + 1], b[j], b[j + 1])) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L470-L480
+ function coordinatesContainPoint(coordinates, point) {
+ var contains = false;
+ for(var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {
+ if (((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||
+ (coordinates[j][1] <= point[1] && point[1] < coordinates[i][1])) &&
+ (point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0])) {
+ contains = !contains;
+ }
+ }
+ return contains;
+ }
+
+ // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L106-L113
+ function coordinatesContainCoordinates(outer, inner){
+ var intersects = arrayIntersectsArray(outer, inner);
+ var contains = coordinatesContainPoint(outer, inner[0]);
+ if(!intersects && contains){
+ return true;
+ }
+ return false;
+ }
+
+ // do any polygons in this array contain any other polygons in this array?
+ // used for checking for holes in arcgis rings
+ // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L117-L172
+ function convertRingsToGeoJSON(rings){
+ var outerRings = [];
+ var holes = [];
+ var x; // iterator
+ var outerRing; // current outer ring being evaluated
+ var hole; // current hole being evaluated
+
+ // for each ring
+ for (var r = 0; r < rings.length; r++) {
+ var ring = closeRing(rings[r].slice(0));
+ if(ring.length < 4){
+ continue;
+ }
+ // is this ring an outer ring? is it clockwise?
+ if(ringIsClockwise(ring)){
+ var polygon = [ ring ];
+ outerRings.push(polygon); // push to outer rings
+ } else {
+ holes.push(ring); // counterclockwise push to holes
+ }
+ }
+
+ var uncontainedHoles = [];
+
+ // while there are holes left...
+ while(holes.length){
+ // pop a hole off out stack
+ hole = holes.pop();
+
+ // loop over all outer rings and see if they contain our hole.
+ var contained = false;
+ for (x = outerRings.length - 1; x >= 0; x--) {
+ outerRing = outerRings[x][0];
+ if(coordinatesContainCoordinates(outerRing, hole)){
+ // the hole is contained push it into our polygon
+ outerRings[x].push(hole);
+ contained = true;
+ break;
+ }
+ }
+
+ // ring is not contained in any outer ring
+ // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320
+ if(!contained){
+ uncontainedHoles.push(hole);
+ }
+ }
+
+ // if we couldn't match any holes using contains we can try intersects...
+ while(uncontainedHoles.length){
+ // pop a hole off out stack
+ hole = uncontainedHoles.pop();
+
+ // loop over all outer rings and see if any intersect our hole.
+ var intersects = false;
+ for (x = outerRings.length - 1; x >= 0; x--) {
+ outerRing = outerRings[x][0];
+ if(arrayIntersectsArray(outerRing, hole)){
+ // the hole is contained push it into our polygon
+ outerRings[x].push(hole);
+ intersects = true;
+ break;
+ }
+ }
+
+ if(!intersects) {
+ outerRings.push([hole.reverse()]);
+ }
+ }
+
+ if(outerRings.length === 1){
+ return {
+ type: 'Polygon',
+ coordinates: outerRings[0]
+ };
+ } else {
+ return {
+ type: 'MultiPolygon',
+ coordinates: outerRings
+ };
+ }
+ }
+
+ // This function ensures that rings are oriented in the right directions
+ // outer rings are clockwise, holes are counterclockwise
+ // used for converting GeoJSON Polygons to ArcGIS Polygons
+ function orientRings(poly){
+ var output = [];
+ var polygon = poly.slice(0);
+ var outerRing = closeRing(polygon.shift().slice(0));
+ if(outerRing.length >= 4){
+ if(!ringIsClockwise(outerRing)){
+ outerRing.reverse();
+ }
+
+ output.push(outerRing);
+
+ for (var i = 0; i < polygon.length; i++) {
+ var hole = closeRing(polygon[i].slice(0));
+ if(hole.length >= 4){
+ if(ringIsClockwise(hole)){
+ hole.reverse();
+ }
+ output.push(hole);
+ }
+ }
+ }
+
+ return output;
+ }
+
+ // This function flattens holes in multipolygons to one array of polygons
+ // used for converting GeoJSON Polygons to ArcGIS Polygons
+ function flattenMultiPolygonRings(rings){
+ var output = [];
+ for (var i = 0; i < rings.length; i++) {
+ var polygon = orientRings(rings[i]);
+ for (var x = polygon.length - 1; x >= 0; x--) {
+ var ring = polygon[x].slice(0);
+ output.push(ring);
+ }
+ }
+ return output;
+ }
+
+ // convert an extent (ArcGIS) to LatLngBounds (Leaflet)
+ EsriLeaflet.Util.extentToBounds = function(extent){
+ var sw = new L.LatLng(extent.ymin, extent.xmin);
+ var ne = new L.LatLng(extent.ymax, extent.xmax);
+ return new L.LatLngBounds(sw, ne);
+ };
+
+ // convert an LatLngBounds (Leaflet) to extent (ArcGIS)
+ EsriLeaflet.Util.boundsToExtent = function(bounds) {
+ bounds = L.latLngBounds(bounds);
+ return {
+ 'xmin': bounds.getSouthWest().lng,
+ 'ymin': bounds.getSouthWest().lat,
+ 'xmax': bounds.getNorthEast().lng,
+ 'ymax': bounds.getNorthEast().lat,
+ 'spatialReference': {
+ 'wkid' : 4326
+ }
+ };
+ };
+
+ EsriLeaflet.Util.arcgisToGeojson = function (arcgis, idAttribute){
+ var geojson = {};
+
+ if(typeof arcgis.x === 'number' && typeof arcgis.y === 'number'){
+ geojson.type = 'Point';
+ geojson.coordinates = [arcgis.x, arcgis.y];
+ }
+
+ if(arcgis.points){
+ geojson.type = 'MultiPoint';
+ geojson.coordinates = arcgis.points.slice(0);
+ }
+
+ if(arcgis.paths) {
+ if(arcgis.paths.length === 1){
+ geojson.type = 'LineString';
+ geojson.coordinates = arcgis.paths[0].slice(0);
+ } else {
+ geojson.type = 'MultiLineString';
+ geojson.coordinates = arcgis.paths.slice(0);
+ }
+ }
+
+ if(arcgis.rings) {
+ geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));
+ }
+
+ if(arcgis.geometry || arcgis.attributes) {
+ geojson.type = 'Feature';
+ geojson.geometry = (arcgis.geometry) ? EsriLeaflet.Util.arcgisToGeojson(arcgis.geometry) : null;
+ geojson.properties = (arcgis.attributes) ? clone(arcgis.attributes) : null;
+ if(arcgis.attributes) {
+ geojson.id = arcgis.attributes[idAttribute] || arcgis.attributes.OBJECTID || arcgis.attributes.FID;
+ }
+ }
+
+ return geojson;
+ };
+
+ // GeoJSON -> ArcGIS
+ EsriLeaflet.Util.geojsonToArcGIS = function(geojson, idAttribute){
+ idAttribute = idAttribute || 'OBJECTID';
+ var spatialReference = { wkid: 4326 };
+ var result = {};
+ var i;
+
+ switch(geojson.type){
+ case 'Point':
+ result.x = geojson.coordinates[0];
+ result.y = geojson.coordinates[1];
+ result.spatialReference = spatialReference;
+ break;
+ case 'MultiPoint':
+ result.points = geojson.coordinates.slice(0);
+ result.spatialReference = spatialReference;
+ break;
+ case 'LineString':
+ result.paths = [geojson.coordinates.slice(0)];
+ result.spatialReference = spatialReference;
+ break;
+ case 'MultiLineString':
+ result.paths = geojson.coordinates.slice(0);
+ result.spatialReference = spatialReference;
+ break;
+ case 'Polygon':
+ result.rings = orientRings(geojson.coordinates.slice(0));
+ result.spatialReference = spatialReference;
+ break;
+ case 'MultiPolygon':
+ result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));
+ result.spatialReference = spatialReference;
+ break;
+ case 'Feature':
+ if(geojson.geometry) {
+ result.geometry = EsriLeaflet.Util.geojsonToArcGIS(geojson.geometry, idAttribute);
+ }
+ result.attributes = (geojson.properties) ? clone(geojson.properties) : {};
+ if(geojson.id){
+ result.attributes[idAttribute] = geojson.id;
+ }
+ break;
+ case 'FeatureCollection':
+ result = [];
+ for (i = 0; i < geojson.features.length; i++){
+ result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.features[i], idAttribute));
+ }
+ break;
+ case 'GeometryCollection':
+ result = [];
+ for (i = 0; i < geojson.geometries.length; i++){
+ result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.geometries[i], idAttribute));
+ }
+ break;
+ }
+
+ return result;
+ };
+
+ EsriLeaflet.Util.responseToFeatureCollection = function(response, idAttribute){
+ var objectIdField;
+
+ if(idAttribute){
+ objectIdField = idAttribute;
+ } else if(response.objectIdFieldName){
+ objectIdField = response.objectIdFieldName;
+ } else if(response.fields) {
+ for (var j = 0; j <= response.fields.length - 1; j++) {
+ if(response.fields[j].type === 'esriFieldTypeOID') {
+ objectIdField = response.fields[j].name;
+ break;
+ }
+ }
+ } else {
+ objectIdField = 'OBJECTID';
+ }
+
+ var featureCollection = {
+ type: 'FeatureCollection',
+ features: []
+ };
+ var features = response.features || response.results;
+ if(features.length){
+ for (var i = features.length - 1; i >= 0; i--) {
+ featureCollection.features.push(EsriLeaflet.Util.arcgisToGeojson(features[i], objectIdField));
+ }
+ }
+
+ return featureCollection;
+ };
+
+ // trim whitespace and add a tailing slash is needed to a url
+ EsriLeaflet.Util.cleanUrl = function(url){
+ url = url.replace(/\s\s*/g, '');
+
+ //add a trailing slash to the url if the user omitted it
+ if(url[url.length-1] !== '/'){
+ url += '/';
+ }
+
+ return url;
+ };
+
+ EsriLeaflet.Util.isArcgisOnline = function(url){
+ return (/\.arcgis\.com/g).test(url);
+ };
+
+ EsriLeaflet.Util.geojsonTypeToArcGIS = function (geoJsonType) {
+ var arcgisGeometryType;
+ switch (geoJsonType) {
+ case 'Point':
+ arcgisGeometryType = 'esriGeometryPoint';
+ break;
+ case 'MultiPoint':
+ arcgisGeometryType = 'esriGeometryMultipoint';
+ break;
+ case 'LineString':
+ arcgisGeometryType = 'esriGeometryPolyline';
+ break;
+ case 'MultiLineString':
+ arcgisGeometryType = 'esriGeometryPolyline';
+ break;
+ case 'Polygon':
+ arcgisGeometryType = 'esriGeometryPolygon';
+ break;
+ case 'MultiPolygon':
+ arcgisGeometryType = 'esriGeometryPolygon';
+ break;
+ }
+ return arcgisGeometryType;
+ };
+
+ EsriLeaflet.Util.requestAnimationFrame = L.Util.bind(raf, window);
+
+})(EsriLeaflet);
+
+(function(EsriLeaflet){
+
+ var callbacks = 0;
+
+ window._EsriLeafletCallbacks = {};
+
+ function serialize(params){
+ var data = '';
+
+ params.f = params.f || 'json';
+
+ for (var key in params){
+ if(params.hasOwnProperty(key)){
+ var param = params[key];
+ var type = Object.prototype.toString.call(param);
+ var value;
+
+ if(data.length){
+ data += '&';
+ }
+
+ if (type === '[object Array]'){
+ value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');
+ } else if (type === '[object Object]') {
+ value = JSON.stringify(param);
+ } else if (type === '[object Date]'){
+ value = param.valueOf();
+ } else {
+ value = param;
+ }
+
+ data += encodeURIComponent(key) + '=' + encodeURIComponent(value);
+ }
+ }
+
+ return data;
+ }
+
+ function createRequest(callback, context){
+ var httpRequest = new XMLHttpRequest();
+
+ httpRequest.onerror = function(e) {
+ httpRequest.onreadystatechange = L.Util.falseFn;
+
+ callback.call(context, {
+ error: {
+ code: 500,
+ message: 'XMLHttpRequest error'
+ }
+ }, null);
+ };
+
+ httpRequest.onreadystatechange = function(){
+ var response;
+ var error;
+
+ if (httpRequest.readyState === 4) {
+ try {
+ response = JSON.parse(httpRequest.responseText);
+ } catch(e) {
+ response = null;
+ error = {
+ code: 500,
+ message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'
+ };
+ }
+
+ if (!error && response.error) {
+ error = response.error;
+ response = null;
+ }
+
+ httpRequest.onerror = L.Util.falseFn;
+
+ callback.call(context, error, response);
+ }
+ };
+
+ return httpRequest;
+ }
+
+ // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)
+ EsriLeaflet.Request = {
+ request: function(url, params, callback, context){
+ var paramString = serialize(params);
+ var httpRequest = createRequest(callback, context);
+ var requestLength = (url + '?' + paramString).length;
+
+ // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest
+ if(requestLength <= 2000 && L.esri.Support.CORS){
+ httpRequest.open('GET', url + '?' + paramString);
+ httpRequest.send(null);
+
+ // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest
+ } else if (requestLength > 2000 && L.esri.Support.CORS){
+ httpRequest.open('POST', url);
+ httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ httpRequest.send(paramString);
+
+ // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request
+ } else if(requestLength <= 2000 && !L.esri.Support.CORS){
+ return L.esri.Request.get.JSONP(url, params, callback, context);
+
+ // request is longer then 2000 characters and the browser does not support CORS, log a warning
+ } else {
+ if(console && console.warn){
+ console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');
+ return;
+ }
+ }
+
+ return httpRequest;
+ },
+ post: {
+ XMLHTTP: function (url, params, callback, context) {
+ var httpRequest = createRequest(callback, context);
+ httpRequest.open('POST', url);
+ httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ httpRequest.send(serialize(params));
+
+ return httpRequest;
+ }
+ },
+
+ get: {
+ CORS: function (url, params, callback, context) {
+ var httpRequest = createRequest(callback, context);
+
+ httpRequest.open('GET', url + '?' + serialize(params), true);
+ httpRequest.send(null);
+
+ return httpRequest;
+ },
+ JSONP: function(url, params, callback, context){
+ var callbackId = 'c' + callbacks;
+
+ params.callback = 'window._EsriLeafletCallbacks.' + callbackId;
+
+ var script = L.DomUtil.create('script', null, document.body);
+ script.type = 'text/javascript';
+ script.src = url + '?' + serialize(params);
+ script.id = callbackId;
+
+ window._EsriLeafletCallbacks[callbackId] = function(response){
+ if(window._EsriLeafletCallbacks[callbackId] !== true){
+ var error;
+ var responseType = Object.prototype.toString.call(response);
+
+ if(!(responseType === '[object Object]' || responseType === '[object Array]')){
+ error = {
+ error: {
+ code: 500,
+ message: 'Expected array or object as JSONP response'
+ }
+ };
+ response = null;
+ }
+
+ if (!error && response.error) {
+ error = response;
+ response = null;
+ }
+
+ callback.call(context, error, response);
+ window._EsriLeafletCallbacks[callbackId] = true;
+ }
+ };
+
+ callbacks++;
+
+ return {
+ id: callbackId,
+ url: script.src,
+ abort: function(){
+ window._EsriLeafletCallbacks._callback[callbackId]({
+ code: 0,
+ message: 'Request aborted.'
+ });
+ }
+ };
+ }
+ }
+ };
+
+ // choose the correct AJAX handler depending on CORS support
+ EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;
+
+ // always use XMLHttpRequest for posts
+ EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;
+
+ // expose a common request method the uses GET\POST based on request length
+ EsriLeaflet.request = EsriLeaflet.Request.request;
+
+})(EsriLeaflet);
+
+EsriLeaflet.Services.Service = L.Class.extend({
+
+ includes: L.Mixin.Events,
+
+ options: {
+ proxy: false,
+ useCors: EsriLeaflet.Support.CORS
+ },
+
+ initialize: function (options) {
+ options = options || {};
+ this._requestQueue = [];
+ this._authenticating = false;
+ L.Util.setOptions(this, options);
+ this.options.url = EsriLeaflet.Util.cleanUrl(this.options.url);
+ },
+
+ get: function (path, params, callback, context) {
+ return this._request('get', path, params, callback, context);
+ },
+
+ post: function (path, params, callback, context) {
+ return this._request('post', path, params, callback, context);
+ },
+
+ request: function (path, params, callback, context) {
+ return this._request('request', path, params, callback, context);
+ },
+
+ metadata: function (callback, context) {
+ return this._request('get', '', {}, callback, context);
+ },
+
+ authenticate: function(token){
+ this._authenticating = false;
+ this.options.token = token;
+ this._runQueue();
+ return this;
+ },
+
+ _request: function(method, path, params, callback, context){
+ this.fire('requeststart', {
+ url: this.options.url + path,
+ params: params,
+ method: method
+ });
+
+ var wrappedCallback = this._createServiceCallback(method, path, params, callback, context);
+
+ if (this.options.token) {
+ params.token = this.options.token;
+ }
+
+ if (this._authenticating) {
+ this._requestQueue.push([method, path, params, callback, context]);
+ return;
+ } else {
+ var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;
+
+ if((method === 'get' || method === 'request') && !this.options.useCors){
+ return EsriLeaflet.Request.get.JSONP(url, params, wrappedCallback);
+ } else {
+ return EsriLeaflet[method](url, params, wrappedCallback);
+ }
+ }
+ },
+
+ _createServiceCallback: function(method, path, params, callback, context){
+ var request = [method, path, params, callback, context];
+
+ return L.Util.bind(function(error, response){
+
+ if (error && (error.code === 499 || error.code === 498)) {
+ this._authenticating = true;
+
+ this._requestQueue.push(request);
+
+ this.fire('authenticationrequired', {
+ authenticate: L.Util.bind(this.authenticate, this)
+ });
+ } else {
+ callback.call(context, error, response);
+
+ if(error) {
+ this.fire('requesterror', {
+ url: this.options.url + path,
+ params: params,
+ message: error.message,
+ code: error.code,
+ method: method
+ });
+ } else {
+ this.fire('requestsuccess', {
+ url: this.options.url + path,
+ params: params,
+ response: response,
+ method: method
+ });
+ }
+
+ this.fire('requestend', {
+ url: this.options.url + path,
+ params: params,
+ method: method
+ });
+ }
+ }, this);
+ },
+
+ _runQueue: function(){
+ for (var i = this._requestQueue.length - 1; i >= 0; i--) {
+ var request = this._requestQueue[i];
+ var method = request.shift();
+ this[method].apply(this, request);
+ }
+ this._requestQueue = [];
+ }
+
+});
+
+EsriLeaflet.Services.service = function(params){
+ return new EsriLeaflet.Services.Service(params);
+};
+
+EsriLeaflet.Services.ImageService = EsriLeaflet.Services.Service.extend({
+
+ query: function () {
+ return new EsriLeaflet.Tasks.Query(this);
+ },
+
+ identify: function() {
+ return new EsriLeaflet.Tasks.IdentifyImage(this);
+ }
+});
+
+EsriLeaflet.Services.imageService = function(params){
+ return new EsriLeaflet.Services.ImageService(params);
+};
+
+EsriLeaflet.Tasks.Task = L.Class.extend({
+
+ options: {
+ proxy: false,
+ useCors: EsriLeaflet.Support.CORS
+ },
+
+ //Generate a method for each methodName:paramName in the setters for this task.
+ generateSetter: function(param, context){
+ return L.Util.bind(function(value){
+ this.params[param] = value;
+ return this;
+ }, context);
+ },
+
+ initialize: function(endpoint){
+ // endpoint can be either a url (and options) for an ArcGIS Rest Service or an instance of EsriLeaflet.Service
+ if(endpoint.request && endpoint.options){
+ this._service = endpoint;
+ L.Util.setOptions(this, endpoint.options);
+ } else {
+ L.Util.setOptions(this, endpoint);
+ this.options.url = L.esri.Util.cleanUrl(endpoint.url);
+ }
+
+ // clone default params into this object
+ this.params = L.Util.extend({}, this.params || {});
+
+ // generate setter methods based on the setters object implimented a child class
+ if(this.setters){
+ for (var setter in this.setters){
+ var param = this.setters[setter];
+ this[setter] = this.generateSetter(param, this);
+ }
+ }
+ },
+
+ token: function(token){
+ if(this._service){
+ this._service.authenticate(token);
+ } else {
+ this.params.token = token;
+ }
+ return this;
+ },
+
+ request: function(callback, context){
+ if(this._service){
+ return this._service.request(this.path, this.params, callback, context);
+ } else {
+ return this._request('request', this.path, this.params, callback, context);
+ }
+ },
+
+ _request: function(method, path, params, callback, context){
+ var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;
+ if((method === 'get' || method === 'request') && !this.options.useCors){
+ return EsriLeaflet.Request.get.JSONP(url, params, callback, context);
+ } else{
+ return EsriLeaflet[method](url, params, callback, context);
+ }
+ }
+});
+
+EsriLeaflet.Tasks.Query = EsriLeaflet.Tasks.Task.extend({
+ setters: {
+ 'offset': 'offset',
+ 'limit': 'limit',
+ 'fields': 'outFields',
+ 'precision': 'geometryPrecision',
+ 'featureIds': 'objectIds',
+ 'returnGeometry': 'returnGeometry',
+ 'token': 'token'
+ },
+
+ path: 'query',
+
+ params: {
+ returnGeometry: true,
+ where: '1=1',
+ outSr: 4326,
+ outFields: '*'
+ },
+
+ within: function(geometry){
+ this._setGeometry(geometry);
+ this.params.spatialRel = 'esriSpatialRelContains'; // will make code read layer within geometry, to the api this will reads geometry contains layer
+ return this;
+ },
+
+ intersects: function(geometry){
+ this._setGeometry(geometry);
+ this.params.spatialRel = 'esriSpatialRelIntersects';
+ return this;
+ },
+
+ contains: function(geometry){
+ this._setGeometry(geometry);
+ this.params.spatialRel = 'esriSpatialRelWithin'; // will make code read layer contains geometry, to the api this will reads geometry within layer
+ return this;
+ },
+
+ // crosses: function(geometry){
+ // this._setGeometry(geometry);
+ // this.params.spatialRel = 'esriSpatialRelCrosses';
+ // return this;
+ // },
+
+ // touches: function(geometry){
+ // this._setGeometry(geometry);
+ // this.params.spatialRel = 'esriSpatialRelTouches';
+ // return this;
+ // },
+
+ overlaps: function(geometry){
+ this._setGeometry(geometry);
+ this.params.spatialRel = 'esriSpatialRelOverlaps';
+ return this;
+ },
+
+ // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online
+ nearby: function(latlng, radius){
+ latlng = L.latLng(latlng);
+ this.params.geometry = [latlng.lng, latlng.lat];
+ this.params.geometryType = 'esriGeometryPoint';
+ this.params.spatialRel = 'esriSpatialRelIntersects';
+ this.params.units = 'esriSRUnit_Meter';
+ this.params.distance = radius;
+ this.params.inSr = 4326;
+ return this;
+ },
+
+ where: function(string){
+ this.params.where = string.replace(/"/g, "\'"); // jshint ignore:line
+ return this;
+ },
+
+ between: function(start, end){
+ this.params.time = [start.valueOf(), end.valueOf()];
+ return this;
+ },
+
+ simplify: function(map, factor){
+ var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());
+ this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;
+ return this;
+ },
+
+ orderBy: function(fieldName, order){
+ order = order || 'ASC';
+ this.params.orderByFields = (this.params.orderByFields) ? this.params.orderByFields + ',' : '';
+ this.params.orderByFields += ([fieldName, order]).join(' ');
+ return this;
+ },
+
+ run: function(callback, context){
+ this._cleanParams();
+
+ // if the service is hosted on arcgis online request geojson directly
+ if(EsriLeaflet.Util.isArcgisOnline(this.options.url)){
+ this.params.f = 'geojson';
+
+ return this.request(function(error, response){
+ callback.call(context, error, response, response);
+ }, context);
+
+ // otherwise convert it in the callback then pass it on
+ } else {
+ return this.request(function(error, response){
+ callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);
+ }, context);
+ }
+ },
+
+ count: function(callback, context){
+ this._cleanParams();
+ this.params.returnCountOnly = true;
+ return this.request(function(error, response){
+ callback.call(this, error, (response && response.count), response);
+ }, context);
+ },
+
+ ids: function(callback, context){
+ this._cleanParams();
+ this.params.returnIdsOnly = true;
+ return this.request(function(error, response){
+ callback.call(this, error, (response && response.objectIds), response);
+ }, context);
+ },
+
+ // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online
+ bounds: function(callback, context){
+ this._cleanParams();
+ this.params.returnExtentOnly = true;
+ return this.request(function(error, response){
+ callback.call(context, error, (response && response.extent && EsriLeaflet.Util.extentToBounds(response.extent)), response);
+ }, context);
+ },
+
+ // only valid for image services
+ pixelSize: function(point){
+ point = L.point(point);
+ this.params.pixelSize = [point.x,point.y];
+ return this;
+ },
+
+ // only valid for map services
+ layer: function(layer){
+ this.path = layer + '/query';
+ return this;
+ },
+
+ _cleanParams: function(){
+ delete this.params.returnIdsOnly;
+ delete this.params.returnExtentOnly;
+ delete this.params.returnCountOnly;
+ },
+
+ _setGeometry: function(geometry) {
+ this.params.inSr = 4326;
+
+ // convert bounds to extent and finish
+ if ( geometry instanceof L.LatLngBounds ) {
+ // set geometry + geometryType
+ this.params.geometry = EsriLeaflet.Util.boundsToExtent(geometry);
+ this.params.geometryType = 'esriGeometryEnvelope';
+ return;
+ }
+
+ // convert L.Marker > L.LatLng
+ if(geometry.getLatLng){
+ geometry = geometry.getLatLng();
+ }
+
+ // convert L.LatLng to a geojson point and continue;
+ if (geometry instanceof L.LatLng) {
+ geometry = {
+ type: 'Point',
+ coordinates: [geometry.lng, geometry.lat]
+ };
+ }
+
+ // handle L.GeoJSON, pull out the first geometry
+ if ( geometry instanceof L.GeoJSON ) {
+ //reassign geometry to the GeoJSON value (we are assuming that only one feature is present)
+ geometry = geometry.getLayers()[0].feature.geometry;
+ this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);
+ this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);
+ }
+
+ // Handle L.Polyline and L.Polygon
+ if (geometry.toGeoJSON) {
+ geometry = geometry.toGeoJSON();
+ }
+
+ // handle GeoJSON feature by pulling out the geometry
+ if ( geometry.type === 'Feature' ) {
+ // get the geometry of the geojson feature
+ geometry = geometry.geometry;
+ }
+
+ // confirm that our GeoJSON is a point, line or polygon
+ if ( geometry.type === 'Point' || geometry.type === 'LineString' || geometry.type === 'Polygon') {
+ this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);
+ this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);
+ return;
+ }
+
+ // warn the user if we havn't found a
+ /* global console */
+ if(console && console.warn) {
+ console.warn('invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object');
+ }
+
+ return;
+ }
+});
+
+EsriLeaflet.Tasks.query = function(params){
+ return new EsriLeaflet.Tasks.Query(params);
+};
+
+EsriLeaflet.Tasks.Identify = EsriLeaflet.Tasks.Task.extend({
+ path: 'identify',
+
+ between: function(start, end){
+ this.params.time = [start.valueOf(), end.valueOf()];
+ return this;
+ }
+});
+
+
+EsriLeaflet.Layers.RasterLayer = L.Class.extend({
+ includes: L.Mixin.Events,
+
+ options: {
+ opacity: 1,
+ position: 'front',
+ f: 'image'
+ },
+
+ onAdd: function (map) {
+ this._map = map;
+
+ this._update = L.Util.limitExecByInterval(this._update, this.options.updateInterval, this);
+
+ if (map.options.crs && map.options.crs.code) {
+ var sr = map.options.crs.code.split(':')[1];
+ this.options.bboxSR = sr;
+ this.options.imageSR = sr;
+ }
+
+ map.on('moveend', this._update, this);
+
+ // if we had an image loaded and it matches the
+ // current bounds show the image otherwise remove it
+ if(this._currentImage && this._currentImage._bounds.equals(this._map.getBounds())){
+ map.addLayer(this._currentImage);
+ } else if(this._currentImage) {
+ this._map.removeLayer(this._currentImage);
+ this._currentImage = null;
+ }
+
+ this._update();
+
+ if(this._popup){
+ this._map.on('click', this._getPopupData, this);
+ this._map.on('dblclick', this._resetPopupState, this);
+ }
+ },
+
+ bindPopup: function(fn, popupOptions){
+ this._shouldRenderPopup = false;
+ this._lastClick = false;
+ this._popup = L.popup(popupOptions);
+ this._popupFunction = fn;
+ if(this._map){
+ this._map.on('click', this._getPopupData, this);
+ this._map.on('dblclick', this._resetPopupState, this);
+ }
+ return this;
+ },
+
+ unbindPopup: function(){
+ if(this._map){
+ this._map.closePopup(this._popup);
+ this._map.off('click', this._getPopupData, this);
+ this._map.off('dblclick', this._resetPopupState, this);
+ }
+ this._popup = false;
+ return this;
+ },
+
+ onRemove: function (map) {
+ if (this._currentImage) {
+ this._map.removeLayer(this._currentImage);
+ }
+
+ if(this._popup){
+ this._map.off('click', this._getPopupData, this);
+ this._map.off('dblclick', this._resetPopupState, this);
+ }
+
+ this._map.off('moveend', this._update, this);
+ this._map = null;
+ },
+
+ addTo: function(map){
+ map.addLayer(this);
+ return this;
+ },
+
+ removeFrom: function(map){
+ map.removeLayer(this);
+ return this;
+ },
+
+ bringToFront: function(){
+ this.options.position = 'front';
+ if(this._currentImage){
+ this._currentImage.bringToFront();
+ }
+ return this;
+ },
+
+ bringToBack: function(){
+ this.options.position = 'back';
+ if(this._currentImage){
+ this._currentImage.bringToBack();
+ }
+ return this;
+ },
+
+ getAttribution: function () {
+ return this.options.attribution;
+ },
+
+ getOpacity: function(){
+ return this.options.opacity;
+ },
+
+ setOpacity: function(opacity){
+ this.options.opacity = opacity;
+ this._currentImage.setOpacity(opacity);
+ return this;
+ },
+
+ getTimeRange: function(){
+ return [this.options.from, this.options.to];
+ },
+
+ setTimeRange: function(from, to){
+ this.options.from = from;
+ this.options.to = to;
+ this._update();
+ return this;
+ },
+
+ metadata: function(callback, context){
+ this._service.metadata(callback, context);
+ return this;
+ },
+
+ authenticate: function(token){
+ this._service.authenticate(token);
+ return this;
+ },
+
+ _renderImage: function(url, bounds){
+ if(this._map){
+ // create a new image overlay and add it to the map
+ // to start loading the image
+ // opacity is 0 while the image is loading
+ var image = new L.ImageOverlay(url, bounds, {
+ opacity: 0
+ }).addTo(this._map);
+
+ // once the image loads
+ image.once('load', function(e){
+ var newImage = e.target;
+ var oldImage = this._currentImage;
+
+ // if the bounds of this image matches the bounds that
+ // _renderImage was called with and we have a map
+ // hide the old image if there is one and set the opacity
+ // of the new image otherwise remove the new image
+ if(newImage._bounds.equals(bounds)){
+ this._currentImage = newImage;
+
+ if(this.options.position === 'front'){
+ this.bringToFront();
+ } else {
+ this.bringToBack();
+ }
+
+ if(this._map && this._currentImage._map){
+ this._currentImage.setOpacity(this.options.opacity);
+ } else {
+ this._currentImage._map.removeLayer(this._currentImage);
+ }
+
+ if(oldImage && this._map) {
+ this._map.removeLayer(oldImage);
+ }
+
+ if(oldImage && oldImage._map){
+ oldImage._map.removeLayer(oldImage);
+ }
+ } else {
+ this._map.removeLayer(newImage);
+ }
+
+ this.fire('load', {
+ bounds: bounds
+ });
+
+ }, this);
+
+ this.fire('loading', {
+ bounds: bounds
+ });
+ }
+ },
+
+ _update: function () {
+ if(!this._map){
+ return;
+ }
+
+ var zoom = this._map.getZoom();
+ var bounds = this._map.getBounds();
+
+ if(this._animatingZoom){
+ return;
+ }
+
+ if (this._map._panTransition && this._map._panTransition._inProgress) {
+ return;
+ }
+
+ if (zoom > this.options.maxZoom || zoom < this.options.minZoom) {
+ return;
+ }
+ var params = this._buildExportParams();
+
+ this._requestExport(params, bounds);
+ },
+
+ // TODO: refactor these into raster layer
+ _renderPopup: function(latlng, error, results, response){
+ latlng = L.latLng(latlng);
+ if(this._shouldRenderPopup && this._lastClick.equals(latlng)){
+ //add the popup to the map where the mouse was clicked at
+ var content = this._popupFunction(error, results, response);
+ if (content) {
+ this._popup.setLatLng(latlng).setContent(content).openOn(this._map);
+ }
+ }
+ },
+
+ _resetPopupState: function(e){
+ this._shouldRenderPopup = false;
+ this._lastClick = e.latlng;
+ },
+
+ // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js
+ // @TODO remove at Leaflet 0.8
+ _propagateEvent: function (e) {
+ e = L.extend({
+ layer: e.target,
+ target: this
+ }, e);
+ this.fire(e.type, e);
+ }
+});
+
+EsriLeaflet.Layers.ImageMapLayer = EsriLeaflet.Layers.RasterLayer.extend({
+
+ options: {
+ updateInterval: 150,
+ format: 'jpgpng'
+ },
+
+ query: function(){
+ return this._service.query();
+ },
+
+ identify: function(){
+ return this._service.identify();
+ },
+
+ initialize: function (url, options) {
+ options = options || {};
+ options.url = EsriLeaflet.Util.cleanUrl(url);
+ this._service = new EsriLeaflet.Services.ImageService(options);
+ this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);
+ L.Util.setOptions(this, options);
+ },
+
+ setPixelType: function (pixelType) {
+ this.options.pixelType = pixelType;
+ this._update();
+ return this;
+ },
+
+ getPixelType: function () {
+ return this.options.pixelType;
+ },
+
+ setBandIds: function (bandIds) {
+ if (L.Util.isArray(bandIds)) {
+ this.options.bandIds = bandIds.join(',');
+ } else {
+ this.options.bandIds = bandIds.toString();
+ }
+ this._update();
+ return this;
+ },
+
+ getBandIds: function () {
+ return this.options.bandIds;
+ },
+
+ setNoData: function (noData, noDataInterpretation) {
+ if (L.Util.isArray(noData)) {
+ this.options.noData = noData.join(',');
+ } else {
+ this.options.noData = noData.toString();
+ }
+ if (noDataInterpretation) {
+ this.options.noDataInterpretation = noDataInterpretation;
+ }
+ this._update();
+ return this;
+ },
+
+ getNoData: function () {
+ return this.options.noData;
+ },
+
+ getNoDataInterpretation: function () {
+ return this.options.noDataInterpretation;
+ },
+
+ setRenderingRule: function(renderingRule) {
+ this.options.renderingRule = renderingRule;
+ this._update();
+ },
+
+ getRenderingRule: function() {
+ return this.options.renderingRule;
+ },
+
+ setMosaicRule: function(mosaicRule) {
+ this.options.mosaicRule = mosaicRule;
+ this._update();
+ },
+
+ getMosaicRule: function() {
+ return this.options.mosaicRule;
+ },
+
+ _getPopupData: function(e){
+ var callback = L.Util.bind(function(error, results, response) {
+ setTimeout(L.Util.bind(function(){
+ this._renderPopup(e.latlng, error, results, response);
+ }, this), 300);
+ }, this);
+
+ var identifyRequest = this.identify().at(e.latlng);
+
+ // set mosaic rule for identify task if it is set for layer
+ if (this.options.mosaicRule) {
+ identifyRequest.setMosaicRule(this.options.mosaicRule);
+ // @TODO: force return catalog items too?
+ }
+
+ // @TODO: set rendering rule? Not sure,
+ // sometimes you want raw pixel values
+ // if (this.options.renderingRule) {
+ // identifyRequest.setRenderingRule(this.options.renderingRule);
+ // }
+
+ identifyRequest.run(callback);
+
+ // set the flags to show the popup
+ this._shouldRenderPopup = true;
+ this._lastClick = e.latlng;
+ },
+
+ _buildExportParams: function () {
+ var bounds = this._map.getBounds();
+ var size = this._map.getSize();
+ var ne = this._map.options.crs.project(bounds._northEast);
+ var sw = this._map.options.crs.project(bounds._southWest);
+
+ var params = {
+ bbox: [sw.x, sw.y, ne.x, ne.y].join(','),
+ size: size.x + ',' + size.y,
+ format: this.options.format,
+ bboxSR: this.options.bboxSR,
+ imageSR: this.options.imageSR
+ };
+
+ if (this.options.from && this.options.to) {
+ params.time = this.options.from.valueOf() + ',' + this.options.to.valueOf();
+ }
+
+ if (this.options.pixelType) {
+ params.pixelType = this.options.pixelType;
+ }
+
+ if (this.options.interpolation) {
+ params.interpolation = this.options.interpolation;
+ }
+
+ if (this.options.compressionQuality) {
+ params.compressionQuality = this.options.compressionQuality;
+ }
+
+ if (this.options.bandIds) {
+ params.bandIds = this.options.bandIds;
+ }
+
+ if (this.options.noData) {
+ params.noData = this.options.noData;
+ }
+
+ if (this.options.noDataInterpretation) {
+ params.noDataInterpretation = this.options.noDataInterpretation;
+ }
+
+ if (this._service.options.token) {
+ params.token = this._service.options.token;
+ }
+
+ if(this.options.renderingRule) {
+ params.renderingRule = JSON.stringify(this.options.renderingRule);
+ }
+
+ if(this.options.mosaicRule) {
+ params.mosaicRule = JSON.stringify(this.options.mosaicRule);
+ }
+
+ return params;
+ },
+
+ _requestExport: function (params, bounds) {
+ if (this.options.f === 'json') {
+ this._service.get('exportImage', params, function(error, response){
+ this._renderImage(response.href, bounds);
+ }, this);
+ } else {
+ params.f = 'image';
+ this._renderImage(this.options.url + 'exportImage' + L.Util.getParamString(params), bounds);
+ }
+ }
+});
+
+EsriLeaflet.ImageMapLayer = EsriLeaflet.Layers.ImageMapLayer;
+
+EsriLeaflet.Layers.imageMapLayer = function (url, options) {
+ return new EsriLeaflet.Layers.ImageMapLayer(url, options);
+};
+
+EsriLeaflet.imageMapLayer = function (url, options) {
+ return new EsriLeaflet.Layers.ImageMapLayer(url, options);
+};
+
+ return EsriLeaflet;
+}));
+//# sourceMappingURL=esri-leaflet-image-service-src.js.map
\ No newline at end of file
diff --git a/dist/builds/image-service/esri-leaflet-image-service-src.js.map b/dist/builds/image-service/esri-leaflet-image-service-src.js.map
new file mode 100644
index 000000000..5de097850
--- /dev/null
+++ b/dist/builds/image-service/esri-leaflet-image-service-src.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["../../../src/EsriLeaflet.js","../../../src/Util.js","../../../src/Request.js","../../../src/Services/Service.js","../../../src/Services/ImageService.js","../../../src/Tasks/Task.js","../../../src/Tasks/Query.js","../../../src/Tasks/Identify.js","../../../src/Layers/RasterLayer.js","../../../src/Layers/ImageMapLayer.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI;AACxC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;AACxB,EAAE,MAAM,CAAC,CAAC,GAAG;AACb,EAAE,QAAQ,CAAC,CAAC,GAAG;AACf,EAAE,QAAQ,CAAC,CAAC,GAAG;AACf,EAAE,KAAK,CAAC,CAAC,GAAG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{},\n Tasks: {},\n Util: {},\n Support: {\n CORS: !!(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()),\n pointerEvents: document.documentElement.style.pointerEvents === ''\n }\n};\n\nif(typeof window !== 'undefined' && window.L){\n window.L.esri = EsriLeaflet;\n}\n","(function(EsriLeaflet){\n\n // normalize request animation frame\n var raf = window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function(cb) { return window.setTimeout(cb, 1000 / 60); };\n\n // shallow object clone for feature properties and attributes\n // from http://jsperf.com/cloning-an-object/2\n function clone(obj) {\n var target = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n target[i] = obj[i];\n }\n }\n return target;\n }\n\n // checks if 2 x,y points are equal\n function pointsEqual(a, b) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n }\n\n // checks if the first and last points of a ring are equal and closes the ring\n function closeRing(coordinates) {\n if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {\n coordinates.push(coordinates[0]);\n }\n return coordinates;\n }\n\n // determine if polygon ring coordinates are clockwise. clockwise signifies outer ring, counter-clockwise an inner ring\n // or hole. this logic was found at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-\n // points-are-in-clockwise-order\n function ringIsClockwise(ringToTest) {\n var total = 0,i = 0;\n var rLength = ringToTest.length;\n var pt1 = ringToTest[i];\n var pt2;\n for (i; i < rLength - 1; i++) {\n pt2 = ringToTest[i + 1];\n total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);\n pt1 = pt2;\n }\n return (total >= 0);\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L504-L519\n function vertexIntersectsVertex(a1, a2, b1, b2) {\n var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);\n var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);\n var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);\n\n if ( uB !== 0 ) {\n var ua = uaT / uB;\n var ub = ubT / uB;\n\n if ( 0 <= ua && ua <= 1 && 0 <= ub && ub <= 1 ) {\n return true;\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L521-L531\n function arrayIntersectsArray(a, b) {\n for (var i = 0; i < a.length - 1; i++) {\n for (var j = 0; j < b.length - 1; j++) {\n if (vertexIntersectsVertex(a[i], a[i + 1], b[j], b[j + 1])) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L470-L480\n function coordinatesContainPoint(coordinates, point) {\n var contains = false;\n for(var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {\n if (((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||\n (coordinates[j][1] <= point[1] && point[1] < coordinates[i][1])) &&\n (point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0])) {\n contains = !contains;\n }\n }\n return contains;\n }\n\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L106-L113\n function coordinatesContainCoordinates(outer, inner){\n var intersects = arrayIntersectsArray(outer, inner);\n var contains = coordinatesContainPoint(outer, inner[0]);\n if(!intersects && contains){\n return true;\n }\n return false;\n }\n\n // do any polygons in this array contain any other polygons in this array?\n // used for checking for holes in arcgis rings\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L117-L172\n function convertRingsToGeoJSON(rings){\n var outerRings = [];\n var holes = [];\n var x; // iterator\n var outerRing; // current outer ring being evaluated\n var hole; // current hole being evaluated\n\n // for each ring\n for (var r = 0; r < rings.length; r++) {\n var ring = closeRing(rings[r].slice(0));\n if(ring.length < 4){\n continue;\n }\n // is this ring an outer ring? is it clockwise?\n if(ringIsClockwise(ring)){\n var polygon = [ ring ];\n outerRings.push(polygon); // push to outer rings\n } else {\n holes.push(ring); // counterclockwise push to holes\n }\n }\n\n var uncontainedHoles = [];\n\n // while there are holes left...\n while(holes.length){\n // pop a hole off out stack\n hole = holes.pop();\n\n // loop over all outer rings and see if they contain our hole.\n var contained = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(coordinatesContainCoordinates(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n contained = true;\n break;\n }\n }\n\n // ring is not contained in any outer ring\n // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320\n if(!contained){\n uncontainedHoles.push(hole);\n }\n }\n\n // if we couldn't match any holes using contains we can try intersects...\n while(uncontainedHoles.length){\n // pop a hole off out stack\n hole = uncontainedHoles.pop();\n\n // loop over all outer rings and see if any intersect our hole.\n var intersects = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(arrayIntersectsArray(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n intersects = true;\n break;\n }\n }\n\n if(!intersects) {\n outerRings.push([hole.reverse()]);\n }\n }\n\n if(outerRings.length === 1){\n return {\n type: 'Polygon',\n coordinates: outerRings[0]\n };\n } else {\n return {\n type: 'MultiPolygon',\n coordinates: outerRings\n };\n }\n }\n\n // This function ensures that rings are oriented in the right directions\n // outer rings are clockwise, holes are counterclockwise\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function orientRings(poly){\n var output = [];\n var polygon = poly.slice(0);\n var outerRing = closeRing(polygon.shift().slice(0));\n if(outerRing.length >= 4){\n if(!ringIsClockwise(outerRing)){\n outerRing.reverse();\n }\n\n output.push(outerRing);\n\n for (var i = 0; i < polygon.length; i++) {\n var hole = closeRing(polygon[i].slice(0));\n if(hole.length >= 4){\n if(ringIsClockwise(hole)){\n hole.reverse();\n }\n output.push(hole);\n }\n }\n }\n\n return output;\n }\n\n // This function flattens holes in multipolygons to one array of polygons\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function flattenMultiPolygonRings(rings){\n var output = [];\n for (var i = 0; i < rings.length; i++) {\n var polygon = orientRings(rings[i]);\n for (var x = polygon.length - 1; x >= 0; x--) {\n var ring = polygon[x].slice(0);\n output.push(ring);\n }\n }\n return output;\n }\n\n // convert an extent (ArcGIS) to LatLngBounds (Leaflet)\n EsriLeaflet.Util.extentToBounds = function(extent){\n var sw = new L.LatLng(extent.ymin, extent.xmin);\n var ne = new L.LatLng(extent.ymax, extent.xmax);\n return new L.LatLngBounds(sw, ne);\n };\n\n // convert an LatLngBounds (Leaflet) to extent (ArcGIS)\n EsriLeaflet.Util.boundsToExtent = function(bounds) {\n bounds = L.latLngBounds(bounds);\n return {\n 'xmin': bounds.getSouthWest().lng,\n 'ymin': bounds.getSouthWest().lat,\n 'xmax': bounds.getNorthEast().lng,\n 'ymax': bounds.getNorthEast().lat,\n 'spatialReference': {\n 'wkid' : 4326\n }\n };\n };\n\n EsriLeaflet.Util.arcgisToGeojson = function (arcgis, idAttribute){\n var geojson = {};\n\n if(typeof arcgis.x === 'number' && typeof arcgis.y === 'number'){\n geojson.type = 'Point';\n geojson.coordinates = [arcgis.x, arcgis.y];\n }\n\n if(arcgis.points){\n geojson.type = 'MultiPoint';\n geojson.coordinates = arcgis.points.slice(0);\n }\n\n if(arcgis.paths) {\n if(arcgis.paths.length === 1){\n geojson.type = 'LineString';\n geojson.coordinates = arcgis.paths[0].slice(0);\n } else {\n geojson.type = 'MultiLineString';\n geojson.coordinates = arcgis.paths.slice(0);\n }\n }\n\n if(arcgis.rings) {\n geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));\n }\n\n if(arcgis.geometry || arcgis.attributes) {\n geojson.type = 'Feature';\n geojson.geometry = (arcgis.geometry) ? EsriLeaflet.Util.arcgisToGeojson(arcgis.geometry) : null;\n geojson.properties = (arcgis.attributes) ? clone(arcgis.attributes) : null;\n if(arcgis.attributes) {\n geojson.id = arcgis.attributes[idAttribute] || arcgis.attributes.OBJECTID || arcgis.attributes.FID;\n }\n }\n\n return geojson;\n };\n\n // GeoJSON -> ArcGIS\n EsriLeaflet.Util.geojsonToArcGIS = function(geojson, idAttribute){\n idAttribute = idAttribute || 'OBJECTID';\n var spatialReference = { wkid: 4326 };\n var result = {};\n var i;\n\n switch(geojson.type){\n case 'Point':\n result.x = geojson.coordinates[0];\n result.y = geojson.coordinates[1];\n result.spatialReference = spatialReference;\n break;\n case 'MultiPoint':\n result.points = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'LineString':\n result.paths = [geojson.coordinates.slice(0)];\n result.spatialReference = spatialReference;\n break;\n case 'MultiLineString':\n result.paths = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'Polygon':\n result.rings = orientRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'MultiPolygon':\n result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'Feature':\n if(geojson.geometry) {\n result.geometry = EsriLeaflet.Util.geojsonToArcGIS(geojson.geometry, idAttribute);\n }\n result.attributes = (geojson.properties) ? clone(geojson.properties) : {};\n if(geojson.id){\n result.attributes[idAttribute] = geojson.id;\n }\n break;\n case 'FeatureCollection':\n result = [];\n for (i = 0; i < geojson.features.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.features[i], idAttribute));\n }\n break;\n case 'GeometryCollection':\n result = [];\n for (i = 0; i < geojson.geometries.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.geometries[i], idAttribute));\n }\n break;\n }\n\n return result;\n };\n\n EsriLeaflet.Util.responseToFeatureCollection = function(response, idAttribute){\n var objectIdField;\n\n if(idAttribute){\n objectIdField = idAttribute;\n } else if(response.objectIdFieldName){\n objectIdField = response.objectIdFieldName;\n } else if(response.fields) {\n for (var j = 0; j <= response.fields.length - 1; j++) {\n if(response.fields[j].type === 'esriFieldTypeOID') {\n objectIdField = response.fields[j].name;\n break;\n }\n }\n } else {\n objectIdField = 'OBJECTID';\n }\n\n var featureCollection = {\n type: 'FeatureCollection',\n features: []\n };\n var features = response.features || response.results;\n if(features.length){\n for (var i = features.length - 1; i >= 0; i--) {\n featureCollection.features.push(EsriLeaflet.Util.arcgisToGeojson(features[i], objectIdField));\n }\n }\n\n return featureCollection;\n };\n\n // trim whitespace and add a tailing slash is needed to a url\n EsriLeaflet.Util.cleanUrl = function(url){\n url = url.replace(/\\s\\s*/g, '');\n\n //add a trailing slash to the url if the user omitted it\n if(url[url.length-1] !== '/'){\n url += '/';\n }\n\n return url;\n };\n\n EsriLeaflet.Util.isArcgisOnline = function(url){\n return (/\\.arcgis\\.com/g).test(url);\n };\n\n EsriLeaflet.Util.geojsonTypeToArcGIS = function (geoJsonType) {\n var arcgisGeometryType;\n switch (geoJsonType) {\n case 'Point':\n arcgisGeometryType = 'esriGeometryPoint';\n break;\n case 'MultiPoint':\n arcgisGeometryType = 'esriGeometryMultipoint';\n break;\n case 'LineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'MultiLineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'Polygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n case 'MultiPolygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n }\n return arcgisGeometryType;\n };\n\n EsriLeaflet.Util.requestAnimationFrame = L.Util.bind(raf, window);\n\n})(EsriLeaflet);","(function(EsriLeaflet){\n\n var callbacks = 0;\n\n window._EsriLeafletCallbacks = {};\n\n function serialize(params){\n var data = '';\n\n params.f = params.f || 'json';\n\n for (var key in params){\n if(params.hasOwnProperty(key)){\n var param = params[key];\n var type = Object.prototype.toString.call(param);\n var value;\n\n if(data.length){\n data += '&';\n }\n\n if (type === '[object Array]'){\n value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');\n } else if (type === '[object Object]') {\n value = JSON.stringify(param);\n } else if (type === '[object Date]'){\n value = param.valueOf();\n } else {\n value = param;\n }\n\n data += encodeURIComponent(key) + '=' + encodeURIComponent(value);\n }\n }\n\n return data;\n }\n\n function createRequest(callback, context){\n var httpRequest = new XMLHttpRequest();\n\n httpRequest.onerror = function(e) {\n httpRequest.onreadystatechange = L.Util.falseFn;\n\n callback.call(context, {\n error: {\n code: 500,\n message: 'XMLHttpRequest error'\n }\n }, null);\n };\n\n httpRequest.onreadystatechange = function(){\n var response;\n var error;\n\n if (httpRequest.readyState === 4) {\n try {\n response = JSON.parse(httpRequest.responseText);\n } catch(e) {\n response = null;\n error = {\n code: 500,\n message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'\n };\n }\n\n if (!error && response.error) {\n error = response.error;\n response = null;\n }\n\n httpRequest.onerror = L.Util.falseFn;\n\n callback.call(context, error, response);\n }\n };\n\n return httpRequest;\n }\n\n // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)\n EsriLeaflet.Request = {\n request: function(url, params, callback, context){\n var paramString = serialize(params);\n var httpRequest = createRequest(callback, context);\n var requestLength = (url + '?' + paramString).length;\n\n // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest\n if(requestLength <= 2000 && L.esri.Support.CORS){\n httpRequest.open('GET', url + '?' + paramString);\n httpRequest.send(null);\n\n // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest\n } else if (requestLength > 2000 && L.esri.Support.CORS){\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(paramString);\n\n // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request\n } else if(requestLength <= 2000 && !L.esri.Support.CORS){\n return L.esri.Request.get.JSONP(url, params, callback, context);\n\n // request is longer then 2000 characters and the browser does not support CORS, log a warning\n } else {\n if(console && console.warn){\n console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');\n return;\n }\n }\n\n return httpRequest;\n },\n post: {\n XMLHTTP: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(serialize(params));\n\n return httpRequest;\n }\n },\n\n get: {\n CORS: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n\n httpRequest.open('GET', url + '?' + serialize(params), true);\n httpRequest.send(null);\n\n return httpRequest;\n },\n JSONP: function(url, params, callback, context){\n var callbackId = 'c' + callbacks;\n\n params.callback = 'window._EsriLeafletCallbacks.' + callbackId;\n\n var script = L.DomUtil.create('script', null, document.body);\n script.type = 'text/javascript';\n script.src = url + '?' + serialize(params);\n script.id = callbackId;\n\n window._EsriLeafletCallbacks[callbackId] = function(response){\n if(window._EsriLeafletCallbacks[callbackId] !== true){\n var error;\n var responseType = Object.prototype.toString.call(response);\n\n if(!(responseType === '[object Object]' || responseType === '[object Array]')){\n error = {\n error: {\n code: 500,\n message: 'Expected array or object as JSONP response'\n }\n };\n response = null;\n }\n\n if (!error && response.error) {\n error = response;\n response = null;\n }\n\n callback.call(context, error, response);\n window._EsriLeafletCallbacks[callbackId] = true;\n }\n };\n\n callbacks++;\n\n return {\n id: callbackId,\n url: script.src,\n abort: function(){\n window._EsriLeafletCallbacks._callback[callbackId]({\n code: 0,\n message: 'Request aborted.'\n });\n }\n };\n }\n }\n };\n\n // choose the correct AJAX handler depending on CORS support\n EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;\n\n // always use XMLHttpRequest for posts\n EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;\n\n // expose a common request method the uses GET\\POST based on request length\n EsriLeaflet.request = EsriLeaflet.Request.request;\n\n})(EsriLeaflet);","EsriLeaflet.Services.Service = L.Class.extend({\n\n includes: L.Mixin.Events,\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n initialize: function (options) {\n options = options || {};\n this._requestQueue = [];\n this._authenticating = false;\n L.Util.setOptions(this, options);\n this.options.url = EsriLeaflet.Util.cleanUrl(this.options.url);\n },\n\n get: function (path, params, callback, context) {\n return this._request('get', path, params, callback, context);\n },\n\n post: function (path, params, callback, context) {\n return this._request('post', path, params, callback, context);\n },\n\n request: function (path, params, callback, context) {\n return this._request('request', path, params, callback, context);\n },\n\n metadata: function (callback, context) {\n return this._request('get', '', {}, callback, context);\n },\n\n authenticate: function(token){\n this._authenticating = false;\n this.options.token = token;\n this._runQueue();\n return this;\n },\n\n _request: function(method, path, params, callback, context){\n this.fire('requeststart', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n\n var wrappedCallback = this._createServiceCallback(method, path, params, callback, context);\n\n if (this.options.token) {\n params.token = this.options.token;\n }\n\n if (this._authenticating) {\n this._requestQueue.push([method, path, params, callback, context]);\n return;\n } else {\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, wrappedCallback);\n } else {\n return EsriLeaflet[method](url, params, wrappedCallback);\n }\n }\n },\n\n _createServiceCallback: function(method, path, params, callback, context){\n var request = [method, path, params, callback, context];\n\n return L.Util.bind(function(error, response){\n\n if (error && (error.code === 499 || error.code === 498)) {\n this._authenticating = true;\n\n this._requestQueue.push(request);\n\n this.fire('authenticationrequired', {\n authenticate: L.Util.bind(this.authenticate, this)\n });\n } else {\n callback.call(context, error, response);\n\n if(error) {\n this.fire('requesterror', {\n url: this.options.url + path,\n params: params,\n message: error.message,\n code: error.code,\n method: method\n });\n } else {\n this.fire('requestsuccess', {\n url: this.options.url + path,\n params: params,\n response: response,\n method: method\n });\n }\n\n this.fire('requestend', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n }\n }, this);\n },\n\n _runQueue: function(){\n for (var i = this._requestQueue.length - 1; i >= 0; i--) {\n var request = this._requestQueue[i];\n var method = request.shift();\n this[method].apply(this, request);\n }\n this._requestQueue = [];\n }\n\n});\n\nEsriLeaflet.Services.service = function(params){\n return new EsriLeaflet.Services.Service(params);\n};","EsriLeaflet.Services.ImageService = EsriLeaflet.Services.Service.extend({\n\n query: function () {\n return new EsriLeaflet.Tasks.Query(this);\n },\n\n identify: function() {\n return new EsriLeaflet.Tasks.IdentifyImage(this);\n }\n});\n\nEsriLeaflet.Services.imageService = function(params){\n return new EsriLeaflet.Services.ImageService(params);\n};","EsriLeaflet.Tasks.Task = L.Class.extend({\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n //Generate a method for each methodName:paramName in the setters for this task.\n generateSetter: function(param, context){\n return L.Util.bind(function(value){\n this.params[param] = value;\n return this;\n }, context);\n },\n\n initialize: function(endpoint){\n // endpoint can be either a url (and options) for an ArcGIS Rest Service or an instance of EsriLeaflet.Service\n if(endpoint.request && endpoint.options){\n this._service = endpoint;\n L.Util.setOptions(this, endpoint.options);\n } else {\n L.Util.setOptions(this, endpoint);\n this.options.url = L.esri.Util.cleanUrl(endpoint.url);\n }\n\n // clone default params into this object\n this.params = L.Util.extend({}, this.params || {});\n\n // generate setter methods based on the setters object implimented a child class\n if(this.setters){\n for (var setter in this.setters){\n var param = this.setters[setter];\n this[setter] = this.generateSetter(param, this);\n }\n }\n },\n\n token: function(token){\n if(this._service){\n this._service.authenticate(token);\n } else {\n this.params.token = token;\n }\n return this;\n },\n\n request: function(callback, context){\n if(this._service){\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n },\n\n _request: function(method, path, params, callback, context){\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, callback, context);\n } else{\n return EsriLeaflet[method](url, params, callback, context);\n }\n }\n});","EsriLeaflet.Tasks.Query = EsriLeaflet.Tasks.Task.extend({\n setters: {\n 'offset': 'offset',\n 'limit': 'limit',\n 'fields': 'outFields',\n 'precision': 'geometryPrecision',\n 'featureIds': 'objectIds',\n 'returnGeometry': 'returnGeometry',\n 'token': 'token'\n },\n\n path: 'query',\n\n params: {\n returnGeometry: true,\n where: '1=1',\n outSr: 4326,\n outFields: '*'\n },\n\n within: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelContains'; // will make code read layer within geometry, to the api this will reads geometry contains layer\n return this;\n },\n\n intersects: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelIntersects';\n return this;\n },\n\n contains: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelWithin'; // will make code read layer contains geometry, to the api this will reads geometry within layer\n return this;\n },\n\n // crosses: function(geometry){\n // this._setGeometry(geometry);\n // this.params.spatialRel = 'esriSpatialRelCrosses';\n // return this;\n // },\n\n // touches: function(geometry){\n // this._setGeometry(geometry);\n // this.params.spatialRel = 'esriSpatialRelTouches';\n // return this;\n // },\n\n overlaps: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelOverlaps';\n return this;\n },\n\n // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online\n nearby: function(latlng, radius){\n latlng = L.latLng(latlng);\n this.params.geometry = [latlng.lng, latlng.lat];\n this.params.geometryType = 'esriGeometryPoint';\n this.params.spatialRel = 'esriSpatialRelIntersects';\n this.params.units = 'esriSRUnit_Meter';\n this.params.distance = radius;\n this.params.inSr = 4326;\n return this;\n },\n\n where: function(string){\n this.params.where = string.replace(/\"/g, \"\\'\"); // jshint ignore:line\n return this;\n },\n\n between: function(start, end){\n this.params.time = [start.valueOf(), end.valueOf()];\n return this;\n },\n\n simplify: function(map, factor){\n var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());\n this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;\n return this;\n },\n\n orderBy: function(fieldName, order){\n order = order || 'ASC';\n this.params.orderByFields = (this.params.orderByFields) ? this.params.orderByFields + ',' : '';\n this.params.orderByFields += ([fieldName, order]).join(' ');\n return this;\n },\n\n run: function(callback, context){\n this._cleanParams();\n\n // if the service is hosted on arcgis online request geojson directly\n if(EsriLeaflet.Util.isArcgisOnline(this.options.url)){\n this.params.f = 'geojson';\n\n return this.request(function(error, response){\n callback.call(context, error, response, response);\n }, context);\n\n // otherwise convert it in the callback then pass it on\n } else {\n return this.request(function(error, response){\n callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);\n }, context);\n }\n },\n\n count: function(callback, context){\n this._cleanParams();\n this.params.returnCountOnly = true;\n return this.request(function(error, response){\n callback.call(this, error, (response && response.count), response);\n }, context);\n },\n\n ids: function(callback, context){\n this._cleanParams();\n this.params.returnIdsOnly = true;\n return this.request(function(error, response){\n callback.call(this, error, (response && response.objectIds), response);\n }, context);\n },\n\n // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online\n bounds: function(callback, context){\n this._cleanParams();\n this.params.returnExtentOnly = true;\n return this.request(function(error, response){\n callback.call(context, error, (response && response.extent && EsriLeaflet.Util.extentToBounds(response.extent)), response);\n }, context);\n },\n\n // only valid for image services\n pixelSize: function(point){\n point = L.point(point);\n this.params.pixelSize = [point.x,point.y];\n return this;\n },\n\n // only valid for map services\n layer: function(layer){\n this.path = layer + '/query';\n return this;\n },\n\n _cleanParams: function(){\n delete this.params.returnIdsOnly;\n delete this.params.returnExtentOnly;\n delete this.params.returnCountOnly;\n },\n\n _setGeometry: function(geometry) {\n this.params.inSr = 4326;\n\n // convert bounds to extent and finish\n if ( geometry instanceof L.LatLngBounds ) {\n // set geometry + geometryType\n this.params.geometry = EsriLeaflet.Util.boundsToExtent(geometry);\n this.params.geometryType = 'esriGeometryEnvelope';\n return;\n }\n\n // convert L.Marker > L.LatLng\n if(geometry.getLatLng){\n geometry = geometry.getLatLng();\n }\n\n // convert L.LatLng to a geojson point and continue;\n if (geometry instanceof L.LatLng) {\n geometry = {\n type: 'Point',\n coordinates: [geometry.lng, geometry.lat]\n };\n }\n\n // handle L.GeoJSON, pull out the first geometry\n if ( geometry instanceof L.GeoJSON ) {\n //reassign geometry to the GeoJSON value (we are assuming that only one feature is present)\n geometry = geometry.getLayers()[0].feature.geometry;\n this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);\n this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);\n }\n\n // Handle L.Polyline and L.Polygon\n if (geometry.toGeoJSON) {\n geometry = geometry.toGeoJSON();\n }\n\n // handle GeoJSON feature by pulling out the geometry\n if ( geometry.type === 'Feature' ) {\n // get the geometry of the geojson feature\n geometry = geometry.geometry;\n }\n\n // confirm that our GeoJSON is a point, line or polygon\n if ( geometry.type === 'Point' || geometry.type === 'LineString' || geometry.type === 'Polygon') {\n this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);\n this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);\n return;\n }\n\n // warn the user if we havn't found a\n /* global console */\n if(console && console.warn) {\n console.warn('invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object');\n }\n\n return;\n }\n});\n\nEsriLeaflet.Tasks.query = function(params){\n return new EsriLeaflet.Tasks.Query(params);\n};","EsriLeaflet.Tasks.Identify = EsriLeaflet.Tasks.Task.extend({\n path: 'identify',\n\n between: function(start, end){\n this.params.time = [start.valueOf(), end.valueOf()];\n return this;\n }\n});\n","EsriLeaflet.Layers.RasterLayer = L.Class.extend({\n includes: L.Mixin.Events,\n\n options: {\n opacity: 1,\n position: 'front',\n f: 'image'\n },\n\n onAdd: function (map) {\n this._map = map;\n\n this._update = L.Util.limitExecByInterval(this._update, this.options.updateInterval, this);\n\n if (map.options.crs && map.options.crs.code) {\n var sr = map.options.crs.code.split(':')[1];\n this.options.bboxSR = sr;\n this.options.imageSR = sr;\n }\n\n map.on('moveend', this._update, this);\n\n // if we had an image loaded and it matches the\n // current bounds show the image otherwise remove it\n if(this._currentImage && this._currentImage._bounds.equals(this._map.getBounds())){\n map.addLayer(this._currentImage);\n } else if(this._currentImage) {\n this._map.removeLayer(this._currentImage);\n this._currentImage = null;\n }\n\n this._update();\n\n if(this._popup){\n this._map.on('click', this._getPopupData, this);\n this._map.on('dblclick', this._resetPopupState, this);\n }\n },\n\n bindPopup: function(fn, popupOptions){\n this._shouldRenderPopup = false;\n this._lastClick = false;\n this._popup = L.popup(popupOptions);\n this._popupFunction = fn;\n if(this._map){\n this._map.on('click', this._getPopupData, this);\n this._map.on('dblclick', this._resetPopupState, this);\n }\n return this;\n },\n\n unbindPopup: function(){\n if(this._map){\n this._map.closePopup(this._popup);\n this._map.off('click', this._getPopupData, this);\n this._map.off('dblclick', this._resetPopupState, this);\n }\n this._popup = false;\n return this;\n },\n\n onRemove: function (map) {\n if (this._currentImage) {\n this._map.removeLayer(this._currentImage);\n }\n\n if(this._popup){\n this._map.off('click', this._getPopupData, this);\n this._map.off('dblclick', this._resetPopupState, this);\n }\n\n this._map.off('moveend', this._update, this);\n this._map = null;\n },\n\n addTo: function(map){\n map.addLayer(this);\n return this;\n },\n\n removeFrom: function(map){\n map.removeLayer(this);\n return this;\n },\n\n bringToFront: function(){\n this.options.position = 'front';\n if(this._currentImage){\n this._currentImage.bringToFront();\n }\n return this;\n },\n\n bringToBack: function(){\n this.options.position = 'back';\n if(this._currentImage){\n this._currentImage.bringToBack();\n }\n return this;\n },\n\n getAttribution: function () {\n return this.options.attribution;\n },\n\n getOpacity: function(){\n return this.options.opacity;\n },\n\n setOpacity: function(opacity){\n this.options.opacity = opacity;\n this._currentImage.setOpacity(opacity);\n return this;\n },\n\n getTimeRange: function(){\n return [this.options.from, this.options.to];\n },\n\n setTimeRange: function(from, to){\n this.options.from = from;\n this.options.to = to;\n this._update();\n return this;\n },\n\n metadata: function(callback, context){\n this._service.metadata(callback, context);\n return this;\n },\n\n authenticate: function(token){\n this._service.authenticate(token);\n return this;\n },\n\n _renderImage: function(url, bounds){\n if(this._map){\n // create a new image overlay and add it to the map\n // to start loading the image\n // opacity is 0 while the image is loading\n var image = new L.ImageOverlay(url, bounds, {\n opacity: 0\n }).addTo(this._map);\n\n // once the image loads\n image.once('load', function(e){\n var newImage = e.target;\n var oldImage = this._currentImage;\n\n // if the bounds of this image matches the bounds that\n // _renderImage was called with and we have a map\n // hide the old image if there is one and set the opacity\n // of the new image otherwise remove the new image\n if(newImage._bounds.equals(bounds)){\n this._currentImage = newImage;\n\n if(this.options.position === 'front'){\n this.bringToFront();\n } else {\n this.bringToBack();\n }\n\n if(this._map && this._currentImage._map){\n this._currentImage.setOpacity(this.options.opacity);\n } else {\n this._currentImage._map.removeLayer(this._currentImage);\n }\n\n if(oldImage && this._map) {\n this._map.removeLayer(oldImage);\n }\n\n if(oldImage && oldImage._map){\n oldImage._map.removeLayer(oldImage);\n }\n } else {\n this._map.removeLayer(newImage);\n }\n\n this.fire('load', {\n bounds: bounds\n });\n\n }, this);\n\n this.fire('loading', {\n bounds: bounds\n });\n }\n },\n\n _update: function () {\n if(!this._map){\n return;\n }\n\n var zoom = this._map.getZoom();\n var bounds = this._map.getBounds();\n\n if(this._animatingZoom){\n return;\n }\n\n if (this._map._panTransition && this._map._panTransition._inProgress) {\n return;\n }\n\n if (zoom > this.options.maxZoom || zoom < this.options.minZoom) {\n return;\n }\n var params = this._buildExportParams();\n\n this._requestExport(params, bounds);\n },\n\n // TODO: refactor these into raster layer\n _renderPopup: function(latlng, error, results, response){\n latlng = L.latLng(latlng);\n if(this._shouldRenderPopup && this._lastClick.equals(latlng)){\n //add the popup to the map where the mouse was clicked at\n var content = this._popupFunction(error, results, response);\n if (content) {\n this._popup.setLatLng(latlng).setContent(content).openOn(this._map);\n }\n }\n },\n\n _resetPopupState: function(e){\n this._shouldRenderPopup = false;\n this._lastClick = e.latlng;\n },\n\n // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js\n // @TODO remove at Leaflet 0.8\n _propagateEvent: function (e) {\n e = L.extend({\n layer: e.target,\n target: this\n }, e);\n this.fire(e.type, e);\n }\n});","EsriLeaflet.Layers.ImageMapLayer = EsriLeaflet.Layers.RasterLayer.extend({\n\n options: {\n updateInterval: 150,\n format: 'jpgpng'\n },\n\n query: function(){\n return this._service.query();\n },\n\n identify: function(){\n return this._service.identify();\n },\n\n initialize: function (url, options) {\n options = options || {};\n options.url = EsriLeaflet.Util.cleanUrl(url);\n this._service = new EsriLeaflet.Services.ImageService(options);\n this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);\n L.Util.setOptions(this, options);\n },\n\n setPixelType: function (pixelType) {\n this.options.pixelType = pixelType;\n this._update();\n return this;\n },\n\n getPixelType: function () {\n return this.options.pixelType;\n },\n\n setBandIds: function (bandIds) {\n if (L.Util.isArray(bandIds)) {\n this.options.bandIds = bandIds.join(',');\n } else {\n this.options.bandIds = bandIds.toString();\n }\n this._update();\n return this;\n },\n\n getBandIds: function () {\n return this.options.bandIds;\n },\n\n setNoData: function (noData, noDataInterpretation) {\n if (L.Util.isArray(noData)) {\n this.options.noData = noData.join(',');\n } else {\n this.options.noData = noData.toString();\n }\n if (noDataInterpretation) {\n this.options.noDataInterpretation = noDataInterpretation;\n }\n this._update();\n return this;\n },\n\n getNoData: function () {\n return this.options.noData;\n },\n\n getNoDataInterpretation: function () {\n return this.options.noDataInterpretation;\n },\n\n setRenderingRule: function(renderingRule) {\n this.options.renderingRule = renderingRule;\n this._update();\n },\n\n getRenderingRule: function() {\n return this.options.renderingRule;\n },\n\n setMosaicRule: function(mosaicRule) {\n this.options.mosaicRule = mosaicRule;\n this._update();\n },\n\n getMosaicRule: function() {\n return this.options.mosaicRule;\n },\n\n _getPopupData: function(e){\n var callback = L.Util.bind(function(error, results, response) {\n setTimeout(L.Util.bind(function(){\n this._renderPopup(e.latlng, error, results, response);\n }, this), 300);\n }, this);\n\n var identifyRequest = this.identify().at(e.latlng);\n\n // set mosaic rule for identify task if it is set for layer\n if (this.options.mosaicRule) {\n identifyRequest.setMosaicRule(this.options.mosaicRule);\n // @TODO: force return catalog items too?\n }\n\n // @TODO: set rendering rule? Not sure,\n // sometimes you want raw pixel values\n // if (this.options.renderingRule) {\n // identifyRequest.setRenderingRule(this.options.renderingRule);\n // }\n\n identifyRequest.run(callback);\n\n // set the flags to show the popup\n this._shouldRenderPopup = true;\n this._lastClick = e.latlng;\n },\n\n _buildExportParams: function () {\n var bounds = this._map.getBounds();\n var size = this._map.getSize();\n var ne = this._map.options.crs.project(bounds._northEast);\n var sw = this._map.options.crs.project(bounds._southWest);\n\n var params = {\n bbox: [sw.x, sw.y, ne.x, ne.y].join(','),\n size: size.x + ',' + size.y,\n format: this.options.format,\n bboxSR: this.options.bboxSR,\n imageSR: this.options.imageSR\n };\n\n if (this.options.from && this.options.to) {\n params.time = this.options.from.valueOf() + ',' + this.options.to.valueOf();\n }\n\n if (this.options.pixelType) {\n params.pixelType = this.options.pixelType;\n }\n\n if (this.options.interpolation) {\n params.interpolation = this.options.interpolation;\n }\n\n if (this.options.compressionQuality) {\n params.compressionQuality = this.options.compressionQuality;\n }\n\n if (this.options.bandIds) {\n params.bandIds = this.options.bandIds;\n }\n\n if (this.options.noData) {\n params.noData = this.options.noData;\n }\n\n if (this.options.noDataInterpretation) {\n params.noDataInterpretation = this.options.noDataInterpretation;\n }\n\n if (this._service.options.token) {\n params.token = this._service.options.token;\n }\n\n if(this.options.renderingRule) {\n params.renderingRule = JSON.stringify(this.options.renderingRule);\n }\n\n if(this.options.mosaicRule) {\n params.mosaicRule = JSON.stringify(this.options.mosaicRule);\n }\n\n return params;\n },\n\n _requestExport: function (params, bounds) {\n if (this.options.f === 'json') {\n this._service.get('exportImage', params, function(error, response){\n this._renderImage(response.href, bounds);\n }, this);\n } else {\n params.f = 'image';\n this._renderImage(this.options.url + 'exportImage' + L.Util.getParamString(params), bounds);\n }\n }\n});\n\nEsriLeaflet.ImageMapLayer = EsriLeaflet.Layers.ImageMapLayer;\n\nEsriLeaflet.Layers.imageMapLayer = function (url, options) {\n return new EsriLeaflet.Layers.ImageMapLayer(url, options);\n};\n\nEsriLeaflet.imageMapLayer = function (url, options) {\n return new EsriLeaflet.Layers.ImageMapLayer(url, options);\n};"]}
\ No newline at end of file
diff --git a/dist/builds/image-service/esri-leaflet-image-service.js b/dist/builds/image-service/esri-leaflet-image-service.js
new file mode 100644
index 000000000..6a95247fa
--- /dev/null
+++ b/dist/builds/image-service/esri-leaflet-image-service.js
@@ -0,0 +1,24 @@
+/*! esri-leaflet - v1.0.0-rc.6 - 2015-03-05
+* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
+* Apache License*/
+(function (factory) {
+ //define an AMD module that relies on 'leaflet'
+ if (typeof define === 'function' && define.amd) {
+ define(['leaflet'], function (L) {
+ return factory(L);
+ });
+ //define a common js module that relies on 'leaflet'
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ module.exports = factory(require('leaflet'));
+ }
+
+ if(typeof window !== 'undefined' && window.L){
+ factory(window.L);
+ }
+}(function (L) {
+
+var EsriLeaflet={VERSION:"1.0.0-rc.5",Layers:{},Services:{},Controls:{},Tasks:{},Util:{},Support:{CORS:!!(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),pointerEvents:""===document.documentElement.style.pointerEvents}};"undefined"!=typeof window&&window.L&&(window.L.esri=EsriLeaflet),function(a){function b(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function c(a,b){for(var c=0;cd;d++)b=a[d+1],c+=(b[0]-f[0])*(b[1]+f[1]),f=b;return c>=0}function f(a,b,c,d){var e=(d[0]-c[0])*(a[1]-c[1])-(d[1]-c[1])*(a[0]-c[0]),f=(b[0]-a[0])*(a[1]-c[1])-(b[1]-a[1])*(a[0]-c[0]),g=(d[1]-c[1])*(b[0]-a[0])-(d[0]-c[0])*(b[1]-a[1]);if(0!==g){var h=e/g,i=f/g;if(h>=0&&1>=h&&i>=0&&1>=i)return!0}return!1}function g(a,b){for(var c=0;c=0;b--)if(c=h[b][0],i(c,f)){h[b].push(f),o=!0;break}o||n.push(f)}for(;n.length;){f=n.pop();var p=!1;for(b=h.length-1;b>=0;b--)if(c=h[b][0],g(c,f)){h[b].push(f),p=!0;break}p||h.push([f.reverse()])}return 1===h.length?{type:"Polygon",coordinates:h[0]}:{type:"MultiPolygon",coordinates:h}}function k(a){var b=[],c=a.slice(0),f=d(c.shift().slice(0));if(f.length>=4){e(f)||f.reverse(),b.push(f);for(var g=0;g=4&&(e(h)&&h.reverse(),b.push(h))}}return b}function l(a){for(var b=[],c=0;c=0;e--){var f=d[e].slice(0);b.push(f)}return b}var m=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(a){return window.setTimeout(a,1e3/60)};a.Util.extentToBounds=function(a){var b=new L.LatLng(a.ymin,a.xmin),c=new L.LatLng(a.ymax,a.xmax);return new L.LatLngBounds(b,c)},a.Util.boundsToExtent=function(a){return a=L.latLngBounds(a),{xmin:a.getSouthWest().lng,ymin:a.getSouthWest().lat,xmax:a.getNorthEast().lng,ymax:a.getNorthEast().lat,spatialReference:{wkid:4326}}},a.Util.arcgisToGeojson=function(c,d){var e={};return"number"==typeof c.x&&"number"==typeof c.y&&(e.type="Point",e.coordinates=[c.x,c.y]),c.points&&(e.type="MultiPoint",e.coordinates=c.points.slice(0)),c.paths&&(1===c.paths.length?(e.type="LineString",e.coordinates=c.paths[0].slice(0)):(e.type="MultiLineString",e.coordinates=c.paths.slice(0))),c.rings&&(e=j(c.rings.slice(0))),(c.geometry||c.attributes)&&(e.type="Feature",e.geometry=c.geometry?a.Util.arcgisToGeojson(c.geometry):null,e.properties=c.attributes?b(c.attributes):null,c.attributes&&(e.id=c.attributes[d]||c.attributes.OBJECTID||c.attributes.FID)),e},a.Util.geojsonToArcGIS=function(c,d){d=d||"OBJECTID";var e,f={wkid:4326},g={};switch(c.type){case"Point":g.x=c.coordinates[0],g.y=c.coordinates[1],g.spatialReference=f;break;case"MultiPoint":g.points=c.coordinates.slice(0),g.spatialReference=f;break;case"LineString":g.paths=[c.coordinates.slice(0)],g.spatialReference=f;break;case"MultiLineString":g.paths=c.coordinates.slice(0),g.spatialReference=f;break;case"Polygon":g.rings=k(c.coordinates.slice(0)),g.spatialReference=f;break;case"MultiPolygon":g.rings=l(c.coordinates.slice(0)),g.spatialReference=f;break;case"Feature":c.geometry&&(g.geometry=a.Util.geojsonToArcGIS(c.geometry,d)),g.attributes=c.properties?b(c.properties):{},c.id&&(g.attributes[d]=c.id);break;case"FeatureCollection":for(g=[],e=0;e=0;h--)f.features.push(a.Util.arcgisToGeojson(g[h],d));return f},a.Util.cleanUrl=function(a){return a=a.replace(/\s\s*/g,""),"/"!==a[a.length-1]&&(a+="/"),a},a.Util.isArcgisOnline=function(a){return/\.arcgis\.com/g.test(a)},a.Util.geojsonTypeToArcGIS=function(a){var b;switch(a){case"Point":b="esriGeometryPoint";break;case"MultiPoint":b="esriGeometryMultipoint";break;case"LineString":b="esriGeometryPolyline";break;case"MultiLineString":b="esriGeometryPolyline";break;case"Polygon":b="esriGeometryPolygon";break;case"MultiPolygon":b="esriGeometryPolygon"}return b},a.Util.requestAnimationFrame=L.Util.bind(m,window)}(EsriLeaflet),function(a){function b(a){var b="";a.f=a.f||"json";for(var c in a)if(a.hasOwnProperty(c)){var d,e=a[c],f=Object.prototype.toString.call(e);b.length&&(b+="&"),d="[object Array]"===f?"[object Object]"===Object.prototype.toString.call(e[0])?JSON.stringify(e):e.join(","):"[object Object]"===f?JSON.stringify(e):"[object Date]"===f?e.valueOf():e,b+=encodeURIComponent(c)+"="+encodeURIComponent(d)}return b}function c(a,b){var c=new XMLHttpRequest;return c.onerror=function(){c.onreadystatechange=L.Util.falseFn,a.call(b,{error:{code:500,message:"XMLHttpRequest error"}},null)},c.onreadystatechange=function(){var d,e;if(4===c.readyState){try{d=JSON.parse(c.responseText)}catch(f){d=null,e={code:500,message:"Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error."}}!e&&d.error&&(e=d.error,d=null),c.onerror=L.Util.falseFn,a.call(b,e,d)}},c}var d=0;window._EsriLeafletCallbacks={},a.Request={request:function(a,d,e,f){var g=b(d),h=c(e,f),i=(a+"?"+g).length;if(2e3>=i&&L.esri.Support.CORS)h.open("GET",a+"?"+g),h.send(null);else if(i>2e3&&L.esri.Support.CORS)h.open("POST",a),h.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),h.send(g);else{if(2e3>=i&&!L.esri.Support.CORS)return L.esri.Request.get.JSONP(a,d,e,f);if(console&&console.warn)return void console.warn("a request to "+a+" was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html")}return h},post:{XMLHTTP:function(a,d,e,f){var g=c(e,f);return g.open("POST",a),g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),g.send(b(d)),g}},get:{CORS:function(a,d,e,f){var g=c(e,f);return g.open("GET",a+"?"+b(d),!0),g.send(null),g},JSONP:function(a,c,e,f){var g="c"+d;c.callback="window._EsriLeafletCallbacks."+g;var h=L.DomUtil.create("script",null,document.body);return h.type="text/javascript",h.src=a+"?"+b(c),h.id=g,window._EsriLeafletCallbacks[g]=function(a){if(window._EsriLeafletCallbacks[g]!==!0){var b,c=Object.prototype.toString.call(a);"[object Object]"!==c&&"[object Array]"!==c&&(b={error:{code:500,message:"Expected array or object as JSONP response"}},a=null),!b&&a.error&&(b=a,a=null),e.call(f,b,a),window._EsriLeafletCallbacks[g]=!0}},d++,{id:g,url:h.src,abort:function(){window._EsriLeafletCallbacks._callback[g]({code:0,message:"Request aborted."})}}}}},a.get=a.Support.CORS?a.Request.get.CORS:a.Request.get.JSONP,a.post=a.Request.post.XMLHTTP,a.request=a.Request.request}(EsriLeaflet),EsriLeaflet.Services.Service=L.Class.extend({includes:L.Mixin.Events,options:{proxy:!1,useCors:EsriLeaflet.Support.CORS},initialize:function(a){a=a||{},this._requestQueue=[],this._authenticating=!1,L.Util.setOptions(this,a),this.options.url=EsriLeaflet.Util.cleanUrl(this.options.url)},get:function(a,b,c,d){return this._request("get",a,b,c,d)},post:function(a,b,c,d){return this._request("post",a,b,c,d)},request:function(a,b,c,d){return this._request("request",a,b,c,d)},metadata:function(a,b){return this._request("get","",{},a,b)},authenticate:function(a){return this._authenticating=!1,this.options.token=a,this._runQueue(),this},_request:function(a,b,c,d,e){this.fire("requeststart",{url:this.options.url+b,params:c,method:a});var f=this._createServiceCallback(a,b,c,d,e);if(this.options.token&&(c.token=this.options.token),this._authenticating)return void this._requestQueue.push([a,b,c,d,e]);var g=this.options.proxy?this.options.proxy+"?"+this.options.url+b:this.options.url+b;return"get"!==a&&"request"!==a||this.options.useCors?EsriLeaflet[a](g,c,f):EsriLeaflet.Request.get.JSONP(g,c,f)},_createServiceCallback:function(a,b,c,d,e){var f=[a,b,c,d,e];return L.Util.bind(function(g,h){!g||499!==g.code&&498!==g.code?(d.call(e,g,h),g?this.fire("requesterror",{url:this.options.url+b,params:c,message:g.message,code:g.code,method:a}):this.fire("requestsuccess",{url:this.options.url+b,params:c,response:h,method:a}),this.fire("requestend",{url:this.options.url+b,params:c,method:a})):(this._authenticating=!0,this._requestQueue.push(f),this.fire("authenticationrequired",{authenticate:L.Util.bind(this.authenticate,this)}))},this)},_runQueue:function(){for(var a=this._requestQueue.length-1;a>=0;a--){var b=this._requestQueue[a],c=b.shift();this[c].apply(this,b)}this._requestQueue=[]}}),EsriLeaflet.Services.service=function(a){return new EsriLeaflet.Services.Service(a)},EsriLeaflet.Services.ImageService=EsriLeaflet.Services.Service.extend({query:function(){return new EsriLeaflet.Tasks.Query(this)},identify:function(){return new EsriLeaflet.Tasks.IdentifyImage(this)}}),EsriLeaflet.Services.imageService=function(a){return new EsriLeaflet.Services.ImageService(a)},EsriLeaflet.Tasks.Task=L.Class.extend({options:{proxy:!1,useCors:EsriLeaflet.Support.CORS},generateSetter:function(a,b){return L.Util.bind(function(b){return this.params[a]=b,this},b)},initialize:function(a){if(a.request&&a.options?(this._service=a,L.Util.setOptions(this,a.options)):(L.Util.setOptions(this,a),this.options.url=L.esri.Util.cleanUrl(a.url)),this.params=L.Util.extend({},this.params||{}),this.setters)for(var b in this.setters){var c=this.setters[b];this[b]=this.generateSetter(c,this)}},token:function(a){return this._service?this._service.authenticate(a):this.params.token=a,this},request:function(a,b){return this._service?this._service.request(this.path,this.params,a,b):this._request("request",this.path,this.params,a,b)},_request:function(a,b,c,d,e){var f=this.options.proxy?this.options.proxy+"?"+this.options.url+b:this.options.url+b;return"get"!==a&&"request"!==a||this.options.useCors?EsriLeaflet[a](f,c,d,e):EsriLeaflet.Request.get.JSONP(f,c,d,e)}}),EsriLeaflet.Tasks.Query=EsriLeaflet.Tasks.Task.extend({setters:{offset:"offset",limit:"limit",fields:"outFields",precision:"geometryPrecision",featureIds:"objectIds",returnGeometry:"returnGeometry",token:"token"},path:"query",params:{returnGeometry:!0,where:"1=1",outSr:4326,outFields:"*"},within:function(a){return this._setGeometry(a),this.params.spatialRel="esriSpatialRelContains",this},intersects:function(a){return this._setGeometry(a),this.params.spatialRel="esriSpatialRelIntersects",this},contains:function(a){return this._setGeometry(a),this.params.spatialRel="esriSpatialRelWithin",this},overlaps:function(a){return this._setGeometry(a),this.params.spatialRel="esriSpatialRelOverlaps",this},nearby:function(a,b){return a=L.latLng(a),this.params.geometry=[a.lng,a.lat],this.params.geometryType="esriGeometryPoint",this.params.spatialRel="esriSpatialRelIntersects",this.params.units="esriSRUnit_Meter",this.params.distance=b,this.params.inSr=4326,this},where:function(a){return this.params.where=a.replace(/"/g,"'"),this},between:function(a,b){return this.params.time=[a.valueOf(),b.valueOf()],this},simplify:function(a,b){var c=Math.abs(a.getBounds().getWest()-a.getBounds().getEast());return this.params.maxAllowableOffset=c/a.getSize().y*b,this},orderBy:function(a,b){return b=b||"ASC",this.params.orderByFields=this.params.orderByFields?this.params.orderByFields+",":"",this.params.orderByFields+=[a,b].join(" "),this},run:function(a,b){return this._cleanParams(),EsriLeaflet.Util.isArcgisOnline(this.options.url)?(this.params.f="geojson",this.request(function(c,d){a.call(b,c,d,d)},b)):this.request(function(c,d){a.call(b,c,d&&EsriLeaflet.Util.responseToFeatureCollection(d),d)},b)},count:function(a,b){return this._cleanParams(),this.params.returnCountOnly=!0,this.request(function(b,c){a.call(this,b,c&&c.count,c)},b)},ids:function(a,b){return this._cleanParams(),this.params.returnIdsOnly=!0,this.request(function(b,c){a.call(this,b,c&&c.objectIds,c)},b)},bounds:function(a,b){return this._cleanParams(),this.params.returnExtentOnly=!0,this.request(function(c,d){a.call(b,c,d&&d.extent&&EsriLeaflet.Util.extentToBounds(d.extent),d)},b)},pixelSize:function(a){return a=L.point(a),this.params.pixelSize=[a.x,a.y],this},layer:function(a){return this.path=a+"/query",this},_cleanParams:function(){delete this.params.returnIdsOnly,delete this.params.returnExtentOnly,delete this.params.returnCountOnly},_setGeometry:function(a){return this.params.inSr=4326,a instanceof L.LatLngBounds?(this.params.geometry=EsriLeaflet.Util.boundsToExtent(a),void(this.params.geometryType="esriGeometryEnvelope")):(a.getLatLng&&(a=a.getLatLng()),a instanceof L.LatLng&&(a={type:"Point",coordinates:[a.lng,a.lat]}),a instanceof L.GeoJSON&&(a=a.getLayers()[0].feature.geometry,this.params.geometry=EsriLeaflet.Util.geojsonToArcGIS(a),this.params.geometryType=EsriLeaflet.Util.geojsonTypeToArcGIS(a.type)),a.toGeoJSON&&(a=a.toGeoJSON()),"Feature"===a.type&&(a=a.geometry),"Point"===a.type||"LineString"===a.type||"Polygon"===a.type?(this.params.geometry=EsriLeaflet.Util.geojsonToArcGIS(a),void(this.params.geometryType=EsriLeaflet.Util.geojsonTypeToArcGIS(a.type))):void(console&&console.warn&&console.warn("invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object")))}}),EsriLeaflet.Tasks.query=function(a){return new EsriLeaflet.Tasks.Query(a)},EsriLeaflet.Tasks.Identify=EsriLeaflet.Tasks.Task.extend({path:"identify",between:function(a,b){return this.params.time=[a.valueOf(),b.valueOf()],this}}),EsriLeaflet.Layers.RasterLayer=L.Class.extend({includes:L.Mixin.Events,options:{opacity:1,position:"front",f:"image"},onAdd:function(a){if(this._map=a,this._update=L.Util.limitExecByInterval(this._update,this.options.updateInterval,this),a.options.crs&&a.options.crs.code){var b=a.options.crs.code.split(":")[1];this.options.bboxSR=b,this.options.imageSR=b}a.on("moveend",this._update,this),this._currentImage&&this._currentImage._bounds.equals(this._map.getBounds())?a.addLayer(this._currentImage):this._currentImage&&(this._map.removeLayer(this._currentImage),this._currentImage=null),this._update(),this._popup&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this))},bindPopup:function(a,b){return this._shouldRenderPopup=!1,this._lastClick=!1,this._popup=L.popup(b),this._popupFunction=a,this._map&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this)),this},unbindPopup:function(){return this._map&&(this._map.closePopup(this._popup),this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this)),this._popup=!1,this},onRemove:function(){this._currentImage&&this._map.removeLayer(this._currentImage),this._popup&&(this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this)),this._map.off("moveend",this._update,this),this._map=null},addTo:function(a){return a.addLayer(this),this},removeFrom:function(a){return a.removeLayer(this),this},bringToFront:function(){return this.options.position="front",this._currentImage&&this._currentImage.bringToFront(),this},bringToBack:function(){return this.options.position="back",this._currentImage&&this._currentImage.bringToBack(),this},getAttribution:function(){return this.options.attribution},getOpacity:function(){return this.options.opacity},setOpacity:function(a){return this.options.opacity=a,this._currentImage.setOpacity(a),this},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(a,b){return this.options.from=a,this.options.to=b,this._update(),this},metadata:function(a,b){return this._service.metadata(a,b),this},authenticate:function(a){return this._service.authenticate(a),this},_renderImage:function(a,b){if(this._map){var c=new L.ImageOverlay(a,b,{opacity:0}).addTo(this._map);c.once("load",function(a){var c=a.target,d=this._currentImage;c._bounds.equals(b)?(this._currentImage=c,"front"===this.options.position?this.bringToFront():this.bringToBack(),this._map&&this._currentImage._map?this._currentImage.setOpacity(this.options.opacity):this._currentImage._map.removeLayer(this._currentImage),d&&this._map&&this._map.removeLayer(d),d&&d._map&&d._map.removeLayer(d)):this._map.removeLayer(c),this.fire("load",{bounds:b})},this),this.fire("loading",{bounds:b})}},_update:function(){if(this._map){var a=this._map.getZoom(),b=this._map.getBounds();if(!this._animatingZoom&&!(this._map._panTransition&&this._map._panTransition._inProgress||a>this.options.maxZoom||a= 0);\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L504-L519\n function vertexIntersectsVertex(a1, a2, b1, b2) {\n var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);\n var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);\n var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);\n\n if ( uB !== 0 ) {\n var ua = uaT / uB;\n var ub = ubT / uB;\n\n if ( 0 <= ua && ua <= 1 && 0 <= ub && ub <= 1 ) {\n return true;\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L521-L531\n function arrayIntersectsArray(a, b) {\n for (var i = 0; i < a.length - 1; i++) {\n for (var j = 0; j < b.length - 1; j++) {\n if (vertexIntersectsVertex(a[i], a[i + 1], b[j], b[j + 1])) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L470-L480\n function coordinatesContainPoint(coordinates, point) {\n var contains = false;\n for(var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {\n if (((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||\n (coordinates[j][1] <= point[1] && point[1] < coordinates[i][1])) &&\n (point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0])) {\n contains = !contains;\n }\n }\n return contains;\n }\n\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L106-L113\n function coordinatesContainCoordinates(outer, inner){\n var intersects = arrayIntersectsArray(outer, inner);\n var contains = coordinatesContainPoint(outer, inner[0]);\n if(!intersects && contains){\n return true;\n }\n return false;\n }\n\n // do any polygons in this array contain any other polygons in this array?\n // used for checking for holes in arcgis rings\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L117-L172\n function convertRingsToGeoJSON(rings){\n var outerRings = [];\n var holes = [];\n var x; // iterator\n var outerRing; // current outer ring being evaluated\n var hole; // current hole being evaluated\n\n // for each ring\n for (var r = 0; r < rings.length; r++) {\n var ring = closeRing(rings[r].slice(0));\n if(ring.length < 4){\n continue;\n }\n // is this ring an outer ring? is it clockwise?\n if(ringIsClockwise(ring)){\n var polygon = [ ring ];\n outerRings.push(polygon); // push to outer rings\n } else {\n holes.push(ring); // counterclockwise push to holes\n }\n }\n\n var uncontainedHoles = [];\n\n // while there are holes left...\n while(holes.length){\n // pop a hole off out stack\n hole = holes.pop();\n\n // loop over all outer rings and see if they contain our hole.\n var contained = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(coordinatesContainCoordinates(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n contained = true;\n break;\n }\n }\n\n // ring is not contained in any outer ring\n // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320\n if(!contained){\n uncontainedHoles.push(hole);\n }\n }\n\n // if we couldn't match any holes using contains we can try intersects...\n while(uncontainedHoles.length){\n // pop a hole off out stack\n hole = uncontainedHoles.pop();\n\n // loop over all outer rings and see if any intersect our hole.\n var intersects = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(arrayIntersectsArray(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n intersects = true;\n break;\n }\n }\n\n if(!intersects) {\n outerRings.push([hole.reverse()]);\n }\n }\n\n if(outerRings.length === 1){\n return {\n type: 'Polygon',\n coordinates: outerRings[0]\n };\n } else {\n return {\n type: 'MultiPolygon',\n coordinates: outerRings\n };\n }\n }\n\n // This function ensures that rings are oriented in the right directions\n // outer rings are clockwise, holes are counterclockwise\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function orientRings(poly){\n var output = [];\n var polygon = poly.slice(0);\n var outerRing = closeRing(polygon.shift().slice(0));\n if(outerRing.length >= 4){\n if(!ringIsClockwise(outerRing)){\n outerRing.reverse();\n }\n\n output.push(outerRing);\n\n for (var i = 0; i < polygon.length; i++) {\n var hole = closeRing(polygon[i].slice(0));\n if(hole.length >= 4){\n if(ringIsClockwise(hole)){\n hole.reverse();\n }\n output.push(hole);\n }\n }\n }\n\n return output;\n }\n\n // This function flattens holes in multipolygons to one array of polygons\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function flattenMultiPolygonRings(rings){\n var output = [];\n for (var i = 0; i < rings.length; i++) {\n var polygon = orientRings(rings[i]);\n for (var x = polygon.length - 1; x >= 0; x--) {\n var ring = polygon[x].slice(0);\n output.push(ring);\n }\n }\n return output;\n }\n\n // convert an extent (ArcGIS) to LatLngBounds (Leaflet)\n EsriLeaflet.Util.extentToBounds = function(extent){\n var sw = new L.LatLng(extent.ymin, extent.xmin);\n var ne = new L.LatLng(extent.ymax, extent.xmax);\n return new L.LatLngBounds(sw, ne);\n };\n\n // convert an LatLngBounds (Leaflet) to extent (ArcGIS)\n EsriLeaflet.Util.boundsToExtent = function(bounds) {\n bounds = L.latLngBounds(bounds);\n return {\n 'xmin': bounds.getSouthWest().lng,\n 'ymin': bounds.getSouthWest().lat,\n 'xmax': bounds.getNorthEast().lng,\n 'ymax': bounds.getNorthEast().lat,\n 'spatialReference': {\n 'wkid' : 4326\n }\n };\n };\n\n EsriLeaflet.Util.arcgisToGeojson = function (arcgis, idAttribute){\n var geojson = {};\n\n if(typeof arcgis.x === 'number' && typeof arcgis.y === 'number'){\n geojson.type = 'Point';\n geojson.coordinates = [arcgis.x, arcgis.y];\n }\n\n if(arcgis.points){\n geojson.type = 'MultiPoint';\n geojson.coordinates = arcgis.points.slice(0);\n }\n\n if(arcgis.paths) {\n if(arcgis.paths.length === 1){\n geojson.type = 'LineString';\n geojson.coordinates = arcgis.paths[0].slice(0);\n } else {\n geojson.type = 'MultiLineString';\n geojson.coordinates = arcgis.paths.slice(0);\n }\n }\n\n if(arcgis.rings) {\n geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));\n }\n\n if(arcgis.geometry || arcgis.attributes) {\n geojson.type = 'Feature';\n geojson.geometry = (arcgis.geometry) ? EsriLeaflet.Util.arcgisToGeojson(arcgis.geometry) : null;\n geojson.properties = (arcgis.attributes) ? clone(arcgis.attributes) : null;\n if(arcgis.attributes) {\n geojson.id = arcgis.attributes[idAttribute] || arcgis.attributes.OBJECTID || arcgis.attributes.FID;\n }\n }\n\n return geojson;\n };\n\n // GeoJSON -> ArcGIS\n EsriLeaflet.Util.geojsonToArcGIS = function(geojson, idAttribute){\n idAttribute = idAttribute || 'OBJECTID';\n var spatialReference = { wkid: 4326 };\n var result = {};\n var i;\n\n switch(geojson.type){\n case 'Point':\n result.x = geojson.coordinates[0];\n result.y = geojson.coordinates[1];\n result.spatialReference = spatialReference;\n break;\n case 'MultiPoint':\n result.points = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'LineString':\n result.paths = [geojson.coordinates.slice(0)];\n result.spatialReference = spatialReference;\n break;\n case 'MultiLineString':\n result.paths = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'Polygon':\n result.rings = orientRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'MultiPolygon':\n result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'Feature':\n if(geojson.geometry) {\n result.geometry = EsriLeaflet.Util.geojsonToArcGIS(geojson.geometry, idAttribute);\n }\n result.attributes = (geojson.properties) ? clone(geojson.properties) : {};\n if(geojson.id){\n result.attributes[idAttribute] = geojson.id;\n }\n break;\n case 'FeatureCollection':\n result = [];\n for (i = 0; i < geojson.features.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.features[i], idAttribute));\n }\n break;\n case 'GeometryCollection':\n result = [];\n for (i = 0; i < geojson.geometries.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.geometries[i], idAttribute));\n }\n break;\n }\n\n return result;\n };\n\n EsriLeaflet.Util.responseToFeatureCollection = function(response, idAttribute){\n var objectIdField;\n\n if(idAttribute){\n objectIdField = idAttribute;\n } else if(response.objectIdFieldName){\n objectIdField = response.objectIdFieldName;\n } else if(response.fields) {\n for (var j = 0; j <= response.fields.length - 1; j++) {\n if(response.fields[j].type === 'esriFieldTypeOID') {\n objectIdField = response.fields[j].name;\n break;\n }\n }\n } else {\n objectIdField = 'OBJECTID';\n }\n\n var featureCollection = {\n type: 'FeatureCollection',\n features: []\n };\n var features = response.features || response.results;\n if(features.length){\n for (var i = features.length - 1; i >= 0; i--) {\n featureCollection.features.push(EsriLeaflet.Util.arcgisToGeojson(features[i], objectIdField));\n }\n }\n\n return featureCollection;\n };\n\n // trim whitespace and add a tailing slash is needed to a url\n EsriLeaflet.Util.cleanUrl = function(url){\n url = url.replace(/\\s\\s*/g, '');\n\n //add a trailing slash to the url if the user omitted it\n if(url[url.length-1] !== '/'){\n url += '/';\n }\n\n return url;\n };\n\n EsriLeaflet.Util.isArcgisOnline = function(url){\n return (/\\.arcgis\\.com/g).test(url);\n };\n\n EsriLeaflet.Util.geojsonTypeToArcGIS = function (geoJsonType) {\n var arcgisGeometryType;\n switch (geoJsonType) {\n case 'Point':\n arcgisGeometryType = 'esriGeometryPoint';\n break;\n case 'MultiPoint':\n arcgisGeometryType = 'esriGeometryMultipoint';\n break;\n case 'LineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'MultiLineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'Polygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n case 'MultiPolygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n }\n return arcgisGeometryType;\n };\n\n EsriLeaflet.Util.requestAnimationFrame = L.Util.bind(raf, window);\n\n})(EsriLeaflet);","(function(EsriLeaflet){\n\n var callbacks = 0;\n\n window._EsriLeafletCallbacks = {};\n\n function serialize(params){\n var data = '';\n\n params.f = params.f || 'json';\n\n for (var key in params){\n if(params.hasOwnProperty(key)){\n var param = params[key];\n var type = Object.prototype.toString.call(param);\n var value;\n\n if(data.length){\n data += '&';\n }\n\n if (type === '[object Array]'){\n value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');\n } else if (type === '[object Object]') {\n value = JSON.stringify(param);\n } else if (type === '[object Date]'){\n value = param.valueOf();\n } else {\n value = param;\n }\n\n data += encodeURIComponent(key) + '=' + encodeURIComponent(value);\n }\n }\n\n return data;\n }\n\n function createRequest(callback, context){\n var httpRequest = new XMLHttpRequest();\n\n httpRequest.onerror = function(e) {\n httpRequest.onreadystatechange = L.Util.falseFn;\n\n callback.call(context, {\n error: {\n code: 500,\n message: 'XMLHttpRequest error'\n }\n }, null);\n };\n\n httpRequest.onreadystatechange = function(){\n var response;\n var error;\n\n if (httpRequest.readyState === 4) {\n try {\n response = JSON.parse(httpRequest.responseText);\n } catch(e) {\n response = null;\n error = {\n code: 500,\n message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'\n };\n }\n\n if (!error && response.error) {\n error = response.error;\n response = null;\n }\n\n httpRequest.onerror = L.Util.falseFn;\n\n callback.call(context, error, response);\n }\n };\n\n return httpRequest;\n }\n\n // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)\n EsriLeaflet.Request = {\n request: function(url, params, callback, context){\n var paramString = serialize(params);\n var httpRequest = createRequest(callback, context);\n var requestLength = (url + '?' + paramString).length;\n\n // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest\n if(requestLength <= 2000 && L.esri.Support.CORS){\n httpRequest.open('GET', url + '?' + paramString);\n httpRequest.send(null);\n\n // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest\n } else if (requestLength > 2000 && L.esri.Support.CORS){\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(paramString);\n\n // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request\n } else if(requestLength <= 2000 && !L.esri.Support.CORS){\n return L.esri.Request.get.JSONP(url, params, callback, context);\n\n // request is longer then 2000 characters and the browser does not support CORS, log a warning\n } else {\n if(console && console.warn){\n console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');\n return;\n }\n }\n\n return httpRequest;\n },\n post: {\n XMLHTTP: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(serialize(params));\n\n return httpRequest;\n }\n },\n\n get: {\n CORS: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n\n httpRequest.open('GET', url + '?' + serialize(params), true);\n httpRequest.send(null);\n\n return httpRequest;\n },\n JSONP: function(url, params, callback, context){\n var callbackId = 'c' + callbacks;\n\n params.callback = 'window._EsriLeafletCallbacks.' + callbackId;\n\n var script = L.DomUtil.create('script', null, document.body);\n script.type = 'text/javascript';\n script.src = url + '?' + serialize(params);\n script.id = callbackId;\n\n window._EsriLeafletCallbacks[callbackId] = function(response){\n if(window._EsriLeafletCallbacks[callbackId] !== true){\n var error;\n var responseType = Object.prototype.toString.call(response);\n\n if(!(responseType === '[object Object]' || responseType === '[object Array]')){\n error = {\n error: {\n code: 500,\n message: 'Expected array or object as JSONP response'\n }\n };\n response = null;\n }\n\n if (!error && response.error) {\n error = response;\n response = null;\n }\n\n callback.call(context, error, response);\n window._EsriLeafletCallbacks[callbackId] = true;\n }\n };\n\n callbacks++;\n\n return {\n id: callbackId,\n url: script.src,\n abort: function(){\n window._EsriLeafletCallbacks._callback[callbackId]({\n code: 0,\n message: 'Request aborted.'\n });\n }\n };\n }\n }\n };\n\n // choose the correct AJAX handler depending on CORS support\n EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;\n\n // always use XMLHttpRequest for posts\n EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;\n\n // expose a common request method the uses GET\\POST based on request length\n EsriLeaflet.request = EsriLeaflet.Request.request;\n\n})(EsriLeaflet);","EsriLeaflet.Services.Service = L.Class.extend({\n\n includes: L.Mixin.Events,\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n initialize: function (options) {\n options = options || {};\n this._requestQueue = [];\n this._authenticating = false;\n L.Util.setOptions(this, options);\n this.options.url = EsriLeaflet.Util.cleanUrl(this.options.url);\n },\n\n get: function (path, params, callback, context) {\n return this._request('get', path, params, callback, context);\n },\n\n post: function (path, params, callback, context) {\n return this._request('post', path, params, callback, context);\n },\n\n request: function (path, params, callback, context) {\n return this._request('request', path, params, callback, context);\n },\n\n metadata: function (callback, context) {\n return this._request('get', '', {}, callback, context);\n },\n\n authenticate: function(token){\n this._authenticating = false;\n this.options.token = token;\n this._runQueue();\n return this;\n },\n\n _request: function(method, path, params, callback, context){\n this.fire('requeststart', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n\n var wrappedCallback = this._createServiceCallback(method, path, params, callback, context);\n\n if (this.options.token) {\n params.token = this.options.token;\n }\n\n if (this._authenticating) {\n this._requestQueue.push([method, path, params, callback, context]);\n return;\n } else {\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, wrappedCallback);\n } else {\n return EsriLeaflet[method](url, params, wrappedCallback);\n }\n }\n },\n\n _createServiceCallback: function(method, path, params, callback, context){\n var request = [method, path, params, callback, context];\n\n return L.Util.bind(function(error, response){\n\n if (error && (error.code === 499 || error.code === 498)) {\n this._authenticating = true;\n\n this._requestQueue.push(request);\n\n this.fire('authenticationrequired', {\n authenticate: L.Util.bind(this.authenticate, this)\n });\n } else {\n callback.call(context, error, response);\n\n if(error) {\n this.fire('requesterror', {\n url: this.options.url + path,\n params: params,\n message: error.message,\n code: error.code,\n method: method\n });\n } else {\n this.fire('requestsuccess', {\n url: this.options.url + path,\n params: params,\n response: response,\n method: method\n });\n }\n\n this.fire('requestend', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n }\n }, this);\n },\n\n _runQueue: function(){\n for (var i = this._requestQueue.length - 1; i >= 0; i--) {\n var request = this._requestQueue[i];\n var method = request.shift();\n this[method].apply(this, request);\n }\n this._requestQueue = [];\n }\n\n});\n\nEsriLeaflet.Services.service = function(params){\n return new EsriLeaflet.Services.Service(params);\n};","EsriLeaflet.Services.ImageService = EsriLeaflet.Services.Service.extend({\n\n query: function () {\n return new EsriLeaflet.Tasks.Query(this);\n },\n\n identify: function() {\n return new EsriLeaflet.Tasks.IdentifyImage(this);\n }\n});\n\nEsriLeaflet.Services.imageService = function(params){\n return new EsriLeaflet.Services.ImageService(params);\n};","EsriLeaflet.Tasks.Task = L.Class.extend({\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n //Generate a method for each methodName:paramName in the setters for this task.\n generateSetter: function(param, context){\n return L.Util.bind(function(value){\n this.params[param] = value;\n return this;\n }, context);\n },\n\n initialize: function(endpoint){\n // endpoint can be either a url (and options) for an ArcGIS Rest Service or an instance of EsriLeaflet.Service\n if(endpoint.request && endpoint.options){\n this._service = endpoint;\n L.Util.setOptions(this, endpoint.options);\n } else {\n L.Util.setOptions(this, endpoint);\n this.options.url = L.esri.Util.cleanUrl(endpoint.url);\n }\n\n // clone default params into this object\n this.params = L.Util.extend({}, this.params || {});\n\n // generate setter methods based on the setters object implimented a child class\n if(this.setters){\n for (var setter in this.setters){\n var param = this.setters[setter];\n this[setter] = this.generateSetter(param, this);\n }\n }\n },\n\n token: function(token){\n if(this._service){\n this._service.authenticate(token);\n } else {\n this.params.token = token;\n }\n return this;\n },\n\n request: function(callback, context){\n if(this._service){\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n },\n\n _request: function(method, path, params, callback, context){\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, callback, context);\n } else{\n return EsriLeaflet[method](url, params, callback, context);\n }\n }\n});","EsriLeaflet.Tasks.Query = EsriLeaflet.Tasks.Task.extend({\n setters: {\n 'offset': 'offset',\n 'limit': 'limit',\n 'fields': 'outFields',\n 'precision': 'geometryPrecision',\n 'featureIds': 'objectIds',\n 'returnGeometry': 'returnGeometry',\n 'token': 'token'\n },\n\n path: 'query',\n\n params: {\n returnGeometry: true,\n where: '1=1',\n outSr: 4326,\n outFields: '*'\n },\n\n within: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelContains'; // will make code read layer within geometry, to the api this will reads geometry contains layer\n return this;\n },\n\n intersects: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelIntersects';\n return this;\n },\n\n contains: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelWithin'; // will make code read layer contains geometry, to the api this will reads geometry within layer\n return this;\n },\n\n // crosses: function(geometry){\n // this._setGeometry(geometry);\n // this.params.spatialRel = 'esriSpatialRelCrosses';\n // return this;\n // },\n\n // touches: function(geometry){\n // this._setGeometry(geometry);\n // this.params.spatialRel = 'esriSpatialRelTouches';\n // return this;\n // },\n\n overlaps: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelOverlaps';\n return this;\n },\n\n // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online\n nearby: function(latlng, radius){\n latlng = L.latLng(latlng);\n this.params.geometry = [latlng.lng, latlng.lat];\n this.params.geometryType = 'esriGeometryPoint';\n this.params.spatialRel = 'esriSpatialRelIntersects';\n this.params.units = 'esriSRUnit_Meter';\n this.params.distance = radius;\n this.params.inSr = 4326;\n return this;\n },\n\n where: function(string){\n this.params.where = string.replace(/\"/g, \"\\'\"); // jshint ignore:line\n return this;\n },\n\n between: function(start, end){\n this.params.time = [start.valueOf(), end.valueOf()];\n return this;\n },\n\n simplify: function(map, factor){\n var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());\n this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;\n return this;\n },\n\n orderBy: function(fieldName, order){\n order = order || 'ASC';\n this.params.orderByFields = (this.params.orderByFields) ? this.params.orderByFields + ',' : '';\n this.params.orderByFields += ([fieldName, order]).join(' ');\n return this;\n },\n\n run: function(callback, context){\n this._cleanParams();\n\n // if the service is hosted on arcgis online request geojson directly\n if(EsriLeaflet.Util.isArcgisOnline(this.options.url)){\n this.params.f = 'geojson';\n\n return this.request(function(error, response){\n callback.call(context, error, response, response);\n }, context);\n\n // otherwise convert it in the callback then pass it on\n } else {\n return this.request(function(error, response){\n callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);\n }, context);\n }\n },\n\n count: function(callback, context){\n this._cleanParams();\n this.params.returnCountOnly = true;\n return this.request(function(error, response){\n callback.call(this, error, (response && response.count), response);\n }, context);\n },\n\n ids: function(callback, context){\n this._cleanParams();\n this.params.returnIdsOnly = true;\n return this.request(function(error, response){\n callback.call(this, error, (response && response.objectIds), response);\n }, context);\n },\n\n // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online\n bounds: function(callback, context){\n this._cleanParams();\n this.params.returnExtentOnly = true;\n return this.request(function(error, response){\n callback.call(context, error, (response && response.extent && EsriLeaflet.Util.extentToBounds(response.extent)), response);\n }, context);\n },\n\n // only valid for image services\n pixelSize: function(point){\n point = L.point(point);\n this.params.pixelSize = [point.x,point.y];\n return this;\n },\n\n // only valid for map services\n layer: function(layer){\n this.path = layer + '/query';\n return this;\n },\n\n _cleanParams: function(){\n delete this.params.returnIdsOnly;\n delete this.params.returnExtentOnly;\n delete this.params.returnCountOnly;\n },\n\n _setGeometry: function(geometry) {\n this.params.inSr = 4326;\n\n // convert bounds to extent and finish\n if ( geometry instanceof L.LatLngBounds ) {\n // set geometry + geometryType\n this.params.geometry = EsriLeaflet.Util.boundsToExtent(geometry);\n this.params.geometryType = 'esriGeometryEnvelope';\n return;\n }\n\n // convert L.Marker > L.LatLng\n if(geometry.getLatLng){\n geometry = geometry.getLatLng();\n }\n\n // convert L.LatLng to a geojson point and continue;\n if (geometry instanceof L.LatLng) {\n geometry = {\n type: 'Point',\n coordinates: [geometry.lng, geometry.lat]\n };\n }\n\n // handle L.GeoJSON, pull out the first geometry\n if ( geometry instanceof L.GeoJSON ) {\n //reassign geometry to the GeoJSON value (we are assuming that only one feature is present)\n geometry = geometry.getLayers()[0].feature.geometry;\n this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);\n this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);\n }\n\n // Handle L.Polyline and L.Polygon\n if (geometry.toGeoJSON) {\n geometry = geometry.toGeoJSON();\n }\n\n // handle GeoJSON feature by pulling out the geometry\n if ( geometry.type === 'Feature' ) {\n // get the geometry of the geojson feature\n geometry = geometry.geometry;\n }\n\n // confirm that our GeoJSON is a point, line or polygon\n if ( geometry.type === 'Point' || geometry.type === 'LineString' || geometry.type === 'Polygon') {\n this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);\n this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);\n return;\n }\n\n // warn the user if we havn't found a\n /* global console */\n if(console && console.warn) {\n console.warn('invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object');\n }\n\n return;\n }\n});\n\nEsriLeaflet.Tasks.query = function(params){\n return new EsriLeaflet.Tasks.Query(params);\n};","EsriLeaflet.Tasks.Identify = EsriLeaflet.Tasks.Task.extend({\n path: 'identify',\n\n between: function(start, end){\n this.params.time = [start.valueOf(), end.valueOf()];\n return this;\n }\n});\n","EsriLeaflet.Layers.RasterLayer = L.Class.extend({\n includes: L.Mixin.Events,\n\n options: {\n opacity: 1,\n position: 'front',\n f: 'image'\n },\n\n onAdd: function (map) {\n this._map = map;\n\n this._update = L.Util.limitExecByInterval(this._update, this.options.updateInterval, this);\n\n if (map.options.crs && map.options.crs.code) {\n var sr = map.options.crs.code.split(':')[1];\n this.options.bboxSR = sr;\n this.options.imageSR = sr;\n }\n\n map.on('moveend', this._update, this);\n\n // if we had an image loaded and it matches the\n // current bounds show the image otherwise remove it\n if(this._currentImage && this._currentImage._bounds.equals(this._map.getBounds())){\n map.addLayer(this._currentImage);\n } else if(this._currentImage) {\n this._map.removeLayer(this._currentImage);\n this._currentImage = null;\n }\n\n this._update();\n\n if(this._popup){\n this._map.on('click', this._getPopupData, this);\n this._map.on('dblclick', this._resetPopupState, this);\n }\n },\n\n bindPopup: function(fn, popupOptions){\n this._shouldRenderPopup = false;\n this._lastClick = false;\n this._popup = L.popup(popupOptions);\n this._popupFunction = fn;\n if(this._map){\n this._map.on('click', this._getPopupData, this);\n this._map.on('dblclick', this._resetPopupState, this);\n }\n return this;\n },\n\n unbindPopup: function(){\n if(this._map){\n this._map.closePopup(this._popup);\n this._map.off('click', this._getPopupData, this);\n this._map.off('dblclick', this._resetPopupState, this);\n }\n this._popup = false;\n return this;\n },\n\n onRemove: function (map) {\n if (this._currentImage) {\n this._map.removeLayer(this._currentImage);\n }\n\n if(this._popup){\n this._map.off('click', this._getPopupData, this);\n this._map.off('dblclick', this._resetPopupState, this);\n }\n\n this._map.off('moveend', this._update, this);\n this._map = null;\n },\n\n addTo: function(map){\n map.addLayer(this);\n return this;\n },\n\n removeFrom: function(map){\n map.removeLayer(this);\n return this;\n },\n\n bringToFront: function(){\n this.options.position = 'front';\n if(this._currentImage){\n this._currentImage.bringToFront();\n }\n return this;\n },\n\n bringToBack: function(){\n this.options.position = 'back';\n if(this._currentImage){\n this._currentImage.bringToBack();\n }\n return this;\n },\n\n getAttribution: function () {\n return this.options.attribution;\n },\n\n getOpacity: function(){\n return this.options.opacity;\n },\n\n setOpacity: function(opacity){\n this.options.opacity = opacity;\n this._currentImage.setOpacity(opacity);\n return this;\n },\n\n getTimeRange: function(){\n return [this.options.from, this.options.to];\n },\n\n setTimeRange: function(from, to){\n this.options.from = from;\n this.options.to = to;\n this._update();\n return this;\n },\n\n metadata: function(callback, context){\n this._service.metadata(callback, context);\n return this;\n },\n\n authenticate: function(token){\n this._service.authenticate(token);\n return this;\n },\n\n _renderImage: function(url, bounds){\n if(this._map){\n // create a new image overlay and add it to the map\n // to start loading the image\n // opacity is 0 while the image is loading\n var image = new L.ImageOverlay(url, bounds, {\n opacity: 0\n }).addTo(this._map);\n\n // once the image loads\n image.once('load', function(e){\n var newImage = e.target;\n var oldImage = this._currentImage;\n\n // if the bounds of this image matches the bounds that\n // _renderImage was called with and we have a map\n // hide the old image if there is one and set the opacity\n // of the new image otherwise remove the new image\n if(newImage._bounds.equals(bounds)){\n this._currentImage = newImage;\n\n if(this.options.position === 'front'){\n this.bringToFront();\n } else {\n this.bringToBack();\n }\n\n if(this._map && this._currentImage._map){\n this._currentImage.setOpacity(this.options.opacity);\n } else {\n this._currentImage._map.removeLayer(this._currentImage);\n }\n\n if(oldImage && this._map) {\n this._map.removeLayer(oldImage);\n }\n\n if(oldImage && oldImage._map){\n oldImage._map.removeLayer(oldImage);\n }\n } else {\n this._map.removeLayer(newImage);\n }\n\n this.fire('load', {\n bounds: bounds\n });\n\n }, this);\n\n this.fire('loading', {\n bounds: bounds\n });\n }\n },\n\n _update: function () {\n if(!this._map){\n return;\n }\n\n var zoom = this._map.getZoom();\n var bounds = this._map.getBounds();\n\n if(this._animatingZoom){\n return;\n }\n\n if (this._map._panTransition && this._map._panTransition._inProgress) {\n return;\n }\n\n if (zoom > this.options.maxZoom || zoom < this.options.minZoom) {\n return;\n }\n var params = this._buildExportParams();\n\n this._requestExport(params, bounds);\n },\n\n // TODO: refactor these into raster layer\n _renderPopup: function(latlng, error, results, response){\n latlng = L.latLng(latlng);\n if(this._shouldRenderPopup && this._lastClick.equals(latlng)){\n //add the popup to the map where the mouse was clicked at\n var content = this._popupFunction(error, results, response);\n if (content) {\n this._popup.setLatLng(latlng).setContent(content).openOn(this._map);\n }\n }\n },\n\n _resetPopupState: function(e){\n this._shouldRenderPopup = false;\n this._lastClick = e.latlng;\n },\n\n // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js\n // @TODO remove at Leaflet 0.8\n _propagateEvent: function (e) {\n e = L.extend({\n layer: e.target,\n target: this\n }, e);\n this.fire(e.type, e);\n }\n});","EsriLeaflet.Layers.ImageMapLayer = EsriLeaflet.Layers.RasterLayer.extend({\n\n options: {\n updateInterval: 150,\n format: 'jpgpng'\n },\n\n query: function(){\n return this._service.query();\n },\n\n identify: function(){\n return this._service.identify();\n },\n\n initialize: function (url, options) {\n options = options || {};\n options.url = EsriLeaflet.Util.cleanUrl(url);\n this._service = new EsriLeaflet.Services.ImageService(options);\n this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);\n L.Util.setOptions(this, options);\n },\n\n setPixelType: function (pixelType) {\n this.options.pixelType = pixelType;\n this._update();\n return this;\n },\n\n getPixelType: function () {\n return this.options.pixelType;\n },\n\n setBandIds: function (bandIds) {\n if (L.Util.isArray(bandIds)) {\n this.options.bandIds = bandIds.join(',');\n } else {\n this.options.bandIds = bandIds.toString();\n }\n this._update();\n return this;\n },\n\n getBandIds: function () {\n return this.options.bandIds;\n },\n\n setNoData: function (noData, noDataInterpretation) {\n if (L.Util.isArray(noData)) {\n this.options.noData = noData.join(',');\n } else {\n this.options.noData = noData.toString();\n }\n if (noDataInterpretation) {\n this.options.noDataInterpretation = noDataInterpretation;\n }\n this._update();\n return this;\n },\n\n getNoData: function () {\n return this.options.noData;\n },\n\n getNoDataInterpretation: function () {\n return this.options.noDataInterpretation;\n },\n\n setRenderingRule: function(renderingRule) {\n this.options.renderingRule = renderingRule;\n this._update();\n },\n\n getRenderingRule: function() {\n return this.options.renderingRule;\n },\n\n setMosaicRule: function(mosaicRule) {\n this.options.mosaicRule = mosaicRule;\n this._update();\n },\n\n getMosaicRule: function() {\n return this.options.mosaicRule;\n },\n\n _getPopupData: function(e){\n var callback = L.Util.bind(function(error, results, response) {\n setTimeout(L.Util.bind(function(){\n this._renderPopup(e.latlng, error, results, response);\n }, this), 300);\n }, this);\n\n var identifyRequest = this.identify().at(e.latlng);\n\n // set mosaic rule for identify task if it is set for layer\n if (this.options.mosaicRule) {\n identifyRequest.setMosaicRule(this.options.mosaicRule);\n // @TODO: force return catalog items too?\n }\n\n // @TODO: set rendering rule? Not sure,\n // sometimes you want raw pixel values\n // if (this.options.renderingRule) {\n // identifyRequest.setRenderingRule(this.options.renderingRule);\n // }\n\n identifyRequest.run(callback);\n\n // set the flags to show the popup\n this._shouldRenderPopup = true;\n this._lastClick = e.latlng;\n },\n\n _buildExportParams: function () {\n var bounds = this._map.getBounds();\n var size = this._map.getSize();\n var ne = this._map.options.crs.project(bounds._northEast);\n var sw = this._map.options.crs.project(bounds._southWest);\n\n var params = {\n bbox: [sw.x, sw.y, ne.x, ne.y].join(','),\n size: size.x + ',' + size.y,\n format: this.options.format,\n bboxSR: this.options.bboxSR,\n imageSR: this.options.imageSR\n };\n\n if (this.options.from && this.options.to) {\n params.time = this.options.from.valueOf() + ',' + this.options.to.valueOf();\n }\n\n if (this.options.pixelType) {\n params.pixelType = this.options.pixelType;\n }\n\n if (this.options.interpolation) {\n params.interpolation = this.options.interpolation;\n }\n\n if (this.options.compressionQuality) {\n params.compressionQuality = this.options.compressionQuality;\n }\n\n if (this.options.bandIds) {\n params.bandIds = this.options.bandIds;\n }\n\n if (this.options.noData) {\n params.noData = this.options.noData;\n }\n\n if (this.options.noDataInterpretation) {\n params.noDataInterpretation = this.options.noDataInterpretation;\n }\n\n if (this._service.options.token) {\n params.token = this._service.options.token;\n }\n\n if(this.options.renderingRule) {\n params.renderingRule = JSON.stringify(this.options.renderingRule);\n }\n\n if(this.options.mosaicRule) {\n params.mosaicRule = JSON.stringify(this.options.mosaicRule);\n }\n\n return params;\n },\n\n _requestExport: function (params, bounds) {\n if (this.options.f === 'json') {\n this._service.get('exportImage', params, function(error, response){\n this._renderImage(response.href, bounds);\n }, this);\n } else {\n params.f = 'image';\n this._renderImage(this.options.url + 'exportImage' + L.Util.getParamString(params), bounds);\n }\n }\n});\n\nEsriLeaflet.ImageMapLayer = EsriLeaflet.Layers.ImageMapLayer;\n\nEsriLeaflet.Layers.imageMapLayer = function (url, options) {\n return new EsriLeaflet.Layers.ImageMapLayer(url, options);\n};\n\nEsriLeaflet.imageMapLayer = function (url, options) {\n return new EsriLeaflet.Layers.ImageMapLayer(url, options);\n};"]}
\ No newline at end of file
diff --git a/dist/builds/map-service/esri-leaflet-map-service-src.js b/dist/builds/map-service/esri-leaflet-map-service-src.js
new file mode 100644
index 000000000..645f7b393
--- /dev/null
+++ b/dist/builds/map-service/esri-leaflet-map-service-src.js
@@ -0,0 +1,1674 @@
+/*! esri-leaflet - v1.0.0-rc.6 - 2015-03-05
+* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
+* Apache License*/
+(function (factory) {
+ //define an AMD module that relies on 'leaflet'
+ if (typeof define === 'function' && define.amd) {
+ define(['leaflet'], function (L) {
+ return factory(L);
+ });
+ //define a common js module that relies on 'leaflet'
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ module.exports = factory(require('leaflet'));
+ }
+
+ if(typeof window !== 'undefined' && window.L){
+ factory(window.L);
+ }
+}(function (L) {
+var EsriLeaflet = { //jshint ignore:line
+ VERSION: '1.0.0-rc.5',
+ Layers: {},
+ Services: {},
+ Controls: {},
+ Tasks: {},
+ Util: {},
+ Support: {
+ CORS: !!(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()),
+ pointerEvents: document.documentElement.style.pointerEvents === ''
+ }
+};
+
+if(typeof window !== 'undefined' && window.L){
+ window.L.esri = EsriLeaflet;
+}
+
+
+(function(EsriLeaflet){
+
+ // normalize request animation frame
+ var raf = window.requestAnimationFrame ||
+ window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.msRequestAnimationFrame ||
+ function(cb) { return window.setTimeout(cb, 1000 / 60); };
+
+ // shallow object clone for feature properties and attributes
+ // from http://jsperf.com/cloning-an-object/2
+ function clone(obj) {
+ var target = {};
+ for (var i in obj) {
+ if (obj.hasOwnProperty(i)) {
+ target[i] = obj[i];
+ }
+ }
+ return target;
+ }
+
+ // checks if 2 x,y points are equal
+ function pointsEqual(a, b) {
+ for (var i = 0; i < a.length; i++) {
+ if (a[i] !== b[i]) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ // checks if the first and last points of a ring are equal and closes the ring
+ function closeRing(coordinates) {
+ if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {
+ coordinates.push(coordinates[0]);
+ }
+ return coordinates;
+ }
+
+ // determine if polygon ring coordinates are clockwise. clockwise signifies outer ring, counter-clockwise an inner ring
+ // or hole. this logic was found at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-
+ // points-are-in-clockwise-order
+ function ringIsClockwise(ringToTest) {
+ var total = 0,i = 0;
+ var rLength = ringToTest.length;
+ var pt1 = ringToTest[i];
+ var pt2;
+ for (i; i < rLength - 1; i++) {
+ pt2 = ringToTest[i + 1];
+ total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);
+ pt1 = pt2;
+ }
+ return (total >= 0);
+ }
+
+ // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L504-L519
+ function vertexIntersectsVertex(a1, a2, b1, b2) {
+ var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);
+ var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);
+ var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);
+
+ if ( uB !== 0 ) {
+ var ua = uaT / uB;
+ var ub = ubT / uB;
+
+ if ( 0 <= ua && ua <= 1 && 0 <= ub && ub <= 1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L521-L531
+ function arrayIntersectsArray(a, b) {
+ for (var i = 0; i < a.length - 1; i++) {
+ for (var j = 0; j < b.length - 1; j++) {
+ if (vertexIntersectsVertex(a[i], a[i + 1], b[j], b[j + 1])) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L470-L480
+ function coordinatesContainPoint(coordinates, point) {
+ var contains = false;
+ for(var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {
+ if (((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||
+ (coordinates[j][1] <= point[1] && point[1] < coordinates[i][1])) &&
+ (point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0])) {
+ contains = !contains;
+ }
+ }
+ return contains;
+ }
+
+ // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L106-L113
+ function coordinatesContainCoordinates(outer, inner){
+ var intersects = arrayIntersectsArray(outer, inner);
+ var contains = coordinatesContainPoint(outer, inner[0]);
+ if(!intersects && contains){
+ return true;
+ }
+ return false;
+ }
+
+ // do any polygons in this array contain any other polygons in this array?
+ // used for checking for holes in arcgis rings
+ // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L117-L172
+ function convertRingsToGeoJSON(rings){
+ var outerRings = [];
+ var holes = [];
+ var x; // iterator
+ var outerRing; // current outer ring being evaluated
+ var hole; // current hole being evaluated
+
+ // for each ring
+ for (var r = 0; r < rings.length; r++) {
+ var ring = closeRing(rings[r].slice(0));
+ if(ring.length < 4){
+ continue;
+ }
+ // is this ring an outer ring? is it clockwise?
+ if(ringIsClockwise(ring)){
+ var polygon = [ ring ];
+ outerRings.push(polygon); // push to outer rings
+ } else {
+ holes.push(ring); // counterclockwise push to holes
+ }
+ }
+
+ var uncontainedHoles = [];
+
+ // while there are holes left...
+ while(holes.length){
+ // pop a hole off out stack
+ hole = holes.pop();
+
+ // loop over all outer rings and see if they contain our hole.
+ var contained = false;
+ for (x = outerRings.length - 1; x >= 0; x--) {
+ outerRing = outerRings[x][0];
+ if(coordinatesContainCoordinates(outerRing, hole)){
+ // the hole is contained push it into our polygon
+ outerRings[x].push(hole);
+ contained = true;
+ break;
+ }
+ }
+
+ // ring is not contained in any outer ring
+ // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320
+ if(!contained){
+ uncontainedHoles.push(hole);
+ }
+ }
+
+ // if we couldn't match any holes using contains we can try intersects...
+ while(uncontainedHoles.length){
+ // pop a hole off out stack
+ hole = uncontainedHoles.pop();
+
+ // loop over all outer rings and see if any intersect our hole.
+ var intersects = false;
+ for (x = outerRings.length - 1; x >= 0; x--) {
+ outerRing = outerRings[x][0];
+ if(arrayIntersectsArray(outerRing, hole)){
+ // the hole is contained push it into our polygon
+ outerRings[x].push(hole);
+ intersects = true;
+ break;
+ }
+ }
+
+ if(!intersects) {
+ outerRings.push([hole.reverse()]);
+ }
+ }
+
+ if(outerRings.length === 1){
+ return {
+ type: 'Polygon',
+ coordinates: outerRings[0]
+ };
+ } else {
+ return {
+ type: 'MultiPolygon',
+ coordinates: outerRings
+ };
+ }
+ }
+
+ // This function ensures that rings are oriented in the right directions
+ // outer rings are clockwise, holes are counterclockwise
+ // used for converting GeoJSON Polygons to ArcGIS Polygons
+ function orientRings(poly){
+ var output = [];
+ var polygon = poly.slice(0);
+ var outerRing = closeRing(polygon.shift().slice(0));
+ if(outerRing.length >= 4){
+ if(!ringIsClockwise(outerRing)){
+ outerRing.reverse();
+ }
+
+ output.push(outerRing);
+
+ for (var i = 0; i < polygon.length; i++) {
+ var hole = closeRing(polygon[i].slice(0));
+ if(hole.length >= 4){
+ if(ringIsClockwise(hole)){
+ hole.reverse();
+ }
+ output.push(hole);
+ }
+ }
+ }
+
+ return output;
+ }
+
+ // This function flattens holes in multipolygons to one array of polygons
+ // used for converting GeoJSON Polygons to ArcGIS Polygons
+ function flattenMultiPolygonRings(rings){
+ var output = [];
+ for (var i = 0; i < rings.length; i++) {
+ var polygon = orientRings(rings[i]);
+ for (var x = polygon.length - 1; x >= 0; x--) {
+ var ring = polygon[x].slice(0);
+ output.push(ring);
+ }
+ }
+ return output;
+ }
+
+ // convert an extent (ArcGIS) to LatLngBounds (Leaflet)
+ EsriLeaflet.Util.extentToBounds = function(extent){
+ var sw = new L.LatLng(extent.ymin, extent.xmin);
+ var ne = new L.LatLng(extent.ymax, extent.xmax);
+ return new L.LatLngBounds(sw, ne);
+ };
+
+ // convert an LatLngBounds (Leaflet) to extent (ArcGIS)
+ EsriLeaflet.Util.boundsToExtent = function(bounds) {
+ bounds = L.latLngBounds(bounds);
+ return {
+ 'xmin': bounds.getSouthWest().lng,
+ 'ymin': bounds.getSouthWest().lat,
+ 'xmax': bounds.getNorthEast().lng,
+ 'ymax': bounds.getNorthEast().lat,
+ 'spatialReference': {
+ 'wkid' : 4326
+ }
+ };
+ };
+
+ EsriLeaflet.Util.arcgisToGeojson = function (arcgis, idAttribute){
+ var geojson = {};
+
+ if(typeof arcgis.x === 'number' && typeof arcgis.y === 'number'){
+ geojson.type = 'Point';
+ geojson.coordinates = [arcgis.x, arcgis.y];
+ }
+
+ if(arcgis.points){
+ geojson.type = 'MultiPoint';
+ geojson.coordinates = arcgis.points.slice(0);
+ }
+
+ if(arcgis.paths) {
+ if(arcgis.paths.length === 1){
+ geojson.type = 'LineString';
+ geojson.coordinates = arcgis.paths[0].slice(0);
+ } else {
+ geojson.type = 'MultiLineString';
+ geojson.coordinates = arcgis.paths.slice(0);
+ }
+ }
+
+ if(arcgis.rings) {
+ geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));
+ }
+
+ if(arcgis.geometry || arcgis.attributes) {
+ geojson.type = 'Feature';
+ geojson.geometry = (arcgis.geometry) ? EsriLeaflet.Util.arcgisToGeojson(arcgis.geometry) : null;
+ geojson.properties = (arcgis.attributes) ? clone(arcgis.attributes) : null;
+ if(arcgis.attributes) {
+ geojson.id = arcgis.attributes[idAttribute] || arcgis.attributes.OBJECTID || arcgis.attributes.FID;
+ }
+ }
+
+ return geojson;
+ };
+
+ // GeoJSON -> ArcGIS
+ EsriLeaflet.Util.geojsonToArcGIS = function(geojson, idAttribute){
+ idAttribute = idAttribute || 'OBJECTID';
+ var spatialReference = { wkid: 4326 };
+ var result = {};
+ var i;
+
+ switch(geojson.type){
+ case 'Point':
+ result.x = geojson.coordinates[0];
+ result.y = geojson.coordinates[1];
+ result.spatialReference = spatialReference;
+ break;
+ case 'MultiPoint':
+ result.points = geojson.coordinates.slice(0);
+ result.spatialReference = spatialReference;
+ break;
+ case 'LineString':
+ result.paths = [geojson.coordinates.slice(0)];
+ result.spatialReference = spatialReference;
+ break;
+ case 'MultiLineString':
+ result.paths = geojson.coordinates.slice(0);
+ result.spatialReference = spatialReference;
+ break;
+ case 'Polygon':
+ result.rings = orientRings(geojson.coordinates.slice(0));
+ result.spatialReference = spatialReference;
+ break;
+ case 'MultiPolygon':
+ result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));
+ result.spatialReference = spatialReference;
+ break;
+ case 'Feature':
+ if(geojson.geometry) {
+ result.geometry = EsriLeaflet.Util.geojsonToArcGIS(geojson.geometry, idAttribute);
+ }
+ result.attributes = (geojson.properties) ? clone(geojson.properties) : {};
+ if(geojson.id){
+ result.attributes[idAttribute] = geojson.id;
+ }
+ break;
+ case 'FeatureCollection':
+ result = [];
+ for (i = 0; i < geojson.features.length; i++){
+ result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.features[i], idAttribute));
+ }
+ break;
+ case 'GeometryCollection':
+ result = [];
+ for (i = 0; i < geojson.geometries.length; i++){
+ result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.geometries[i], idAttribute));
+ }
+ break;
+ }
+
+ return result;
+ };
+
+ EsriLeaflet.Util.responseToFeatureCollection = function(response, idAttribute){
+ var objectIdField;
+
+ if(idAttribute){
+ objectIdField = idAttribute;
+ } else if(response.objectIdFieldName){
+ objectIdField = response.objectIdFieldName;
+ } else if(response.fields) {
+ for (var j = 0; j <= response.fields.length - 1; j++) {
+ if(response.fields[j].type === 'esriFieldTypeOID') {
+ objectIdField = response.fields[j].name;
+ break;
+ }
+ }
+ } else {
+ objectIdField = 'OBJECTID';
+ }
+
+ var featureCollection = {
+ type: 'FeatureCollection',
+ features: []
+ };
+ var features = response.features || response.results;
+ if(features.length){
+ for (var i = features.length - 1; i >= 0; i--) {
+ featureCollection.features.push(EsriLeaflet.Util.arcgisToGeojson(features[i], objectIdField));
+ }
+ }
+
+ return featureCollection;
+ };
+
+ // trim whitespace and add a tailing slash is needed to a url
+ EsriLeaflet.Util.cleanUrl = function(url){
+ url = url.replace(/\s\s*/g, '');
+
+ //add a trailing slash to the url if the user omitted it
+ if(url[url.length-1] !== '/'){
+ url += '/';
+ }
+
+ return url;
+ };
+
+ EsriLeaflet.Util.isArcgisOnline = function(url){
+ return (/\.arcgis\.com/g).test(url);
+ };
+
+ EsriLeaflet.Util.geojsonTypeToArcGIS = function (geoJsonType) {
+ var arcgisGeometryType;
+ switch (geoJsonType) {
+ case 'Point':
+ arcgisGeometryType = 'esriGeometryPoint';
+ break;
+ case 'MultiPoint':
+ arcgisGeometryType = 'esriGeometryMultipoint';
+ break;
+ case 'LineString':
+ arcgisGeometryType = 'esriGeometryPolyline';
+ break;
+ case 'MultiLineString':
+ arcgisGeometryType = 'esriGeometryPolyline';
+ break;
+ case 'Polygon':
+ arcgisGeometryType = 'esriGeometryPolygon';
+ break;
+ case 'MultiPolygon':
+ arcgisGeometryType = 'esriGeometryPolygon';
+ break;
+ }
+ return arcgisGeometryType;
+ };
+
+ EsriLeaflet.Util.requestAnimationFrame = L.Util.bind(raf, window);
+
+})(EsriLeaflet);
+
+(function(EsriLeaflet){
+
+ var callbacks = 0;
+
+ window._EsriLeafletCallbacks = {};
+
+ function serialize(params){
+ var data = '';
+
+ params.f = params.f || 'json';
+
+ for (var key in params){
+ if(params.hasOwnProperty(key)){
+ var param = params[key];
+ var type = Object.prototype.toString.call(param);
+ var value;
+
+ if(data.length){
+ data += '&';
+ }
+
+ if (type === '[object Array]'){
+ value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');
+ } else if (type === '[object Object]') {
+ value = JSON.stringify(param);
+ } else if (type === '[object Date]'){
+ value = param.valueOf();
+ } else {
+ value = param;
+ }
+
+ data += encodeURIComponent(key) + '=' + encodeURIComponent(value);
+ }
+ }
+
+ return data;
+ }
+
+ function createRequest(callback, context){
+ var httpRequest = new XMLHttpRequest();
+
+ httpRequest.onerror = function(e) {
+ httpRequest.onreadystatechange = L.Util.falseFn;
+
+ callback.call(context, {
+ error: {
+ code: 500,
+ message: 'XMLHttpRequest error'
+ }
+ }, null);
+ };
+
+ httpRequest.onreadystatechange = function(){
+ var response;
+ var error;
+
+ if (httpRequest.readyState === 4) {
+ try {
+ response = JSON.parse(httpRequest.responseText);
+ } catch(e) {
+ response = null;
+ error = {
+ code: 500,
+ message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'
+ };
+ }
+
+ if (!error && response.error) {
+ error = response.error;
+ response = null;
+ }
+
+ httpRequest.onerror = L.Util.falseFn;
+
+ callback.call(context, error, response);
+ }
+ };
+
+ return httpRequest;
+ }
+
+ // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)
+ EsriLeaflet.Request = {
+ request: function(url, params, callback, context){
+ var paramString = serialize(params);
+ var httpRequest = createRequest(callback, context);
+ var requestLength = (url + '?' + paramString).length;
+
+ // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest
+ if(requestLength <= 2000 && L.esri.Support.CORS){
+ httpRequest.open('GET', url + '?' + paramString);
+ httpRequest.send(null);
+
+ // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest
+ } else if (requestLength > 2000 && L.esri.Support.CORS){
+ httpRequest.open('POST', url);
+ httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ httpRequest.send(paramString);
+
+ // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request
+ } else if(requestLength <= 2000 && !L.esri.Support.CORS){
+ return L.esri.Request.get.JSONP(url, params, callback, context);
+
+ // request is longer then 2000 characters and the browser does not support CORS, log a warning
+ } else {
+ if(console && console.warn){
+ console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');
+ return;
+ }
+ }
+
+ return httpRequest;
+ },
+ post: {
+ XMLHTTP: function (url, params, callback, context) {
+ var httpRequest = createRequest(callback, context);
+ httpRequest.open('POST', url);
+ httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ httpRequest.send(serialize(params));
+
+ return httpRequest;
+ }
+ },
+
+ get: {
+ CORS: function (url, params, callback, context) {
+ var httpRequest = createRequest(callback, context);
+
+ httpRequest.open('GET', url + '?' + serialize(params), true);
+ httpRequest.send(null);
+
+ return httpRequest;
+ },
+ JSONP: function(url, params, callback, context){
+ var callbackId = 'c' + callbacks;
+
+ params.callback = 'window._EsriLeafletCallbacks.' + callbackId;
+
+ var script = L.DomUtil.create('script', null, document.body);
+ script.type = 'text/javascript';
+ script.src = url + '?' + serialize(params);
+ script.id = callbackId;
+
+ window._EsriLeafletCallbacks[callbackId] = function(response){
+ if(window._EsriLeafletCallbacks[callbackId] !== true){
+ var error;
+ var responseType = Object.prototype.toString.call(response);
+
+ if(!(responseType === '[object Object]' || responseType === '[object Array]')){
+ error = {
+ error: {
+ code: 500,
+ message: 'Expected array or object as JSONP response'
+ }
+ };
+ response = null;
+ }
+
+ if (!error && response.error) {
+ error = response;
+ response = null;
+ }
+
+ callback.call(context, error, response);
+ window._EsriLeafletCallbacks[callbackId] = true;
+ }
+ };
+
+ callbacks++;
+
+ return {
+ id: callbackId,
+ url: script.src,
+ abort: function(){
+ window._EsriLeafletCallbacks._callback[callbackId]({
+ code: 0,
+ message: 'Request aborted.'
+ });
+ }
+ };
+ }
+ }
+ };
+
+ // choose the correct AJAX handler depending on CORS support
+ EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;
+
+ // always use XMLHttpRequest for posts
+ EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;
+
+ // expose a common request method the uses GET\POST based on request length
+ EsriLeaflet.request = EsriLeaflet.Request.request;
+
+})(EsriLeaflet);
+
+EsriLeaflet.Services.Service = L.Class.extend({
+
+ includes: L.Mixin.Events,
+
+ options: {
+ proxy: false,
+ useCors: EsriLeaflet.Support.CORS
+ },
+
+ initialize: function (options) {
+ options = options || {};
+ this._requestQueue = [];
+ this._authenticating = false;
+ L.Util.setOptions(this, options);
+ this.options.url = EsriLeaflet.Util.cleanUrl(this.options.url);
+ },
+
+ get: function (path, params, callback, context) {
+ return this._request('get', path, params, callback, context);
+ },
+
+ post: function (path, params, callback, context) {
+ return this._request('post', path, params, callback, context);
+ },
+
+ request: function (path, params, callback, context) {
+ return this._request('request', path, params, callback, context);
+ },
+
+ metadata: function (callback, context) {
+ return this._request('get', '', {}, callback, context);
+ },
+
+ authenticate: function(token){
+ this._authenticating = false;
+ this.options.token = token;
+ this._runQueue();
+ return this;
+ },
+
+ _request: function(method, path, params, callback, context){
+ this.fire('requeststart', {
+ url: this.options.url + path,
+ params: params,
+ method: method
+ });
+
+ var wrappedCallback = this._createServiceCallback(method, path, params, callback, context);
+
+ if (this.options.token) {
+ params.token = this.options.token;
+ }
+
+ if (this._authenticating) {
+ this._requestQueue.push([method, path, params, callback, context]);
+ return;
+ } else {
+ var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;
+
+ if((method === 'get' || method === 'request') && !this.options.useCors){
+ return EsriLeaflet.Request.get.JSONP(url, params, wrappedCallback);
+ } else {
+ return EsriLeaflet[method](url, params, wrappedCallback);
+ }
+ }
+ },
+
+ _createServiceCallback: function(method, path, params, callback, context){
+ var request = [method, path, params, callback, context];
+
+ return L.Util.bind(function(error, response){
+
+ if (error && (error.code === 499 || error.code === 498)) {
+ this._authenticating = true;
+
+ this._requestQueue.push(request);
+
+ this.fire('authenticationrequired', {
+ authenticate: L.Util.bind(this.authenticate, this)
+ });
+ } else {
+ callback.call(context, error, response);
+
+ if(error) {
+ this.fire('requesterror', {
+ url: this.options.url + path,
+ params: params,
+ message: error.message,
+ code: error.code,
+ method: method
+ });
+ } else {
+ this.fire('requestsuccess', {
+ url: this.options.url + path,
+ params: params,
+ response: response,
+ method: method
+ });
+ }
+
+ this.fire('requestend', {
+ url: this.options.url + path,
+ params: params,
+ method: method
+ });
+ }
+ }, this);
+ },
+
+ _runQueue: function(){
+ for (var i = this._requestQueue.length - 1; i >= 0; i--) {
+ var request = this._requestQueue[i];
+ var method = request.shift();
+ this[method].apply(this, request);
+ }
+ this._requestQueue = [];
+ }
+
+});
+
+EsriLeaflet.Services.service = function(params){
+ return new EsriLeaflet.Services.Service(params);
+};
+
+EsriLeaflet.Services.MapService = EsriLeaflet.Services.Service.extend({
+
+ identify: function () {
+ return new EsriLeaflet.Tasks.identifyFeatures(this);
+ },
+
+ find: function () {
+ return new EsriLeaflet.Tasks.Find(this);
+ },
+
+ query: function () {
+ return new EsriLeaflet.Tasks.Query(this);
+ }
+
+});
+
+EsriLeaflet.Services.mapService = function(params){
+ return new EsriLeaflet.Services.MapService(params);
+};
+
+EsriLeaflet.Tasks.Task = L.Class.extend({
+
+ options: {
+ proxy: false,
+ useCors: EsriLeaflet.Support.CORS
+ },
+
+ //Generate a method for each methodName:paramName in the setters for this task.
+ generateSetter: function(param, context){
+ return L.Util.bind(function(value){
+ this.params[param] = value;
+ return this;
+ }, context);
+ },
+
+ initialize: function(endpoint){
+ // endpoint can be either a url (and options) for an ArcGIS Rest Service or an instance of EsriLeaflet.Service
+ if(endpoint.request && endpoint.options){
+ this._service = endpoint;
+ L.Util.setOptions(this, endpoint.options);
+ } else {
+ L.Util.setOptions(this, endpoint);
+ this.options.url = L.esri.Util.cleanUrl(endpoint.url);
+ }
+
+ // clone default params into this object
+ this.params = L.Util.extend({}, this.params || {});
+
+ // generate setter methods based on the setters object implimented a child class
+ if(this.setters){
+ for (var setter in this.setters){
+ var param = this.setters[setter];
+ this[setter] = this.generateSetter(param, this);
+ }
+ }
+ },
+
+ token: function(token){
+ if(this._service){
+ this._service.authenticate(token);
+ } else {
+ this.params.token = token;
+ }
+ return this;
+ },
+
+ request: function(callback, context){
+ if(this._service){
+ return this._service.request(this.path, this.params, callback, context);
+ } else {
+ return this._request('request', this.path, this.params, callback, context);
+ }
+ },
+
+ _request: function(method, path, params, callback, context){
+ var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;
+ if((method === 'get' || method === 'request') && !this.options.useCors){
+ return EsriLeaflet.Request.get.JSONP(url, params, callback, context);
+ } else{
+ return EsriLeaflet[method](url, params, callback, context);
+ }
+ }
+});
+
+EsriLeaflet.Tasks.Identify = EsriLeaflet.Tasks.Task.extend({
+ path: 'identify',
+
+ between: function(start, end){
+ this.params.time = [start.valueOf(), end.valueOf()];
+ return this;
+ }
+});
+
+
+EsriLeaflet.Tasks.IdentifyFeatures = EsriLeaflet.Tasks.Identify.extend({
+ setters: {
+ 'layers': 'layers',
+ 'precision': 'geometryPrecision',
+ 'tolerance': 'tolerance',
+ 'returnGeometry': 'returnGeometry'
+ },
+
+ params: {
+ sr: 4326,
+ layers: 'all',
+ tolerance: 3,
+ returnGeometry: true
+ },
+
+ on: function(map){
+ var extent = EsriLeaflet.Util.boundsToExtent(map.getBounds());
+ var size = map.getSize();
+ this.params.imageDisplay = [size.x, size.y, 96];
+ this.params.mapExtent = [extent.xmin, extent.ymin, extent.xmax, extent.ymax];
+ return this;
+ },
+
+ at: function(latlng){
+ latlng = L.latLng(latlng);
+ this.params.geometry = [latlng.lng, latlng.lat];
+ this.params.geometryType = 'esriGeometryPoint';
+ return this;
+ },
+
+ layerDef: function (id, where){
+ this.params.layerDefs = (this.params.layerDefs) ? this.params.layerDefs + ';' : '';
+ this.params.layerDefs += ([id, where]).join(':');
+ return this;
+ },
+
+ simplify: function(map, factor){
+ var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());
+ this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * (1 - factor);
+ return this;
+ },
+
+ run: function (callback, context){
+ return this.request(function(error, response){
+ var featureCollection = EsriLeaflet.Util.responseToFeatureCollection(response);
+ var count = featureCollection.features.length;
+ // tag each feature with the Id of its parent layer
+ if(!error && count > 0){
+ response.results = response.results.reverse();
+ for (var i = 0; i < count; i++) {
+ var feature = featureCollection.features[i];
+ feature.layerId = response.results[i].layerId;
+ }
+ }
+ callback.call(context, error, (response && featureCollection), response);
+ }, context);
+ }
+
+});
+
+EsriLeaflet.Tasks.identifyFeatures = function(params){
+ return new EsriLeaflet.Tasks.IdentifyFeatures(params);
+};
+
+EsriLeaflet.Tasks.Query = EsriLeaflet.Tasks.Task.extend({
+ setters: {
+ 'offset': 'offset',
+ 'limit': 'limit',
+ 'fields': 'outFields',
+ 'precision': 'geometryPrecision',
+ 'featureIds': 'objectIds',
+ 'returnGeometry': 'returnGeometry',
+ 'token': 'token'
+ },
+
+ path: 'query',
+
+ params: {
+ returnGeometry: true,
+ where: '1=1',
+ outSr: 4326,
+ outFields: '*'
+ },
+
+ within: function(geometry){
+ this._setGeometry(geometry);
+ this.params.spatialRel = 'esriSpatialRelContains'; // will make code read layer within geometry, to the api this will reads geometry contains layer
+ return this;
+ },
+
+ intersects: function(geometry){
+ this._setGeometry(geometry);
+ this.params.spatialRel = 'esriSpatialRelIntersects';
+ return this;
+ },
+
+ contains: function(geometry){
+ this._setGeometry(geometry);
+ this.params.spatialRel = 'esriSpatialRelWithin'; // will make code read layer contains geometry, to the api this will reads geometry within layer
+ return this;
+ },
+
+ // crosses: function(geometry){
+ // this._setGeometry(geometry);
+ // this.params.spatialRel = 'esriSpatialRelCrosses';
+ // return this;
+ // },
+
+ // touches: function(geometry){
+ // this._setGeometry(geometry);
+ // this.params.spatialRel = 'esriSpatialRelTouches';
+ // return this;
+ // },
+
+ overlaps: function(geometry){
+ this._setGeometry(geometry);
+ this.params.spatialRel = 'esriSpatialRelOverlaps';
+ return this;
+ },
+
+ // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online
+ nearby: function(latlng, radius){
+ latlng = L.latLng(latlng);
+ this.params.geometry = [latlng.lng, latlng.lat];
+ this.params.geometryType = 'esriGeometryPoint';
+ this.params.spatialRel = 'esriSpatialRelIntersects';
+ this.params.units = 'esriSRUnit_Meter';
+ this.params.distance = radius;
+ this.params.inSr = 4326;
+ return this;
+ },
+
+ where: function(string){
+ this.params.where = string.replace(/"/g, "\'"); // jshint ignore:line
+ return this;
+ },
+
+ between: function(start, end){
+ this.params.time = [start.valueOf(), end.valueOf()];
+ return this;
+ },
+
+ simplify: function(map, factor){
+ var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());
+ this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;
+ return this;
+ },
+
+ orderBy: function(fieldName, order){
+ order = order || 'ASC';
+ this.params.orderByFields = (this.params.orderByFields) ? this.params.orderByFields + ',' : '';
+ this.params.orderByFields += ([fieldName, order]).join(' ');
+ return this;
+ },
+
+ run: function(callback, context){
+ this._cleanParams();
+
+ // if the service is hosted on arcgis online request geojson directly
+ if(EsriLeaflet.Util.isArcgisOnline(this.options.url)){
+ this.params.f = 'geojson';
+
+ return this.request(function(error, response){
+ callback.call(context, error, response, response);
+ }, context);
+
+ // otherwise convert it in the callback then pass it on
+ } else {
+ return this.request(function(error, response){
+ callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);
+ }, context);
+ }
+ },
+
+ count: function(callback, context){
+ this._cleanParams();
+ this.params.returnCountOnly = true;
+ return this.request(function(error, response){
+ callback.call(this, error, (response && response.count), response);
+ }, context);
+ },
+
+ ids: function(callback, context){
+ this._cleanParams();
+ this.params.returnIdsOnly = true;
+ return this.request(function(error, response){
+ callback.call(this, error, (response && response.objectIds), response);
+ }, context);
+ },
+
+ // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online
+ bounds: function(callback, context){
+ this._cleanParams();
+ this.params.returnExtentOnly = true;
+ return this.request(function(error, response){
+ callback.call(context, error, (response && response.extent && EsriLeaflet.Util.extentToBounds(response.extent)), response);
+ }, context);
+ },
+
+ // only valid for image services
+ pixelSize: function(point){
+ point = L.point(point);
+ this.params.pixelSize = [point.x,point.y];
+ return this;
+ },
+
+ // only valid for map services
+ layer: function(layer){
+ this.path = layer + '/query';
+ return this;
+ },
+
+ _cleanParams: function(){
+ delete this.params.returnIdsOnly;
+ delete this.params.returnExtentOnly;
+ delete this.params.returnCountOnly;
+ },
+
+ _setGeometry: function(geometry) {
+ this.params.inSr = 4326;
+
+ // convert bounds to extent and finish
+ if ( geometry instanceof L.LatLngBounds ) {
+ // set geometry + geometryType
+ this.params.geometry = EsriLeaflet.Util.boundsToExtent(geometry);
+ this.params.geometryType = 'esriGeometryEnvelope';
+ return;
+ }
+
+ // convert L.Marker > L.LatLng
+ if(geometry.getLatLng){
+ geometry = geometry.getLatLng();
+ }
+
+ // convert L.LatLng to a geojson point and continue;
+ if (geometry instanceof L.LatLng) {
+ geometry = {
+ type: 'Point',
+ coordinates: [geometry.lng, geometry.lat]
+ };
+ }
+
+ // handle L.GeoJSON, pull out the first geometry
+ if ( geometry instanceof L.GeoJSON ) {
+ //reassign geometry to the GeoJSON value (we are assuming that only one feature is present)
+ geometry = geometry.getLayers()[0].feature.geometry;
+ this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);
+ this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);
+ }
+
+ // Handle L.Polyline and L.Polygon
+ if (geometry.toGeoJSON) {
+ geometry = geometry.toGeoJSON();
+ }
+
+ // handle GeoJSON feature by pulling out the geometry
+ if ( geometry.type === 'Feature' ) {
+ // get the geometry of the geojson feature
+ geometry = geometry.geometry;
+ }
+
+ // confirm that our GeoJSON is a point, line or polygon
+ if ( geometry.type === 'Point' || geometry.type === 'LineString' || geometry.type === 'Polygon') {
+ this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);
+ this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);
+ return;
+ }
+
+ // warn the user if we havn't found a
+ /* global console */
+ if(console && console.warn) {
+ console.warn('invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object');
+ }
+
+ return;
+ }
+});
+
+EsriLeaflet.Tasks.query = function(params){
+ return new EsriLeaflet.Tasks.Query(params);
+};
+
+EsriLeaflet.Tasks.Find = EsriLeaflet.Tasks.Task.extend({
+ setters: {
+ // method name > param name
+ 'contains': 'contains',
+ 'text': 'searchText',
+ 'fields': 'searchFields', // denote an array or single string
+ 'spatialReference': 'sr',
+ 'sr': 'sr',
+ 'layers': 'layers',
+ 'returnGeometry': 'returnGeometry',
+ 'maxAllowableOffset': 'maxAllowableOffset',
+ 'precision': 'geometryPrecision',
+ 'dynamicLayers': 'dynamicLayers',
+ 'returnZ' : 'returnZ',
+ 'returnM' : 'returnM',
+ 'gdbVersion' : 'gdbVersion',
+ 'token' : 'token'
+ },
+
+ path: 'find',
+
+ params: {
+ sr: 4326,
+ contains: true,
+ returnGeometry: true,
+ returnZ: true,
+ returnM: false
+ },
+
+ layerDefs: function (id, where) {
+ this.params.layerDefs = (this.params.layerDefs) ? this.params.layerDefs + ';' : '';
+ this.params.layerDefs += ([id, where]).join(':');
+ return this;
+ },
+
+ simplify: function(map, factor){
+ var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());
+ this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;
+ return this;
+ },
+
+ run: function (callback, context) {
+ return this.request(function(error, response){
+ callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);
+ }, context);
+ }
+});
+
+EsriLeaflet.Tasks.find = function (params) {
+ return new EsriLeaflet.Tasks.Find(params);
+};
+
+EsriLeaflet.Layers.RasterLayer = L.Class.extend({
+ includes: L.Mixin.Events,
+
+ options: {
+ opacity: 1,
+ position: 'front',
+ f: 'image'
+ },
+
+ onAdd: function (map) {
+ this._map = map;
+
+ this._update = L.Util.limitExecByInterval(this._update, this.options.updateInterval, this);
+
+ if (map.options.crs && map.options.crs.code) {
+ var sr = map.options.crs.code.split(':')[1];
+ this.options.bboxSR = sr;
+ this.options.imageSR = sr;
+ }
+
+ map.on('moveend', this._update, this);
+
+ // if we had an image loaded and it matches the
+ // current bounds show the image otherwise remove it
+ if(this._currentImage && this._currentImage._bounds.equals(this._map.getBounds())){
+ map.addLayer(this._currentImage);
+ } else if(this._currentImage) {
+ this._map.removeLayer(this._currentImage);
+ this._currentImage = null;
+ }
+
+ this._update();
+
+ if(this._popup){
+ this._map.on('click', this._getPopupData, this);
+ this._map.on('dblclick', this._resetPopupState, this);
+ }
+ },
+
+ bindPopup: function(fn, popupOptions){
+ this._shouldRenderPopup = false;
+ this._lastClick = false;
+ this._popup = L.popup(popupOptions);
+ this._popupFunction = fn;
+ if(this._map){
+ this._map.on('click', this._getPopupData, this);
+ this._map.on('dblclick', this._resetPopupState, this);
+ }
+ return this;
+ },
+
+ unbindPopup: function(){
+ if(this._map){
+ this._map.closePopup(this._popup);
+ this._map.off('click', this._getPopupData, this);
+ this._map.off('dblclick', this._resetPopupState, this);
+ }
+ this._popup = false;
+ return this;
+ },
+
+ onRemove: function (map) {
+ if (this._currentImage) {
+ this._map.removeLayer(this._currentImage);
+ }
+
+ if(this._popup){
+ this._map.off('click', this._getPopupData, this);
+ this._map.off('dblclick', this._resetPopupState, this);
+ }
+
+ this._map.off('moveend', this._update, this);
+ this._map = null;
+ },
+
+ addTo: function(map){
+ map.addLayer(this);
+ return this;
+ },
+
+ removeFrom: function(map){
+ map.removeLayer(this);
+ return this;
+ },
+
+ bringToFront: function(){
+ this.options.position = 'front';
+ if(this._currentImage){
+ this._currentImage.bringToFront();
+ }
+ return this;
+ },
+
+ bringToBack: function(){
+ this.options.position = 'back';
+ if(this._currentImage){
+ this._currentImage.bringToBack();
+ }
+ return this;
+ },
+
+ getAttribution: function () {
+ return this.options.attribution;
+ },
+
+ getOpacity: function(){
+ return this.options.opacity;
+ },
+
+ setOpacity: function(opacity){
+ this.options.opacity = opacity;
+ this._currentImage.setOpacity(opacity);
+ return this;
+ },
+
+ getTimeRange: function(){
+ return [this.options.from, this.options.to];
+ },
+
+ setTimeRange: function(from, to){
+ this.options.from = from;
+ this.options.to = to;
+ this._update();
+ return this;
+ },
+
+ metadata: function(callback, context){
+ this._service.metadata(callback, context);
+ return this;
+ },
+
+ authenticate: function(token){
+ this._service.authenticate(token);
+ return this;
+ },
+
+ _renderImage: function(url, bounds){
+ if(this._map){
+ // create a new image overlay and add it to the map
+ // to start loading the image
+ // opacity is 0 while the image is loading
+ var image = new L.ImageOverlay(url, bounds, {
+ opacity: 0
+ }).addTo(this._map);
+
+ // once the image loads
+ image.once('load', function(e){
+ var newImage = e.target;
+ var oldImage = this._currentImage;
+
+ // if the bounds of this image matches the bounds that
+ // _renderImage was called with and we have a map
+ // hide the old image if there is one and set the opacity
+ // of the new image otherwise remove the new image
+ if(newImage._bounds.equals(bounds)){
+ this._currentImage = newImage;
+
+ if(this.options.position === 'front'){
+ this.bringToFront();
+ } else {
+ this.bringToBack();
+ }
+
+ if(this._map && this._currentImage._map){
+ this._currentImage.setOpacity(this.options.opacity);
+ } else {
+ this._currentImage._map.removeLayer(this._currentImage);
+ }
+
+ if(oldImage && this._map) {
+ this._map.removeLayer(oldImage);
+ }
+
+ if(oldImage && oldImage._map){
+ oldImage._map.removeLayer(oldImage);
+ }
+ } else {
+ this._map.removeLayer(newImage);
+ }
+
+ this.fire('load', {
+ bounds: bounds
+ });
+
+ }, this);
+
+ this.fire('loading', {
+ bounds: bounds
+ });
+ }
+ },
+
+ _update: function () {
+ if(!this._map){
+ return;
+ }
+
+ var zoom = this._map.getZoom();
+ var bounds = this._map.getBounds();
+
+ if(this._animatingZoom){
+ return;
+ }
+
+ if (this._map._panTransition && this._map._panTransition._inProgress) {
+ return;
+ }
+
+ if (zoom > this.options.maxZoom || zoom < this.options.minZoom) {
+ return;
+ }
+ var params = this._buildExportParams();
+
+ this._requestExport(params, bounds);
+ },
+
+ // TODO: refactor these into raster layer
+ _renderPopup: function(latlng, error, results, response){
+ latlng = L.latLng(latlng);
+ if(this._shouldRenderPopup && this._lastClick.equals(latlng)){
+ //add the popup to the map where the mouse was clicked at
+ var content = this._popupFunction(error, results, response);
+ if (content) {
+ this._popup.setLatLng(latlng).setContent(content).openOn(this._map);
+ }
+ }
+ },
+
+ _resetPopupState: function(e){
+ this._shouldRenderPopup = false;
+ this._lastClick = e.latlng;
+ },
+
+ // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js
+ // @TODO remove at Leaflet 0.8
+ _propagateEvent: function (e) {
+ e = L.extend({
+ layer: e.target,
+ target: this
+ }, e);
+ this.fire(e.type, e);
+ }
+});
+
+EsriLeaflet.Layers.DynamicMapLayer = EsriLeaflet.Layers.RasterLayer.extend({
+
+ options: {
+ updateInterval: 150,
+ layers: false,
+ layerDefs: false,
+ timeOptions: false,
+ format: 'png24',
+ transparent: true
+ },
+
+ initialize: function (url, options) {
+ options = options || {};
+ options.url = EsriLeaflet.Util.cleanUrl(url);
+ this._service = new EsriLeaflet.Services.MapService(options);
+ this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);
+ if (options.proxy){
+ options.f = 'json';
+ }
+ L.Util.setOptions(this, options);
+ },
+
+ getLayers: function(){
+ return this.options.layers;
+ },
+
+ setLayers: function(layers){
+ this.options.layers = layers;
+ this._update();
+ return this;
+ },
+
+ getLayerDefs: function(){
+ return this.options.layerDefs;
+ },
+
+ setLayerDefs: function(layerDefs){
+ this.options.layerDefs = layerDefs;
+ this._update();
+ return this;
+ },
+
+ getTimeOptions: function(){
+ return this.options.timeOptions;
+ },
+
+ setTimeOptions: function(timeOptions){
+ this.options.timeOptions = timeOptions;
+ this._update();
+ return this;
+ },
+
+ query: function(){
+ return this._service.query();
+ },
+
+ identify: function(){
+ return this._service.identify();
+ },
+
+ find: function(){
+ return this._service.find();
+ },
+
+ _getPopupData: function(e){
+ var callback = L.Util.bind(function(error, featureCollection, response) {
+ setTimeout(L.Util.bind(function(){
+ this._renderPopup(e.latlng, error, featureCollection, response);
+ }, this), 300);
+ }, this);
+
+ var identifyRequest = this.identify().on(this._map).at(e.latlng);
+
+ if(this.options.layers){
+ identifyRequest.layers('visible:' + this.options.layers.join(','));
+ } else {
+ identifyRequest.layers('visible');
+ }
+
+ identifyRequest.run(callback);
+
+ // set the flags to show the popup
+ this._shouldRenderPopup = true;
+ this._lastClick = e.latlng;
+ },
+
+ _buildExportParams: function () {
+ var bounds = this._map.getBounds();
+ var size = this._map.getSize();
+ var ne = this._map.options.crs.project(bounds._northEast);
+ var sw = this._map.options.crs.project(bounds._southWest);
+
+ var params = {
+ bbox: [sw.x, sw.y, ne.x, ne.y].join(','),
+ size: size.x + ',' + size.y,
+ dpi: 96,
+ format: this.options.format,
+ transparent: this.options.transparent,
+ bboxSR: this.options.bboxSR,
+ imageSR: this.options.imageSR
+ };
+
+ if(this.options.layers){
+ params.layers = 'show:' + this.options.layers.join(',');
+ }
+
+ if(this.options.layerDefs){
+ params.layerDefs = JSON.stringify(this.options.layerDefs);
+ }
+
+ if(this.options.timeOptions){
+ params.timeOptions = JSON.stringify(this.options.timeOptions);
+ }
+
+ if(this.options.from && this.options.to){
+ params.time = this.options.from.valueOf() + ',' + this.options.to.valueOf();
+ }
+
+ if(this._service.options.token) {
+ params.token = this._service.options.token;
+ }
+
+ return params;
+ },
+
+ _requestExport: function (params, bounds) {
+ if(this.options.f === 'json'){
+ this._service.get('export', params, function(error, response){
+ this._renderImage(response.href, bounds);
+ }, this);
+ } else {
+ params.f = 'image';
+ this._renderImage(this.options.url + 'export' + L.Util.getParamString(params), bounds);
+ }
+ }
+});
+
+EsriLeaflet.DynamicMapLayer = EsriLeaflet.Layers.DynamicMapLayer;
+
+EsriLeaflet.Layers.dynamicMapLayer = function(url, options){
+ return new EsriLeaflet.Layers.DynamicMapLayer(url, options);
+};
+
+EsriLeaflet.dynamicMapLayer = function(url, options){
+ return new EsriLeaflet.Layers.DynamicMapLayer(url, options);
+};
+
+EsriLeaflet.Layers.TiledMapLayer = L.TileLayer.extend({
+ initialize: function(url, options){
+ options = options || {};
+ options.url = EsriLeaflet.Util.cleanUrl(url);
+ options = L.Util.setOptions(this, options);
+
+ // set the urls
+ //this.url = L.esri.Util.cleanUrl(url);
+ this.tileUrl = L.esri.Util.cleanUrl(url) + 'tile/{z}/{y}/{x}';
+ this._service = new L.esri.Services.MapService(options);
+ this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);
+
+ //if this is looking at the AGO tiles subdomain insert the subdomain placeholder
+ if(this.tileUrl.match('://tiles.arcgisonline.com')){
+ this.tileUrl = this.tileUrl.replace('://tiles.arcgisonline.com', '://tiles{s}.arcgisonline.com');
+ options.subdomains = ['1', '2', '3', '4'];
+ }
+
+ if(this.options.token) {
+ this.tileUrl += ('?token=' + this.options.token);
+ }
+
+ // init layer by calling TileLayers initialize method
+ L.TileLayer.prototype.initialize.call(this, this.tileUrl, options);
+ },
+
+ metadata: function(callback, context){
+ this._service.metadata(callback, context);
+ return this;
+ },
+
+ identify: function(){
+ return this._service.identify();
+ },
+
+ authenticate: function(token){
+ var tokenQs = '?token=' + token;
+ this.tileUrl = (this.options.token) ? this.tileUrl.replace(/\?token=(.+)/g, tokenQs) : this.tileUrl + tokenQs;
+ this.options.token = token;
+ this._service.authenticate(token);
+ return this;
+ },
+
+ // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js
+ // @TODO remove at Leaflet 0.8
+ _propagateEvent: function (e) {
+ e = L.extend({
+ layer: e.target,
+ target: this
+ }, e);
+ this.fire(e.type, e);
+ }
+});
+
+L.esri.TiledMapLayer = L.esri.Layers.tiledMapLayer;
+
+L.esri.Layers.tiledMapLayer = function(url, options){
+ return new L.esri.Layers.TiledMapLayer(url, options);
+};
+
+L.esri.tiledMapLayer = function(url, options){
+ return new L.esri.Layers.TiledMapLayer(url, options);
+};
+
+ return EsriLeaflet;
+}));
+//# sourceMappingURL=esri-leaflet-map-service-src.js.map
\ No newline at end of file
diff --git a/dist/builds/map-service/esri-leaflet-map-service-src.js.map b/dist/builds/map-service/esri-leaflet-map-service-src.js.map
new file mode 100644
index 000000000..5285ff584
--- /dev/null
+++ b/dist/builds/map-service/esri-leaflet-map-service-src.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["../../../src/EsriLeaflet.js","../../../src/Util.js","../../../src/Request.js","../../../src/Services/Service.js","../../../src/Services/MapService.js","../../../src/Tasks/Task.js","../../../src/Tasks/Identify.js","../../../src/Tasks/IdentifyFeatures.js","../../../src/Tasks/Query.js","../../../src/Tasks/Find.js","../../../src/Layers/RasterLayer.js","../../../src/Layers/DynamicMapLayer.js","../../../src/Layers/TiledMapLayer.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI;AACxC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;AACxB,EAAE,MAAM,CAAC,CAAC,GAAG;AACb,EAAE,QAAQ,CAAC,CAAC,GAAG;AACf,EAAE,QAAQ,CAAC,CAAC,GAAG;AACf,EAAE,KAAK,CAAC,CAAC,GAAG;AACZ,EAAE,IAAI,CAAC,CAAC,GAAG;AACX,EAAE,OAAO,CAAC,CAAC,CAAC;AACZ,IAAI,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,cAAc,IAAI;AACjF,IAAI,aAAa,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE;AACtE,EAAE,CAAC;AACH,EAAE;AACF;AACA,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE;AAC9C,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC;AAC9B,CAAC;;;ACf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C,CAAC,CAAC,CAAC,MAAM,EAAE;AAClB,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AACtB,MAAM,MAAM,CAAC,CAAC,IAAI;AAClB,IAAI,EAAE,CAAC,CAAC,EAAE;AACV,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;AACzB,EAAE,CAAC;AACH,GAAG;AACH;AACA,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;AACnD;AACA,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE;AACrD,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE;AACvD,EAAE;AACF;AACA,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE;AAC9C,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE;AACvD,E","file":"esri-leaflet-map-service-src.js","sourcesContent":["var EsriLeaflet = { //jshint ignore:line\n VERSION: '1.0.0-rc.5',\n Layers: {},\n Services: {},\n Controls: {},\n Tasks: {},\n Util: {},\n Support: {\n CORS: !!(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()),\n pointerEvents: document.documentElement.style.pointerEvents === ''\n }\n};\n\nif(typeof window !== 'undefined' && window.L){\n window.L.esri = EsriLeaflet;\n}\n","(function(EsriLeaflet){\n\n // normalize request animation frame\n var raf = window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function(cb) { return window.setTimeout(cb, 1000 / 60); };\n\n // shallow object clone for feature properties and attributes\n // from http://jsperf.com/cloning-an-object/2\n function clone(obj) {\n var target = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n target[i] = obj[i];\n }\n }\n return target;\n }\n\n // checks if 2 x,y points are equal\n function pointsEqual(a, b) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n }\n\n // checks if the first and last points of a ring are equal and closes the ring\n function closeRing(coordinates) {\n if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {\n coordinates.push(coordinates[0]);\n }\n return coordinates;\n }\n\n // determine if polygon ring coordinates are clockwise. clockwise signifies outer ring, counter-clockwise an inner ring\n // or hole. this logic was found at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-\n // points-are-in-clockwise-order\n function ringIsClockwise(ringToTest) {\n var total = 0,i = 0;\n var rLength = ringToTest.length;\n var pt1 = ringToTest[i];\n var pt2;\n for (i; i < rLength - 1; i++) {\n pt2 = ringToTest[i + 1];\n total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);\n pt1 = pt2;\n }\n return (total >= 0);\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L504-L519\n function vertexIntersectsVertex(a1, a2, b1, b2) {\n var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);\n var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);\n var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);\n\n if ( uB !== 0 ) {\n var ua = uaT / uB;\n var ub = ubT / uB;\n\n if ( 0 <= ua && ua <= 1 && 0 <= ub && ub <= 1 ) {\n return true;\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L521-L531\n function arrayIntersectsArray(a, b) {\n for (var i = 0; i < a.length - 1; i++) {\n for (var j = 0; j < b.length - 1; j++) {\n if (vertexIntersectsVertex(a[i], a[i + 1], b[j], b[j + 1])) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L470-L480\n function coordinatesContainPoint(coordinates, point) {\n var contains = false;\n for(var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {\n if (((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||\n (coordinates[j][1] <= point[1] && point[1] < coordinates[i][1])) &&\n (point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0])) {\n contains = !contains;\n }\n }\n return contains;\n }\n\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L106-L113\n function coordinatesContainCoordinates(outer, inner){\n var intersects = arrayIntersectsArray(outer, inner);\n var contains = coordinatesContainPoint(outer, inner[0]);\n if(!intersects && contains){\n return true;\n }\n return false;\n }\n\n // do any polygons in this array contain any other polygons in this array?\n // used for checking for holes in arcgis rings\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L117-L172\n function convertRingsToGeoJSON(rings){\n var outerRings = [];\n var holes = [];\n var x; // iterator\n var outerRing; // current outer ring being evaluated\n var hole; // current hole being evaluated\n\n // for each ring\n for (var r = 0; r < rings.length; r++) {\n var ring = closeRing(rings[r].slice(0));\n if(ring.length < 4){\n continue;\n }\n // is this ring an outer ring? is it clockwise?\n if(ringIsClockwise(ring)){\n var polygon = [ ring ];\n outerRings.push(polygon); // push to outer rings\n } else {\n holes.push(ring); // counterclockwise push to holes\n }\n }\n\n var uncontainedHoles = [];\n\n // while there are holes left...\n while(holes.length){\n // pop a hole off out stack\n hole = holes.pop();\n\n // loop over all outer rings and see if they contain our hole.\n var contained = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(coordinatesContainCoordinates(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n contained = true;\n break;\n }\n }\n\n // ring is not contained in any outer ring\n // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320\n if(!contained){\n uncontainedHoles.push(hole);\n }\n }\n\n // if we couldn't match any holes using contains we can try intersects...\n while(uncontainedHoles.length){\n // pop a hole off out stack\n hole = uncontainedHoles.pop();\n\n // loop over all outer rings and see if any intersect our hole.\n var intersects = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(arrayIntersectsArray(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n intersects = true;\n break;\n }\n }\n\n if(!intersects) {\n outerRings.push([hole.reverse()]);\n }\n }\n\n if(outerRings.length === 1){\n return {\n type: 'Polygon',\n coordinates: outerRings[0]\n };\n } else {\n return {\n type: 'MultiPolygon',\n coordinates: outerRings\n };\n }\n }\n\n // This function ensures that rings are oriented in the right directions\n // outer rings are clockwise, holes are counterclockwise\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function orientRings(poly){\n var output = [];\n var polygon = poly.slice(0);\n var outerRing = closeRing(polygon.shift().slice(0));\n if(outerRing.length >= 4){\n if(!ringIsClockwise(outerRing)){\n outerRing.reverse();\n }\n\n output.push(outerRing);\n\n for (var i = 0; i < polygon.length; i++) {\n var hole = closeRing(polygon[i].slice(0));\n if(hole.length >= 4){\n if(ringIsClockwise(hole)){\n hole.reverse();\n }\n output.push(hole);\n }\n }\n }\n\n return output;\n }\n\n // This function flattens holes in multipolygons to one array of polygons\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function flattenMultiPolygonRings(rings){\n var output = [];\n for (var i = 0; i < rings.length; i++) {\n var polygon = orientRings(rings[i]);\n for (var x = polygon.length - 1; x >= 0; x--) {\n var ring = polygon[x].slice(0);\n output.push(ring);\n }\n }\n return output;\n }\n\n // convert an extent (ArcGIS) to LatLngBounds (Leaflet)\n EsriLeaflet.Util.extentToBounds = function(extent){\n var sw = new L.LatLng(extent.ymin, extent.xmin);\n var ne = new L.LatLng(extent.ymax, extent.xmax);\n return new L.LatLngBounds(sw, ne);\n };\n\n // convert an LatLngBounds (Leaflet) to extent (ArcGIS)\n EsriLeaflet.Util.boundsToExtent = function(bounds) {\n bounds = L.latLngBounds(bounds);\n return {\n 'xmin': bounds.getSouthWest().lng,\n 'ymin': bounds.getSouthWest().lat,\n 'xmax': bounds.getNorthEast().lng,\n 'ymax': bounds.getNorthEast().lat,\n 'spatialReference': {\n 'wkid' : 4326\n }\n };\n };\n\n EsriLeaflet.Util.arcgisToGeojson = function (arcgis, idAttribute){\n var geojson = {};\n\n if(typeof arcgis.x === 'number' && typeof arcgis.y === 'number'){\n geojson.type = 'Point';\n geojson.coordinates = [arcgis.x, arcgis.y];\n }\n\n if(arcgis.points){\n geojson.type = 'MultiPoint';\n geojson.coordinates = arcgis.points.slice(0);\n }\n\n if(arcgis.paths) {\n if(arcgis.paths.length === 1){\n geojson.type = 'LineString';\n geojson.coordinates = arcgis.paths[0].slice(0);\n } else {\n geojson.type = 'MultiLineString';\n geojson.coordinates = arcgis.paths.slice(0);\n }\n }\n\n if(arcgis.rings) {\n geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));\n }\n\n if(arcgis.geometry || arcgis.attributes) {\n geojson.type = 'Feature';\n geojson.geometry = (arcgis.geometry) ? EsriLeaflet.Util.arcgisToGeojson(arcgis.geometry) : null;\n geojson.properties = (arcgis.attributes) ? clone(arcgis.attributes) : null;\n if(arcgis.attributes) {\n geojson.id = arcgis.attributes[idAttribute] || arcgis.attributes.OBJECTID || arcgis.attributes.FID;\n }\n }\n\n return geojson;\n };\n\n // GeoJSON -> ArcGIS\n EsriLeaflet.Util.geojsonToArcGIS = function(geojson, idAttribute){\n idAttribute = idAttribute || 'OBJECTID';\n var spatialReference = { wkid: 4326 };\n var result = {};\n var i;\n\n switch(geojson.type){\n case 'Point':\n result.x = geojson.coordinates[0];\n result.y = geojson.coordinates[1];\n result.spatialReference = spatialReference;\n break;\n case 'MultiPoint':\n result.points = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'LineString':\n result.paths = [geojson.coordinates.slice(0)];\n result.spatialReference = spatialReference;\n break;\n case 'MultiLineString':\n result.paths = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'Polygon':\n result.rings = orientRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'MultiPolygon':\n result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'Feature':\n if(geojson.geometry) {\n result.geometry = EsriLeaflet.Util.geojsonToArcGIS(geojson.geometry, idAttribute);\n }\n result.attributes = (geojson.properties) ? clone(geojson.properties) : {};\n if(geojson.id){\n result.attributes[idAttribute] = geojson.id;\n }\n break;\n case 'FeatureCollection':\n result = [];\n for (i = 0; i < geojson.features.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.features[i], idAttribute));\n }\n break;\n case 'GeometryCollection':\n result = [];\n for (i = 0; i < geojson.geometries.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.geometries[i], idAttribute));\n }\n break;\n }\n\n return result;\n };\n\n EsriLeaflet.Util.responseToFeatureCollection = function(response, idAttribute){\n var objectIdField;\n\n if(idAttribute){\n objectIdField = idAttribute;\n } else if(response.objectIdFieldName){\n objectIdField = response.objectIdFieldName;\n } else if(response.fields) {\n for (var j = 0; j <= response.fields.length - 1; j++) {\n if(response.fields[j].type === 'esriFieldTypeOID') {\n objectIdField = response.fields[j].name;\n break;\n }\n }\n } else {\n objectIdField = 'OBJECTID';\n }\n\n var featureCollection = {\n type: 'FeatureCollection',\n features: []\n };\n var features = response.features || response.results;\n if(features.length){\n for (var i = features.length - 1; i >= 0; i--) {\n featureCollection.features.push(EsriLeaflet.Util.arcgisToGeojson(features[i], objectIdField));\n }\n }\n\n return featureCollection;\n };\n\n // trim whitespace and add a tailing slash is needed to a url\n EsriLeaflet.Util.cleanUrl = function(url){\n url = url.replace(/\\s\\s*/g, '');\n\n //add a trailing slash to the url if the user omitted it\n if(url[url.length-1] !== '/'){\n url += '/';\n }\n\n return url;\n };\n\n EsriLeaflet.Util.isArcgisOnline = function(url){\n return (/\\.arcgis\\.com/g).test(url);\n };\n\n EsriLeaflet.Util.geojsonTypeToArcGIS = function (geoJsonType) {\n var arcgisGeometryType;\n switch (geoJsonType) {\n case 'Point':\n arcgisGeometryType = 'esriGeometryPoint';\n break;\n case 'MultiPoint':\n arcgisGeometryType = 'esriGeometryMultipoint';\n break;\n case 'LineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'MultiLineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'Polygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n case 'MultiPolygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n }\n return arcgisGeometryType;\n };\n\n EsriLeaflet.Util.requestAnimationFrame = L.Util.bind(raf, window);\n\n})(EsriLeaflet);","(function(EsriLeaflet){\n\n var callbacks = 0;\n\n window._EsriLeafletCallbacks = {};\n\n function serialize(params){\n var data = '';\n\n params.f = params.f || 'json';\n\n for (var key in params){\n if(params.hasOwnProperty(key)){\n var param = params[key];\n var type = Object.prototype.toString.call(param);\n var value;\n\n if(data.length){\n data += '&';\n }\n\n if (type === '[object Array]'){\n value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');\n } else if (type === '[object Object]') {\n value = JSON.stringify(param);\n } else if (type === '[object Date]'){\n value = param.valueOf();\n } else {\n value = param;\n }\n\n data += encodeURIComponent(key) + '=' + encodeURIComponent(value);\n }\n }\n\n return data;\n }\n\n function createRequest(callback, context){\n var httpRequest = new XMLHttpRequest();\n\n httpRequest.onerror = function(e) {\n httpRequest.onreadystatechange = L.Util.falseFn;\n\n callback.call(context, {\n error: {\n code: 500,\n message: 'XMLHttpRequest error'\n }\n }, null);\n };\n\n httpRequest.onreadystatechange = function(){\n var response;\n var error;\n\n if (httpRequest.readyState === 4) {\n try {\n response = JSON.parse(httpRequest.responseText);\n } catch(e) {\n response = null;\n error = {\n code: 500,\n message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'\n };\n }\n\n if (!error && response.error) {\n error = response.error;\n response = null;\n }\n\n httpRequest.onerror = L.Util.falseFn;\n\n callback.call(context, error, response);\n }\n };\n\n return httpRequest;\n }\n\n // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)\n EsriLeaflet.Request = {\n request: function(url, params, callback, context){\n var paramString = serialize(params);\n var httpRequest = createRequest(callback, context);\n var requestLength = (url + '?' + paramString).length;\n\n // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest\n if(requestLength <= 2000 && L.esri.Support.CORS){\n httpRequest.open('GET', url + '?' + paramString);\n httpRequest.send(null);\n\n // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest\n } else if (requestLength > 2000 && L.esri.Support.CORS){\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(paramString);\n\n // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request\n } else if(requestLength <= 2000 && !L.esri.Support.CORS){\n return L.esri.Request.get.JSONP(url, params, callback, context);\n\n // request is longer then 2000 characters and the browser does not support CORS, log a warning\n } else {\n if(console && console.warn){\n console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');\n return;\n }\n }\n\n return httpRequest;\n },\n post: {\n XMLHTTP: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(serialize(params));\n\n return httpRequest;\n }\n },\n\n get: {\n CORS: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n\n httpRequest.open('GET', url + '?' + serialize(params), true);\n httpRequest.send(null);\n\n return httpRequest;\n },\n JSONP: function(url, params, callback, context){\n var callbackId = 'c' + callbacks;\n\n params.callback = 'window._EsriLeafletCallbacks.' + callbackId;\n\n var script = L.DomUtil.create('script', null, document.body);\n script.type = 'text/javascript';\n script.src = url + '?' + serialize(params);\n script.id = callbackId;\n\n window._EsriLeafletCallbacks[callbackId] = function(response){\n if(window._EsriLeafletCallbacks[callbackId] !== true){\n var error;\n var responseType = Object.prototype.toString.call(response);\n\n if(!(responseType === '[object Object]' || responseType === '[object Array]')){\n error = {\n error: {\n code: 500,\n message: 'Expected array or object as JSONP response'\n }\n };\n response = null;\n }\n\n if (!error && response.error) {\n error = response;\n response = null;\n }\n\n callback.call(context, error, response);\n window._EsriLeafletCallbacks[callbackId] = true;\n }\n };\n\n callbacks++;\n\n return {\n id: callbackId,\n url: script.src,\n abort: function(){\n window._EsriLeafletCallbacks._callback[callbackId]({\n code: 0,\n message: 'Request aborted.'\n });\n }\n };\n }\n }\n };\n\n // choose the correct AJAX handler depending on CORS support\n EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;\n\n // always use XMLHttpRequest for posts\n EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;\n\n // expose a common request method the uses GET\\POST based on request length\n EsriLeaflet.request = EsriLeaflet.Request.request;\n\n})(EsriLeaflet);","EsriLeaflet.Services.Service = L.Class.extend({\n\n includes: L.Mixin.Events,\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n initialize: function (options) {\n options = options || {};\n this._requestQueue = [];\n this._authenticating = false;\n L.Util.setOptions(this, options);\n this.options.url = EsriLeaflet.Util.cleanUrl(this.options.url);\n },\n\n get: function (path, params, callback, context) {\n return this._request('get', path, params, callback, context);\n },\n\n post: function (path, params, callback, context) {\n return this._request('post', path, params, callback, context);\n },\n\n request: function (path, params, callback, context) {\n return this._request('request', path, params, callback, context);\n },\n\n metadata: function (callback, context) {\n return this._request('get', '', {}, callback, context);\n },\n\n authenticate: function(token){\n this._authenticating = false;\n this.options.token = token;\n this._runQueue();\n return this;\n },\n\n _request: function(method, path, params, callback, context){\n this.fire('requeststart', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n\n var wrappedCallback = this._createServiceCallback(method, path, params, callback, context);\n\n if (this.options.token) {\n params.token = this.options.token;\n }\n\n if (this._authenticating) {\n this._requestQueue.push([method, path, params, callback, context]);\n return;\n } else {\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, wrappedCallback);\n } else {\n return EsriLeaflet[method](url, params, wrappedCallback);\n }\n }\n },\n\n _createServiceCallback: function(method, path, params, callback, context){\n var request = [method, path, params, callback, context];\n\n return L.Util.bind(function(error, response){\n\n if (error && (error.code === 499 || error.code === 498)) {\n this._authenticating = true;\n\n this._requestQueue.push(request);\n\n this.fire('authenticationrequired', {\n authenticate: L.Util.bind(this.authenticate, this)\n });\n } else {\n callback.call(context, error, response);\n\n if(error) {\n this.fire('requesterror', {\n url: this.options.url + path,\n params: params,\n message: error.message,\n code: error.code,\n method: method\n });\n } else {\n this.fire('requestsuccess', {\n url: this.options.url + path,\n params: params,\n response: response,\n method: method\n });\n }\n\n this.fire('requestend', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n }\n }, this);\n },\n\n _runQueue: function(){\n for (var i = this._requestQueue.length - 1; i >= 0; i--) {\n var request = this._requestQueue[i];\n var method = request.shift();\n this[method].apply(this, request);\n }\n this._requestQueue = [];\n }\n\n});\n\nEsriLeaflet.Services.service = function(params){\n return new EsriLeaflet.Services.Service(params);\n};","EsriLeaflet.Services.MapService = EsriLeaflet.Services.Service.extend({\n\n identify: function () {\n return new EsriLeaflet.Tasks.identifyFeatures(this);\n },\n\n find: function () {\n return new EsriLeaflet.Tasks.Find(this);\n },\n\n query: function () {\n return new EsriLeaflet.Tasks.Query(this);\n }\n\n});\n\nEsriLeaflet.Services.mapService = function(params){\n return new EsriLeaflet.Services.MapService(params);\n};","EsriLeaflet.Tasks.Task = L.Class.extend({\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n //Generate a method for each methodName:paramName in the setters for this task.\n generateSetter: function(param, context){\n return L.Util.bind(function(value){\n this.params[param] = value;\n return this;\n }, context);\n },\n\n initialize: function(endpoint){\n // endpoint can be either a url (and options) for an ArcGIS Rest Service or an instance of EsriLeaflet.Service\n if(endpoint.request && endpoint.options){\n this._service = endpoint;\n L.Util.setOptions(this, endpoint.options);\n } else {\n L.Util.setOptions(this, endpoint);\n this.options.url = L.esri.Util.cleanUrl(endpoint.url);\n }\n\n // clone default params into this object\n this.params = L.Util.extend({}, this.params || {});\n\n // generate setter methods based on the setters object implimented a child class\n if(this.setters){\n for (var setter in this.setters){\n var param = this.setters[setter];\n this[setter] = this.generateSetter(param, this);\n }\n }\n },\n\n token: function(token){\n if(this._service){\n this._service.authenticate(token);\n } else {\n this.params.token = token;\n }\n return this;\n },\n\n request: function(callback, context){\n if(this._service){\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n },\n\n _request: function(method, path, params, callback, context){\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, callback, context);\n } else{\n return EsriLeaflet[method](url, params, callback, context);\n }\n }\n});","EsriLeaflet.Tasks.Identify = EsriLeaflet.Tasks.Task.extend({\n path: 'identify',\n\n between: function(start, end){\n this.params.time = [start.valueOf(), end.valueOf()];\n return this;\n }\n});\n","EsriLeaflet.Tasks.IdentifyFeatures = EsriLeaflet.Tasks.Identify.extend({\n setters: {\n 'layers': 'layers',\n 'precision': 'geometryPrecision',\n 'tolerance': 'tolerance',\n 'returnGeometry': 'returnGeometry'\n },\n\n params: {\n sr: 4326,\n layers: 'all',\n tolerance: 3,\n returnGeometry: true\n },\n\n on: function(map){\n var extent = EsriLeaflet.Util.boundsToExtent(map.getBounds());\n var size = map.getSize();\n this.params.imageDisplay = [size.x, size.y, 96];\n this.params.mapExtent = [extent.xmin, extent.ymin, extent.xmax, extent.ymax];\n return this;\n },\n\n at: function(latlng){\n latlng = L.latLng(latlng);\n this.params.geometry = [latlng.lng, latlng.lat];\n this.params.geometryType = 'esriGeometryPoint';\n return this;\n },\n\n layerDef: function (id, where){\n this.params.layerDefs = (this.params.layerDefs) ? this.params.layerDefs + ';' : '';\n this.params.layerDefs += ([id, where]).join(':');\n return this;\n },\n\n simplify: function(map, factor){\n var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());\n this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * (1 - factor);\n return this;\n },\n\n run: function (callback, context){\n return this.request(function(error, response){\n var featureCollection = EsriLeaflet.Util.responseToFeatureCollection(response);\n var count = featureCollection.features.length;\n // tag each feature with the Id of its parent layer\n if(!error && count > 0){\n response.results = response.results.reverse();\n for (var i = 0; i < count; i++) {\n var feature = featureCollection.features[i];\n feature.layerId = response.results[i].layerId;\n }\n }\n callback.call(context, error, (response && featureCollection), response);\n }, context);\n }\n\n});\n\nEsriLeaflet.Tasks.identifyFeatures = function(params){\n return new EsriLeaflet.Tasks.IdentifyFeatures(params);\n};","EsriLeaflet.Tasks.Query = EsriLeaflet.Tasks.Task.extend({\n setters: {\n 'offset': 'offset',\n 'limit': 'limit',\n 'fields': 'outFields',\n 'precision': 'geometryPrecision',\n 'featureIds': 'objectIds',\n 'returnGeometry': 'returnGeometry',\n 'token': 'token'\n },\n\n path: 'query',\n\n params: {\n returnGeometry: true,\n where: '1=1',\n outSr: 4326,\n outFields: '*'\n },\n\n within: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelContains'; // will make code read layer within geometry, to the api this will reads geometry contains layer\n return this;\n },\n\n intersects: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelIntersects';\n return this;\n },\n\n contains: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelWithin'; // will make code read layer contains geometry, to the api this will reads geometry within layer\n return this;\n },\n\n // crosses: function(geometry){\n // this._setGeometry(geometry);\n // this.params.spatialRel = 'esriSpatialRelCrosses';\n // return this;\n // },\n\n // touches: function(geometry){\n // this._setGeometry(geometry);\n // this.params.spatialRel = 'esriSpatialRelTouches';\n // return this;\n // },\n\n overlaps: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelOverlaps';\n return this;\n },\n\n // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online\n nearby: function(latlng, radius){\n latlng = L.latLng(latlng);\n this.params.geometry = [latlng.lng, latlng.lat];\n this.params.geometryType = 'esriGeometryPoint';\n this.params.spatialRel = 'esriSpatialRelIntersects';\n this.params.units = 'esriSRUnit_Meter';\n this.params.distance = radius;\n this.params.inSr = 4326;\n return this;\n },\n\n where: function(string){\n this.params.where = string.replace(/\"/g, \"\\'\"); // jshint ignore:line\n return this;\n },\n\n between: function(start, end){\n this.params.time = [start.valueOf(), end.valueOf()];\n return this;\n },\n\n simplify: function(map, factor){\n var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());\n this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;\n return this;\n },\n\n orderBy: function(fieldName, order){\n order = order || 'ASC';\n this.params.orderByFields = (this.params.orderByFields) ? this.params.orderByFields + ',' : '';\n this.params.orderByFields += ([fieldName, order]).join(' ');\n return this;\n },\n\n run: function(callback, context){\n this._cleanParams();\n\n // if the service is hosted on arcgis online request geojson directly\n if(EsriLeaflet.Util.isArcgisOnline(this.options.url)){\n this.params.f = 'geojson';\n\n return this.request(function(error, response){\n callback.call(context, error, response, response);\n }, context);\n\n // otherwise convert it in the callback then pass it on\n } else {\n return this.request(function(error, response){\n callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);\n }, context);\n }\n },\n\n count: function(callback, context){\n this._cleanParams();\n this.params.returnCountOnly = true;\n return this.request(function(error, response){\n callback.call(this, error, (response && response.count), response);\n }, context);\n },\n\n ids: function(callback, context){\n this._cleanParams();\n this.params.returnIdsOnly = true;\n return this.request(function(error, response){\n callback.call(this, error, (response && response.objectIds), response);\n }, context);\n },\n\n // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online\n bounds: function(callback, context){\n this._cleanParams();\n this.params.returnExtentOnly = true;\n return this.request(function(error, response){\n callback.call(context, error, (response && response.extent && EsriLeaflet.Util.extentToBounds(response.extent)), response);\n }, context);\n },\n\n // only valid for image services\n pixelSize: function(point){\n point = L.point(point);\n this.params.pixelSize = [point.x,point.y];\n return this;\n },\n\n // only valid for map services\n layer: function(layer){\n this.path = layer + '/query';\n return this;\n },\n\n _cleanParams: function(){\n delete this.params.returnIdsOnly;\n delete this.params.returnExtentOnly;\n delete this.params.returnCountOnly;\n },\n\n _setGeometry: function(geometry) {\n this.params.inSr = 4326;\n\n // convert bounds to extent and finish\n if ( geometry instanceof L.LatLngBounds ) {\n // set geometry + geometryType\n this.params.geometry = EsriLeaflet.Util.boundsToExtent(geometry);\n this.params.geometryType = 'esriGeometryEnvelope';\n return;\n }\n\n // convert L.Marker > L.LatLng\n if(geometry.getLatLng){\n geometry = geometry.getLatLng();\n }\n\n // convert L.LatLng to a geojson point and continue;\n if (geometry instanceof L.LatLng) {\n geometry = {\n type: 'Point',\n coordinates: [geometry.lng, geometry.lat]\n };\n }\n\n // handle L.GeoJSON, pull out the first geometry\n if ( geometry instanceof L.GeoJSON ) {\n //reassign geometry to the GeoJSON value (we are assuming that only one feature is present)\n geometry = geometry.getLayers()[0].feature.geometry;\n this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);\n this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);\n }\n\n // Handle L.Polyline and L.Polygon\n if (geometry.toGeoJSON) {\n geometry = geometry.toGeoJSON();\n }\n\n // handle GeoJSON feature by pulling out the geometry\n if ( geometry.type === 'Feature' ) {\n // get the geometry of the geojson feature\n geometry = geometry.geometry;\n }\n\n // confirm that our GeoJSON is a point, line or polygon\n if ( geometry.type === 'Point' || geometry.type === 'LineString' || geometry.type === 'Polygon') {\n this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);\n this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);\n return;\n }\n\n // warn the user if we havn't found a\n /* global console */\n if(console && console.warn) {\n console.warn('invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object');\n }\n\n return;\n }\n});\n\nEsriLeaflet.Tasks.query = function(params){\n return new EsriLeaflet.Tasks.Query(params);\n};","EsriLeaflet.Tasks.Find = EsriLeaflet.Tasks.Task.extend({\n setters: {\n // method name > param name\n 'contains': 'contains',\n 'text': 'searchText',\n 'fields': 'searchFields', // denote an array or single string\n 'spatialReference': 'sr',\n 'sr': 'sr',\n 'layers': 'layers',\n 'returnGeometry': 'returnGeometry',\n 'maxAllowableOffset': 'maxAllowableOffset',\n 'precision': 'geometryPrecision',\n 'dynamicLayers': 'dynamicLayers',\n 'returnZ' : 'returnZ',\n 'returnM' : 'returnM',\n 'gdbVersion' : 'gdbVersion',\n 'token' : 'token'\n },\n\n path: 'find',\n\n params: {\n sr: 4326,\n contains: true,\n returnGeometry: true,\n returnZ: true,\n returnM: false\n },\n\n layerDefs: function (id, where) {\n this.params.layerDefs = (this.params.layerDefs) ? this.params.layerDefs + ';' : '';\n this.params.layerDefs += ([id, where]).join(':');\n return this;\n },\n\n simplify: function(map, factor){\n var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());\n this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;\n return this;\n },\n\n run: function (callback, context) {\n return this.request(function(error, response){\n callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);\n }, context);\n }\n});\n\nEsriLeaflet.Tasks.find = function (params) {\n return new EsriLeaflet.Tasks.Find(params);\n};","EsriLeaflet.Layers.RasterLayer = L.Class.extend({\n includes: L.Mixin.Events,\n\n options: {\n opacity: 1,\n position: 'front',\n f: 'image'\n },\n\n onAdd: function (map) {\n this._map = map;\n\n this._update = L.Util.limitExecByInterval(this._update, this.options.updateInterval, this);\n\n if (map.options.crs && map.options.crs.code) {\n var sr = map.options.crs.code.split(':')[1];\n this.options.bboxSR = sr;\n this.options.imageSR = sr;\n }\n\n map.on('moveend', this._update, this);\n\n // if we had an image loaded and it matches the\n // current bounds show the image otherwise remove it\n if(this._currentImage && this._currentImage._bounds.equals(this._map.getBounds())){\n map.addLayer(this._currentImage);\n } else if(this._currentImage) {\n this._map.removeLayer(this._currentImage);\n this._currentImage = null;\n }\n\n this._update();\n\n if(this._popup){\n this._map.on('click', this._getPopupData, this);\n this._map.on('dblclick', this._resetPopupState, this);\n }\n },\n\n bindPopup: function(fn, popupOptions){\n this._shouldRenderPopup = false;\n this._lastClick = false;\n this._popup = L.popup(popupOptions);\n this._popupFunction = fn;\n if(this._map){\n this._map.on('click', this._getPopupData, this);\n this._map.on('dblclick', this._resetPopupState, this);\n }\n return this;\n },\n\n unbindPopup: function(){\n if(this._map){\n this._map.closePopup(this._popup);\n this._map.off('click', this._getPopupData, this);\n this._map.off('dblclick', this._resetPopupState, this);\n }\n this._popup = false;\n return this;\n },\n\n onRemove: function (map) {\n if (this._currentImage) {\n this._map.removeLayer(this._currentImage);\n }\n\n if(this._popup){\n this._map.off('click', this._getPopupData, this);\n this._map.off('dblclick', this._resetPopupState, this);\n }\n\n this._map.off('moveend', this._update, this);\n this._map = null;\n },\n\n addTo: function(map){\n map.addLayer(this);\n return this;\n },\n\n removeFrom: function(map){\n map.removeLayer(this);\n return this;\n },\n\n bringToFront: function(){\n this.options.position = 'front';\n if(this._currentImage){\n this._currentImage.bringToFront();\n }\n return this;\n },\n\n bringToBack: function(){\n this.options.position = 'back';\n if(this._currentImage){\n this._currentImage.bringToBack();\n }\n return this;\n },\n\n getAttribution: function () {\n return this.options.attribution;\n },\n\n getOpacity: function(){\n return this.options.opacity;\n },\n\n setOpacity: function(opacity){\n this.options.opacity = opacity;\n this._currentImage.setOpacity(opacity);\n return this;\n },\n\n getTimeRange: function(){\n return [this.options.from, this.options.to];\n },\n\n setTimeRange: function(from, to){\n this.options.from = from;\n this.options.to = to;\n this._update();\n return this;\n },\n\n metadata: function(callback, context){\n this._service.metadata(callback, context);\n return this;\n },\n\n authenticate: function(token){\n this._service.authenticate(token);\n return this;\n },\n\n _renderImage: function(url, bounds){\n if(this._map){\n // create a new image overlay and add it to the map\n // to start loading the image\n // opacity is 0 while the image is loading\n var image = new L.ImageOverlay(url, bounds, {\n opacity: 0\n }).addTo(this._map);\n\n // once the image loads\n image.once('load', function(e){\n var newImage = e.target;\n var oldImage = this._currentImage;\n\n // if the bounds of this image matches the bounds that\n // _renderImage was called with and we have a map\n // hide the old image if there is one and set the opacity\n // of the new image otherwise remove the new image\n if(newImage._bounds.equals(bounds)){\n this._currentImage = newImage;\n\n if(this.options.position === 'front'){\n this.bringToFront();\n } else {\n this.bringToBack();\n }\n\n if(this._map && this._currentImage._map){\n this._currentImage.setOpacity(this.options.opacity);\n } else {\n this._currentImage._map.removeLayer(this._currentImage);\n }\n\n if(oldImage && this._map) {\n this._map.removeLayer(oldImage);\n }\n\n if(oldImage && oldImage._map){\n oldImage._map.removeLayer(oldImage);\n }\n } else {\n this._map.removeLayer(newImage);\n }\n\n this.fire('load', {\n bounds: bounds\n });\n\n }, this);\n\n this.fire('loading', {\n bounds: bounds\n });\n }\n },\n\n _update: function () {\n if(!this._map){\n return;\n }\n\n var zoom = this._map.getZoom();\n var bounds = this._map.getBounds();\n\n if(this._animatingZoom){\n return;\n }\n\n if (this._map._panTransition && this._map._panTransition._inProgress) {\n return;\n }\n\n if (zoom > this.options.maxZoom || zoom < this.options.minZoom) {\n return;\n }\n var params = this._buildExportParams();\n\n this._requestExport(params, bounds);\n },\n\n // TODO: refactor these into raster layer\n _renderPopup: function(latlng, error, results, response){\n latlng = L.latLng(latlng);\n if(this._shouldRenderPopup && this._lastClick.equals(latlng)){\n //add the popup to the map where the mouse was clicked at\n var content = this._popupFunction(error, results, response);\n if (content) {\n this._popup.setLatLng(latlng).setContent(content).openOn(this._map);\n }\n }\n },\n\n _resetPopupState: function(e){\n this._shouldRenderPopup = false;\n this._lastClick = e.latlng;\n },\n\n // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js\n // @TODO remove at Leaflet 0.8\n _propagateEvent: function (e) {\n e = L.extend({\n layer: e.target,\n target: this\n }, e);\n this.fire(e.type, e);\n }\n});","EsriLeaflet.Layers.DynamicMapLayer = EsriLeaflet.Layers.RasterLayer.extend({\n\n options: {\n updateInterval: 150,\n layers: false,\n layerDefs: false,\n timeOptions: false,\n format: 'png24',\n transparent: true\n },\n\n initialize: function (url, options) {\n options = options || {};\n options.url = EsriLeaflet.Util.cleanUrl(url);\n this._service = new EsriLeaflet.Services.MapService(options);\n this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);\n if (options.proxy){\n options.f = 'json';\n }\n L.Util.setOptions(this, options);\n },\n\n getLayers: function(){\n return this.options.layers;\n },\n\n setLayers: function(layers){\n this.options.layers = layers;\n this._update();\n return this;\n },\n\n getLayerDefs: function(){\n return this.options.layerDefs;\n },\n\n setLayerDefs: function(layerDefs){\n this.options.layerDefs = layerDefs;\n this._update();\n return this;\n },\n\n getTimeOptions: function(){\n return this.options.timeOptions;\n },\n\n setTimeOptions: function(timeOptions){\n this.options.timeOptions = timeOptions;\n this._update();\n return this;\n },\n\n query: function(){\n return this._service.query();\n },\n\n identify: function(){\n return this._service.identify();\n },\n\n find: function(){\n return this._service.find();\n },\n\n _getPopupData: function(e){\n var callback = L.Util.bind(function(error, featureCollection, response) {\n setTimeout(L.Util.bind(function(){\n this._renderPopup(e.latlng, error, featureCollection, response);\n }, this), 300);\n }, this);\n\n var identifyRequest = this.identify().on(this._map).at(e.latlng);\n\n if(this.options.layers){\n identifyRequest.layers('visible:' + this.options.layers.join(','));\n } else {\n identifyRequest.layers('visible');\n }\n\n identifyRequest.run(callback);\n\n // set the flags to show the popup\n this._shouldRenderPopup = true;\n this._lastClick = e.latlng;\n },\n\n _buildExportParams: function () {\n var bounds = this._map.getBounds();\n var size = this._map.getSize();\n var ne = this._map.options.crs.project(bounds._northEast);\n var sw = this._map.options.crs.project(bounds._southWest);\n\n var params = {\n bbox: [sw.x, sw.y, ne.x, ne.y].join(','),\n size: size.x + ',' + size.y,\n dpi: 96,\n format: this.options.format,\n transparent: this.options.transparent,\n bboxSR: this.options.bboxSR,\n imageSR: this.options.imageSR\n };\n\n if(this.options.layers){\n params.layers = 'show:' + this.options.layers.join(',');\n }\n\n if(this.options.layerDefs){\n params.layerDefs = JSON.stringify(this.options.layerDefs);\n }\n\n if(this.options.timeOptions){\n params.timeOptions = JSON.stringify(this.options.timeOptions);\n }\n\n if(this.options.from && this.options.to){\n params.time = this.options.from.valueOf() + ',' + this.options.to.valueOf();\n }\n\n if(this._service.options.token) {\n params.token = this._service.options.token;\n }\n\n return params;\n },\n\n _requestExport: function (params, bounds) {\n if(this.options.f === 'json'){\n this._service.get('export', params, function(error, response){\n this._renderImage(response.href, bounds);\n }, this);\n } else {\n params.f = 'image';\n this._renderImage(this.options.url + 'export' + L.Util.getParamString(params), bounds);\n }\n }\n});\n\nEsriLeaflet.DynamicMapLayer = EsriLeaflet.Layers.DynamicMapLayer;\n\nEsriLeaflet.Layers.dynamicMapLayer = function(url, options){\n return new EsriLeaflet.Layers.DynamicMapLayer(url, options);\n};\n\nEsriLeaflet.dynamicMapLayer = function(url, options){\n return new EsriLeaflet.Layers.DynamicMapLayer(url, options);\n};","EsriLeaflet.Layers.TiledMapLayer = L.TileLayer.extend({\n initialize: function(url, options){\n options = options || {};\n options.url = EsriLeaflet.Util.cleanUrl(url);\n options = L.Util.setOptions(this, options);\n\n // set the urls\n //this.url = L.esri.Util.cleanUrl(url);\n this.tileUrl = L.esri.Util.cleanUrl(url) + 'tile/{z}/{y}/{x}';\n this._service = new L.esri.Services.MapService(options);\n this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);\n\n //if this is looking at the AGO tiles subdomain insert the subdomain placeholder\n if(this.tileUrl.match('://tiles.arcgisonline.com')){\n this.tileUrl = this.tileUrl.replace('://tiles.arcgisonline.com', '://tiles{s}.arcgisonline.com');\n options.subdomains = ['1', '2', '3', '4'];\n }\n\n if(this.options.token) {\n this.tileUrl += ('?token=' + this.options.token);\n }\n\n // init layer by calling TileLayers initialize method\n L.TileLayer.prototype.initialize.call(this, this.tileUrl, options);\n },\n\n metadata: function(callback, context){\n this._service.metadata(callback, context);\n return this;\n },\n\n identify: function(){\n return this._service.identify();\n },\n\n authenticate: function(token){\n var tokenQs = '?token=' + token;\n this.tileUrl = (this.options.token) ? this.tileUrl.replace(/\\?token=(.+)/g, tokenQs) : this.tileUrl + tokenQs;\n this.options.token = token;\n this._service.authenticate(token);\n return this;\n },\n\n // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js\n // @TODO remove at Leaflet 0.8\n _propagateEvent: function (e) {\n e = L.extend({\n layer: e.target,\n target: this\n }, e);\n this.fire(e.type, e);\n }\n});\n\nL.esri.TiledMapLayer = L.esri.Layers.tiledMapLayer;\n\nL.esri.Layers.tiledMapLayer = function(url, options){\n return new L.esri.Layers.TiledMapLayer(url, options);\n};\n\nL.esri.tiledMapLayer = function(url, options){\n return new L.esri.Layers.TiledMapLayer(url, options);\n};"]}
\ No newline at end of file
diff --git a/dist/builds/map-service/esri-leaflet-map-service.js b/dist/builds/map-service/esri-leaflet-map-service.js
new file mode 100644
index 000000000..ef2e12da1
--- /dev/null
+++ b/dist/builds/map-service/esri-leaflet-map-service.js
@@ -0,0 +1,24 @@
+/*! esri-leaflet - v1.0.0-rc.6 - 2015-03-05
+* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
+* Apache License*/
+(function (factory) {
+ //define an AMD module that relies on 'leaflet'
+ if (typeof define === 'function' && define.amd) {
+ define(['leaflet'], function (L) {
+ return factory(L);
+ });
+ //define a common js module that relies on 'leaflet'
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ module.exports = factory(require('leaflet'));
+ }
+
+ if(typeof window !== 'undefined' && window.L){
+ factory(window.L);
+ }
+}(function (L) {
+
+var EsriLeaflet={VERSION:"1.0.0-rc.5",Layers:{},Services:{},Controls:{},Tasks:{},Util:{},Support:{CORS:!!(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),pointerEvents:""===document.documentElement.style.pointerEvents}};"undefined"!=typeof window&&window.L&&(window.L.esri=EsriLeaflet),function(a){function b(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function c(a,b){for(var c=0;cd;d++)b=a[d+1],c+=(b[0]-f[0])*(b[1]+f[1]),f=b;return c>=0}function f(a,b,c,d){var e=(d[0]-c[0])*(a[1]-c[1])-(d[1]-c[1])*(a[0]-c[0]),f=(b[0]-a[0])*(a[1]-c[1])-(b[1]-a[1])*(a[0]-c[0]),g=(d[1]-c[1])*(b[0]-a[0])-(d[0]-c[0])*(b[1]-a[1]);if(0!==g){var h=e/g,i=f/g;if(h>=0&&1>=h&&i>=0&&1>=i)return!0}return!1}function g(a,b){for(var c=0;c=0;b--)if(c=h[b][0],i(c,f)){h[b].push(f),o=!0;break}o||n.push(f)}for(;n.length;){f=n.pop();var p=!1;for(b=h.length-1;b>=0;b--)if(c=h[b][0],g(c,f)){h[b].push(f),p=!0;break}p||h.push([f.reverse()])}return 1===h.length?{type:"Polygon",coordinates:h[0]}:{type:"MultiPolygon",coordinates:h}}function k(a){var b=[],c=a.slice(0),f=d(c.shift().slice(0));if(f.length>=4){e(f)||f.reverse(),b.push(f);for(var g=0;g=4&&(e(h)&&h.reverse(),b.push(h))}}return b}function l(a){for(var b=[],c=0;c=0;e--){var f=d[e].slice(0);b.push(f)}return b}var m=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(a){return window.setTimeout(a,1e3/60)};a.Util.extentToBounds=function(a){var b=new L.LatLng(a.ymin,a.xmin),c=new L.LatLng(a.ymax,a.xmax);return new L.LatLngBounds(b,c)},a.Util.boundsToExtent=function(a){return a=L.latLngBounds(a),{xmin:a.getSouthWest().lng,ymin:a.getSouthWest().lat,xmax:a.getNorthEast().lng,ymax:a.getNorthEast().lat,spatialReference:{wkid:4326}}},a.Util.arcgisToGeojson=function(c,d){var e={};return"number"==typeof c.x&&"number"==typeof c.y&&(e.type="Point",e.coordinates=[c.x,c.y]),c.points&&(e.type="MultiPoint",e.coordinates=c.points.slice(0)),c.paths&&(1===c.paths.length?(e.type="LineString",e.coordinates=c.paths[0].slice(0)):(e.type="MultiLineString",e.coordinates=c.paths.slice(0))),c.rings&&(e=j(c.rings.slice(0))),(c.geometry||c.attributes)&&(e.type="Feature",e.geometry=c.geometry?a.Util.arcgisToGeojson(c.geometry):null,e.properties=c.attributes?b(c.attributes):null,c.attributes&&(e.id=c.attributes[d]||c.attributes.OBJECTID||c.attributes.FID)),e},a.Util.geojsonToArcGIS=function(c,d){d=d||"OBJECTID";var e,f={wkid:4326},g={};switch(c.type){case"Point":g.x=c.coordinates[0],g.y=c.coordinates[1],g.spatialReference=f;break;case"MultiPoint":g.points=c.coordinates.slice(0),g.spatialReference=f;break;case"LineString":g.paths=[c.coordinates.slice(0)],g.spatialReference=f;break;case"MultiLineString":g.paths=c.coordinates.slice(0),g.spatialReference=f;break;case"Polygon":g.rings=k(c.coordinates.slice(0)),g.spatialReference=f;break;case"MultiPolygon":g.rings=l(c.coordinates.slice(0)),g.spatialReference=f;break;case"Feature":c.geometry&&(g.geometry=a.Util.geojsonToArcGIS(c.geometry,d)),g.attributes=c.properties?b(c.properties):{},c.id&&(g.attributes[d]=c.id);break;case"FeatureCollection":for(g=[],e=0;e=0;h--)f.features.push(a.Util.arcgisToGeojson(g[h],d));return f},a.Util.cleanUrl=function(a){return a=a.replace(/\s\s*/g,""),"/"!==a[a.length-1]&&(a+="/"),a},a.Util.isArcgisOnline=function(a){return/\.arcgis\.com/g.test(a)},a.Util.geojsonTypeToArcGIS=function(a){var b;switch(a){case"Point":b="esriGeometryPoint";break;case"MultiPoint":b="esriGeometryMultipoint";break;case"LineString":b="esriGeometryPolyline";break;case"MultiLineString":b="esriGeometryPolyline";break;case"Polygon":b="esriGeometryPolygon";break;case"MultiPolygon":b="esriGeometryPolygon"}return b},a.Util.requestAnimationFrame=L.Util.bind(m,window)}(EsriLeaflet),function(a){function b(a){var b="";a.f=a.f||"json";for(var c in a)if(a.hasOwnProperty(c)){var d,e=a[c],f=Object.prototype.toString.call(e);b.length&&(b+="&"),d="[object Array]"===f?"[object Object]"===Object.prototype.toString.call(e[0])?JSON.stringify(e):e.join(","):"[object Object]"===f?JSON.stringify(e):"[object Date]"===f?e.valueOf():e,b+=encodeURIComponent(c)+"="+encodeURIComponent(d)}return b}function c(a,b){var c=new XMLHttpRequest;return c.onerror=function(){c.onreadystatechange=L.Util.falseFn,a.call(b,{error:{code:500,message:"XMLHttpRequest error"}},null)},c.onreadystatechange=function(){var d,e;if(4===c.readyState){try{d=JSON.parse(c.responseText)}catch(f){d=null,e={code:500,message:"Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error."}}!e&&d.error&&(e=d.error,d=null),c.onerror=L.Util.falseFn,a.call(b,e,d)}},c}var d=0;window._EsriLeafletCallbacks={},a.Request={request:function(a,d,e,f){var g=b(d),h=c(e,f),i=(a+"?"+g).length;if(2e3>=i&&L.esri.Support.CORS)h.open("GET",a+"?"+g),h.send(null);else if(i>2e3&&L.esri.Support.CORS)h.open("POST",a),h.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),h.send(g);else{if(2e3>=i&&!L.esri.Support.CORS)return L.esri.Request.get.JSONP(a,d,e,f);if(console&&console.warn)return void console.warn("a request to "+a+" was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html")}return h},post:{XMLHTTP:function(a,d,e,f){var g=c(e,f);return g.open("POST",a),g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),g.send(b(d)),g}},get:{CORS:function(a,d,e,f){var g=c(e,f);return g.open("GET",a+"?"+b(d),!0),g.send(null),g},JSONP:function(a,c,e,f){var g="c"+d;c.callback="window._EsriLeafletCallbacks."+g;var h=L.DomUtil.create("script",null,document.body);return h.type="text/javascript",h.src=a+"?"+b(c),h.id=g,window._EsriLeafletCallbacks[g]=function(a){if(window._EsriLeafletCallbacks[g]!==!0){var b,c=Object.prototype.toString.call(a);"[object Object]"!==c&&"[object Array]"!==c&&(b={error:{code:500,message:"Expected array or object as JSONP response"}},a=null),!b&&a.error&&(b=a,a=null),e.call(f,b,a),window._EsriLeafletCallbacks[g]=!0}},d++,{id:g,url:h.src,abort:function(){window._EsriLeafletCallbacks._callback[g]({code:0,message:"Request aborted."})}}}}},a.get=a.Support.CORS?a.Request.get.CORS:a.Request.get.JSONP,a.post=a.Request.post.XMLHTTP,a.request=a.Request.request}(EsriLeaflet),EsriLeaflet.Services.Service=L.Class.extend({includes:L.Mixin.Events,options:{proxy:!1,useCors:EsriLeaflet.Support.CORS},initialize:function(a){a=a||{},this._requestQueue=[],this._authenticating=!1,L.Util.setOptions(this,a),this.options.url=EsriLeaflet.Util.cleanUrl(this.options.url)},get:function(a,b,c,d){return this._request("get",a,b,c,d)},post:function(a,b,c,d){return this._request("post",a,b,c,d)},request:function(a,b,c,d){return this._request("request",a,b,c,d)},metadata:function(a,b){return this._request("get","",{},a,b)},authenticate:function(a){return this._authenticating=!1,this.options.token=a,this._runQueue(),this},_request:function(a,b,c,d,e){this.fire("requeststart",{url:this.options.url+b,params:c,method:a});var f=this._createServiceCallback(a,b,c,d,e);if(this.options.token&&(c.token=this.options.token),this._authenticating)return void this._requestQueue.push([a,b,c,d,e]);var g=this.options.proxy?this.options.proxy+"?"+this.options.url+b:this.options.url+b;return"get"!==a&&"request"!==a||this.options.useCors?EsriLeaflet[a](g,c,f):EsriLeaflet.Request.get.JSONP(g,c,f)},_createServiceCallback:function(a,b,c,d,e){var f=[a,b,c,d,e];return L.Util.bind(function(g,h){!g||499!==g.code&&498!==g.code?(d.call(e,g,h),g?this.fire("requesterror",{url:this.options.url+b,params:c,message:g.message,code:g.code,method:a}):this.fire("requestsuccess",{url:this.options.url+b,params:c,response:h,method:a}),this.fire("requestend",{url:this.options.url+b,params:c,method:a})):(this._authenticating=!0,this._requestQueue.push(f),this.fire("authenticationrequired",{authenticate:L.Util.bind(this.authenticate,this)}))},this)},_runQueue:function(){for(var a=this._requestQueue.length-1;a>=0;a--){var b=this._requestQueue[a],c=b.shift();this[c].apply(this,b)}this._requestQueue=[]}}),EsriLeaflet.Services.service=function(a){return new EsriLeaflet.Services.Service(a)},EsriLeaflet.Services.MapService=EsriLeaflet.Services.Service.extend({identify:function(){return new EsriLeaflet.Tasks.identifyFeatures(this)},find:function(){return new EsriLeaflet.Tasks.Find(this)},query:function(){return new EsriLeaflet.Tasks.Query(this)}}),EsriLeaflet.Services.mapService=function(a){return new EsriLeaflet.Services.MapService(a)},EsriLeaflet.Tasks.Task=L.Class.extend({options:{proxy:!1,useCors:EsriLeaflet.Support.CORS},generateSetter:function(a,b){return L.Util.bind(function(b){return this.params[a]=b,this},b)},initialize:function(a){if(a.request&&a.options?(this._service=a,L.Util.setOptions(this,a.options)):(L.Util.setOptions(this,a),this.options.url=L.esri.Util.cleanUrl(a.url)),this.params=L.Util.extend({},this.params||{}),this.setters)for(var b in this.setters){var c=this.setters[b];this[b]=this.generateSetter(c,this)}},token:function(a){return this._service?this._service.authenticate(a):this.params.token=a,this},request:function(a,b){return this._service?this._service.request(this.path,this.params,a,b):this._request("request",this.path,this.params,a,b)},_request:function(a,b,c,d,e){var f=this.options.proxy?this.options.proxy+"?"+this.options.url+b:this.options.url+b;return"get"!==a&&"request"!==a||this.options.useCors?EsriLeaflet[a](f,c,d,e):EsriLeaflet.Request.get.JSONP(f,c,d,e)}}),EsriLeaflet.Tasks.Identify=EsriLeaflet.Tasks.Task.extend({path:"identify",between:function(a,b){return this.params.time=[a.valueOf(),b.valueOf()],this}}),EsriLeaflet.Tasks.IdentifyFeatures=EsriLeaflet.Tasks.Identify.extend({setters:{layers:"layers",precision:"geometryPrecision",tolerance:"tolerance",returnGeometry:"returnGeometry"},params:{sr:4326,layers:"all",tolerance:3,returnGeometry:!0},on:function(a){var b=EsriLeaflet.Util.boundsToExtent(a.getBounds()),c=a.getSize();return this.params.imageDisplay=[c.x,c.y,96],this.params.mapExtent=[b.xmin,b.ymin,b.xmax,b.ymax],this},at:function(a){return a=L.latLng(a),this.params.geometry=[a.lng,a.lat],this.params.geometryType="esriGeometryPoint",this},layerDef:function(a,b){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[a,b].join(":"),this},simplify:function(a,b){var c=Math.abs(a.getBounds().getWest()-a.getBounds().getEast());return this.params.maxAllowableOffset=c/a.getSize().y*(1-b),this},run:function(a,b){return this.request(function(c,d){var e=EsriLeaflet.Util.responseToFeatureCollection(d),f=e.features.length;if(!c&&f>0){d.results=d.results.reverse();for(var g=0;f>g;g++){var h=e.features[g];h.layerId=d.results[g].layerId}}a.call(b,c,d&&e,d)},b)}}),EsriLeaflet.Tasks.identifyFeatures=function(a){return new EsriLeaflet.Tasks.IdentifyFeatures(a)},EsriLeaflet.Tasks.Query=EsriLeaflet.Tasks.Task.extend({setters:{offset:"offset",limit:"limit",fields:"outFields",precision:"geometryPrecision",featureIds:"objectIds",returnGeometry:"returnGeometry",token:"token"},path:"query",params:{returnGeometry:!0,where:"1=1",outSr:4326,outFields:"*"},within:function(a){return this._setGeometry(a),this.params.spatialRel="esriSpatialRelContains",this},intersects:function(a){return this._setGeometry(a),this.params.spatialRel="esriSpatialRelIntersects",this},contains:function(a){return this._setGeometry(a),this.params.spatialRel="esriSpatialRelWithin",this},overlaps:function(a){return this._setGeometry(a),this.params.spatialRel="esriSpatialRelOverlaps",this},nearby:function(a,b){return a=L.latLng(a),this.params.geometry=[a.lng,a.lat],this.params.geometryType="esriGeometryPoint",this.params.spatialRel="esriSpatialRelIntersects",this.params.units="esriSRUnit_Meter",this.params.distance=b,this.params.inSr=4326,this},where:function(a){return this.params.where=a.replace(/"/g,"'"),this},between:function(a,b){return this.params.time=[a.valueOf(),b.valueOf()],this},simplify:function(a,b){var c=Math.abs(a.getBounds().getWest()-a.getBounds().getEast());return this.params.maxAllowableOffset=c/a.getSize().y*b,this},orderBy:function(a,b){return b=b||"ASC",this.params.orderByFields=this.params.orderByFields?this.params.orderByFields+",":"",this.params.orderByFields+=[a,b].join(" "),this},run:function(a,b){return this._cleanParams(),EsriLeaflet.Util.isArcgisOnline(this.options.url)?(this.params.f="geojson",this.request(function(c,d){a.call(b,c,d,d)},b)):this.request(function(c,d){a.call(b,c,d&&EsriLeaflet.Util.responseToFeatureCollection(d),d)},b)},count:function(a,b){return this._cleanParams(),this.params.returnCountOnly=!0,this.request(function(b,c){a.call(this,b,c&&c.count,c)},b)},ids:function(a,b){return this._cleanParams(),this.params.returnIdsOnly=!0,this.request(function(b,c){a.call(this,b,c&&c.objectIds,c)},b)},bounds:function(a,b){return this._cleanParams(),this.params.returnExtentOnly=!0,this.request(function(c,d){a.call(b,c,d&&d.extent&&EsriLeaflet.Util.extentToBounds(d.extent),d)},b)},pixelSize:function(a){return a=L.point(a),this.params.pixelSize=[a.x,a.y],this},layer:function(a){return this.path=a+"/query",this},_cleanParams:function(){delete this.params.returnIdsOnly,delete this.params.returnExtentOnly,delete this.params.returnCountOnly},_setGeometry:function(a){return this.params.inSr=4326,a instanceof L.LatLngBounds?(this.params.geometry=EsriLeaflet.Util.boundsToExtent(a),void(this.params.geometryType="esriGeometryEnvelope")):(a.getLatLng&&(a=a.getLatLng()),a instanceof L.LatLng&&(a={type:"Point",coordinates:[a.lng,a.lat]}),a instanceof L.GeoJSON&&(a=a.getLayers()[0].feature.geometry,this.params.geometry=EsriLeaflet.Util.geojsonToArcGIS(a),this.params.geometryType=EsriLeaflet.Util.geojsonTypeToArcGIS(a.type)),a.toGeoJSON&&(a=a.toGeoJSON()),"Feature"===a.type&&(a=a.geometry),"Point"===a.type||"LineString"===a.type||"Polygon"===a.type?(this.params.geometry=EsriLeaflet.Util.geojsonToArcGIS(a),void(this.params.geometryType=EsriLeaflet.Util.geojsonTypeToArcGIS(a.type))):void(console&&console.warn&&console.warn("invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object")))}}),EsriLeaflet.Tasks.query=function(a){return new EsriLeaflet.Tasks.Query(a)},EsriLeaflet.Tasks.Find=EsriLeaflet.Tasks.Task.extend({setters:{contains:"contains",text:"searchText",fields:"searchFields",spatialReference:"sr",sr:"sr",layers:"layers",returnGeometry:"returnGeometry",maxAllowableOffset:"maxAllowableOffset",precision:"geometryPrecision",dynamicLayers:"dynamicLayers",returnZ:"returnZ",returnM:"returnM",gdbVersion:"gdbVersion",token:"token"},path:"find",params:{sr:4326,contains:!0,returnGeometry:!0,returnZ:!0,returnM:!1},layerDefs:function(a,b){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[a,b].join(":"),this},simplify:function(a,b){var c=Math.abs(a.getBounds().getWest()-a.getBounds().getEast());return this.params.maxAllowableOffset=c/a.getSize().y*b,this},run:function(a,b){return this.request(function(c,d){a.call(b,c,d&&EsriLeaflet.Util.responseToFeatureCollection(d),d)},b)}}),EsriLeaflet.Tasks.find=function(a){return new EsriLeaflet.Tasks.Find(a)},EsriLeaflet.Layers.RasterLayer=L.Class.extend({includes:L.Mixin.Events,options:{opacity:1,position:"front",f:"image"},onAdd:function(a){if(this._map=a,this._update=L.Util.limitExecByInterval(this._update,this.options.updateInterval,this),a.options.crs&&a.options.crs.code){var b=a.options.crs.code.split(":")[1];this.options.bboxSR=b,this.options.imageSR=b}a.on("moveend",this._update,this),this._currentImage&&this._currentImage._bounds.equals(this._map.getBounds())?a.addLayer(this._currentImage):this._currentImage&&(this._map.removeLayer(this._currentImage),this._currentImage=null),this._update(),this._popup&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this))},bindPopup:function(a,b){return this._shouldRenderPopup=!1,this._lastClick=!1,this._popup=L.popup(b),this._popupFunction=a,this._map&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this)),this},unbindPopup:function(){return this._map&&(this._map.closePopup(this._popup),this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this)),this._popup=!1,this},onRemove:function(){this._currentImage&&this._map.removeLayer(this._currentImage),this._popup&&(this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this)),this._map.off("moveend",this._update,this),this._map=null},addTo:function(a){return a.addLayer(this),this},removeFrom:function(a){return a.removeLayer(this),this},bringToFront:function(){return this.options.position="front",this._currentImage&&this._currentImage.bringToFront(),this},bringToBack:function(){return this.options.position="back",this._currentImage&&this._currentImage.bringToBack(),this},getAttribution:function(){return this.options.attribution},getOpacity:function(){return this.options.opacity},setOpacity:function(a){return this.options.opacity=a,this._currentImage.setOpacity(a),this},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(a,b){return this.options.from=a,this.options.to=b,this._update(),this},metadata:function(a,b){return this._service.metadata(a,b),this},authenticate:function(a){return this._service.authenticate(a),this},_renderImage:function(a,b){if(this._map){var c=new L.ImageOverlay(a,b,{opacity:0}).addTo(this._map);c.once("load",function(a){var c=a.target,d=this._currentImage;c._bounds.equals(b)?(this._currentImage=c,"front"===this.options.position?this.bringToFront():this.bringToBack(),this._map&&this._currentImage._map?this._currentImage.setOpacity(this.options.opacity):this._currentImage._map.removeLayer(this._currentImage),d&&this._map&&this._map.removeLayer(d),d&&d._map&&d._map.removeLayer(d)):this._map.removeLayer(c),this.fire("load",{bounds:b})},this),this.fire("loading",{bounds:b})}},_update:function(){if(this._map){var a=this._map.getZoom(),b=this._map.getBounds();if(!this._animatingZoom&&!(this._map._panTransition&&this._map._panTransition._inProgress||a>this.options.maxZoom||a= 0);\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L504-L519\n function vertexIntersectsVertex(a1, a2, b1, b2) {\n var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);\n var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);\n var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);\n\n if ( uB !== 0 ) {\n var ua = uaT / uB;\n var ub = ubT / uB;\n\n if ( 0 <= ua && ua <= 1 && 0 <= ub && ub <= 1 ) {\n return true;\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L521-L531\n function arrayIntersectsArray(a, b) {\n for (var i = 0; i < a.length - 1; i++) {\n for (var j = 0; j < b.length - 1; j++) {\n if (vertexIntersectsVertex(a[i], a[i + 1], b[j], b[j + 1])) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L470-L480\n function coordinatesContainPoint(coordinates, point) {\n var contains = false;\n for(var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {\n if (((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||\n (coordinates[j][1] <= point[1] && point[1] < coordinates[i][1])) &&\n (point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0])) {\n contains = !contains;\n }\n }\n return contains;\n }\n\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L106-L113\n function coordinatesContainCoordinates(outer, inner){\n var intersects = arrayIntersectsArray(outer, inner);\n var contains = coordinatesContainPoint(outer, inner[0]);\n if(!intersects && contains){\n return true;\n }\n return false;\n }\n\n // do any polygons in this array contain any other polygons in this array?\n // used for checking for holes in arcgis rings\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L117-L172\n function convertRingsToGeoJSON(rings){\n var outerRings = [];\n var holes = [];\n var x; // iterator\n var outerRing; // current outer ring being evaluated\n var hole; // current hole being evaluated\n\n // for each ring\n for (var r = 0; r < rings.length; r++) {\n var ring = closeRing(rings[r].slice(0));\n if(ring.length < 4){\n continue;\n }\n // is this ring an outer ring? is it clockwise?\n if(ringIsClockwise(ring)){\n var polygon = [ ring ];\n outerRings.push(polygon); // push to outer rings\n } else {\n holes.push(ring); // counterclockwise push to holes\n }\n }\n\n var uncontainedHoles = [];\n\n // while there are holes left...\n while(holes.length){\n // pop a hole off out stack\n hole = holes.pop();\n\n // loop over all outer rings and see if they contain our hole.\n var contained = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(coordinatesContainCoordinates(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n contained = true;\n break;\n }\n }\n\n // ring is not contained in any outer ring\n // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320\n if(!contained){\n uncontainedHoles.push(hole);\n }\n }\n\n // if we couldn't match any holes using contains we can try intersects...\n while(uncontainedHoles.length){\n // pop a hole off out stack\n hole = uncontainedHoles.pop();\n\n // loop over all outer rings and see if any intersect our hole.\n var intersects = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(arrayIntersectsArray(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n intersects = true;\n break;\n }\n }\n\n if(!intersects) {\n outerRings.push([hole.reverse()]);\n }\n }\n\n if(outerRings.length === 1){\n return {\n type: 'Polygon',\n coordinates: outerRings[0]\n };\n } else {\n return {\n type: 'MultiPolygon',\n coordinates: outerRings\n };\n }\n }\n\n // This function ensures that rings are oriented in the right directions\n // outer rings are clockwise, holes are counterclockwise\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function orientRings(poly){\n var output = [];\n var polygon = poly.slice(0);\n var outerRing = closeRing(polygon.shift().slice(0));\n if(outerRing.length >= 4){\n if(!ringIsClockwise(outerRing)){\n outerRing.reverse();\n }\n\n output.push(outerRing);\n\n for (var i = 0; i < polygon.length; i++) {\n var hole = closeRing(polygon[i].slice(0));\n if(hole.length >= 4){\n if(ringIsClockwise(hole)){\n hole.reverse();\n }\n output.push(hole);\n }\n }\n }\n\n return output;\n }\n\n // This function flattens holes in multipolygons to one array of polygons\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function flattenMultiPolygonRings(rings){\n var output = [];\n for (var i = 0; i < rings.length; i++) {\n var polygon = orientRings(rings[i]);\n for (var x = polygon.length - 1; x >= 0; x--) {\n var ring = polygon[x].slice(0);\n output.push(ring);\n }\n }\n return output;\n }\n\n // convert an extent (ArcGIS) to LatLngBounds (Leaflet)\n EsriLeaflet.Util.extentToBounds = function(extent){\n var sw = new L.LatLng(extent.ymin, extent.xmin);\n var ne = new L.LatLng(extent.ymax, extent.xmax);\n return new L.LatLngBounds(sw, ne);\n };\n\n // convert an LatLngBounds (Leaflet) to extent (ArcGIS)\n EsriLeaflet.Util.boundsToExtent = function(bounds) {\n bounds = L.latLngBounds(bounds);\n return {\n 'xmin': bounds.getSouthWest().lng,\n 'ymin': bounds.getSouthWest().lat,\n 'xmax': bounds.getNorthEast().lng,\n 'ymax': bounds.getNorthEast().lat,\n 'spatialReference': {\n 'wkid' : 4326\n }\n };\n };\n\n EsriLeaflet.Util.arcgisToGeojson = function (arcgis, idAttribute){\n var geojson = {};\n\n if(typeof arcgis.x === 'number' && typeof arcgis.y === 'number'){\n geojson.type = 'Point';\n geojson.coordinates = [arcgis.x, arcgis.y];\n }\n\n if(arcgis.points){\n geojson.type = 'MultiPoint';\n geojson.coordinates = arcgis.points.slice(0);\n }\n\n if(arcgis.paths) {\n if(arcgis.paths.length === 1){\n geojson.type = 'LineString';\n geojson.coordinates = arcgis.paths[0].slice(0);\n } else {\n geojson.type = 'MultiLineString';\n geojson.coordinates = arcgis.paths.slice(0);\n }\n }\n\n if(arcgis.rings) {\n geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));\n }\n\n if(arcgis.geometry || arcgis.attributes) {\n geojson.type = 'Feature';\n geojson.geometry = (arcgis.geometry) ? EsriLeaflet.Util.arcgisToGeojson(arcgis.geometry) : null;\n geojson.properties = (arcgis.attributes) ? clone(arcgis.attributes) : null;\n if(arcgis.attributes) {\n geojson.id = arcgis.attributes[idAttribute] || arcgis.attributes.OBJECTID || arcgis.attributes.FID;\n }\n }\n\n return geojson;\n };\n\n // GeoJSON -> ArcGIS\n EsriLeaflet.Util.geojsonToArcGIS = function(geojson, idAttribute){\n idAttribute = idAttribute || 'OBJECTID';\n var spatialReference = { wkid: 4326 };\n var result = {};\n var i;\n\n switch(geojson.type){\n case 'Point':\n result.x = geojson.coordinates[0];\n result.y = geojson.coordinates[1];\n result.spatialReference = spatialReference;\n break;\n case 'MultiPoint':\n result.points = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'LineString':\n result.paths = [geojson.coordinates.slice(0)];\n result.spatialReference = spatialReference;\n break;\n case 'MultiLineString':\n result.paths = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'Polygon':\n result.rings = orientRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'MultiPolygon':\n result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'Feature':\n if(geojson.geometry) {\n result.geometry = EsriLeaflet.Util.geojsonToArcGIS(geojson.geometry, idAttribute);\n }\n result.attributes = (geojson.properties) ? clone(geojson.properties) : {};\n if(geojson.id){\n result.attributes[idAttribute] = geojson.id;\n }\n break;\n case 'FeatureCollection':\n result = [];\n for (i = 0; i < geojson.features.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.features[i], idAttribute));\n }\n break;\n case 'GeometryCollection':\n result = [];\n for (i = 0; i < geojson.geometries.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.geometries[i], idAttribute));\n }\n break;\n }\n\n return result;\n };\n\n EsriLeaflet.Util.responseToFeatureCollection = function(response, idAttribute){\n var objectIdField;\n\n if(idAttribute){\n objectIdField = idAttribute;\n } else if(response.objectIdFieldName){\n objectIdField = response.objectIdFieldName;\n } else if(response.fields) {\n for (var j = 0; j <= response.fields.length - 1; j++) {\n if(response.fields[j].type === 'esriFieldTypeOID') {\n objectIdField = response.fields[j].name;\n break;\n }\n }\n } else {\n objectIdField = 'OBJECTID';\n }\n\n var featureCollection = {\n type: 'FeatureCollection',\n features: []\n };\n var features = response.features || response.results;\n if(features.length){\n for (var i = features.length - 1; i >= 0; i--) {\n featureCollection.features.push(EsriLeaflet.Util.arcgisToGeojson(features[i], objectIdField));\n }\n }\n\n return featureCollection;\n };\n\n // trim whitespace and add a tailing slash is needed to a url\n EsriLeaflet.Util.cleanUrl = function(url){\n url = url.replace(/\\s\\s*/g, '');\n\n //add a trailing slash to the url if the user omitted it\n if(url[url.length-1] !== '/'){\n url += '/';\n }\n\n return url;\n };\n\n EsriLeaflet.Util.isArcgisOnline = function(url){\n return (/\\.arcgis\\.com/g).test(url);\n };\n\n EsriLeaflet.Util.geojsonTypeToArcGIS = function (geoJsonType) {\n var arcgisGeometryType;\n switch (geoJsonType) {\n case 'Point':\n arcgisGeometryType = 'esriGeometryPoint';\n break;\n case 'MultiPoint':\n arcgisGeometryType = 'esriGeometryMultipoint';\n break;\n case 'LineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'MultiLineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'Polygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n case 'MultiPolygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n }\n return arcgisGeometryType;\n };\n\n EsriLeaflet.Util.requestAnimationFrame = L.Util.bind(raf, window);\n\n})(EsriLeaflet);","(function(EsriLeaflet){\n\n var callbacks = 0;\n\n window._EsriLeafletCallbacks = {};\n\n function serialize(params){\n var data = '';\n\n params.f = params.f || 'json';\n\n for (var key in params){\n if(params.hasOwnProperty(key)){\n var param = params[key];\n var type = Object.prototype.toString.call(param);\n var value;\n\n if(data.length){\n data += '&';\n }\n\n if (type === '[object Array]'){\n value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');\n } else if (type === '[object Object]') {\n value = JSON.stringify(param);\n } else if (type === '[object Date]'){\n value = param.valueOf();\n } else {\n value = param;\n }\n\n data += encodeURIComponent(key) + '=' + encodeURIComponent(value);\n }\n }\n\n return data;\n }\n\n function createRequest(callback, context){\n var httpRequest = new XMLHttpRequest();\n\n httpRequest.onerror = function(e) {\n httpRequest.onreadystatechange = L.Util.falseFn;\n\n callback.call(context, {\n error: {\n code: 500,\n message: 'XMLHttpRequest error'\n }\n }, null);\n };\n\n httpRequest.onreadystatechange = function(){\n var response;\n var error;\n\n if (httpRequest.readyState === 4) {\n try {\n response = JSON.parse(httpRequest.responseText);\n } catch(e) {\n response = null;\n error = {\n code: 500,\n message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'\n };\n }\n\n if (!error && response.error) {\n error = response.error;\n response = null;\n }\n\n httpRequest.onerror = L.Util.falseFn;\n\n callback.call(context, error, response);\n }\n };\n\n return httpRequest;\n }\n\n // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)\n EsriLeaflet.Request = {\n request: function(url, params, callback, context){\n var paramString = serialize(params);\n var httpRequest = createRequest(callback, context);\n var requestLength = (url + '?' + paramString).length;\n\n // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest\n if(requestLength <= 2000 && L.esri.Support.CORS){\n httpRequest.open('GET', url + '?' + paramString);\n httpRequest.send(null);\n\n // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest\n } else if (requestLength > 2000 && L.esri.Support.CORS){\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(paramString);\n\n // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request\n } else if(requestLength <= 2000 && !L.esri.Support.CORS){\n return L.esri.Request.get.JSONP(url, params, callback, context);\n\n // request is longer then 2000 characters and the browser does not support CORS, log a warning\n } else {\n if(console && console.warn){\n console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');\n return;\n }\n }\n\n return httpRequest;\n },\n post: {\n XMLHTTP: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(serialize(params));\n\n return httpRequest;\n }\n },\n\n get: {\n CORS: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n\n httpRequest.open('GET', url + '?' + serialize(params), true);\n httpRequest.send(null);\n\n return httpRequest;\n },\n JSONP: function(url, params, callback, context){\n var callbackId = 'c' + callbacks;\n\n params.callback = 'window._EsriLeafletCallbacks.' + callbackId;\n\n var script = L.DomUtil.create('script', null, document.body);\n script.type = 'text/javascript';\n script.src = url + '?' + serialize(params);\n script.id = callbackId;\n\n window._EsriLeafletCallbacks[callbackId] = function(response){\n if(window._EsriLeafletCallbacks[callbackId] !== true){\n var error;\n var responseType = Object.prototype.toString.call(response);\n\n if(!(responseType === '[object Object]' || responseType === '[object Array]')){\n error = {\n error: {\n code: 500,\n message: 'Expected array or object as JSONP response'\n }\n };\n response = null;\n }\n\n if (!error && response.error) {\n error = response;\n response = null;\n }\n\n callback.call(context, error, response);\n window._EsriLeafletCallbacks[callbackId] = true;\n }\n };\n\n callbacks++;\n\n return {\n id: callbackId,\n url: script.src,\n abort: function(){\n window._EsriLeafletCallbacks._callback[callbackId]({\n code: 0,\n message: 'Request aborted.'\n });\n }\n };\n }\n }\n };\n\n // choose the correct AJAX handler depending on CORS support\n EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;\n\n // always use XMLHttpRequest for posts\n EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;\n\n // expose a common request method the uses GET\\POST based on request length\n EsriLeaflet.request = EsriLeaflet.Request.request;\n\n})(EsriLeaflet);","EsriLeaflet.Services.Service = L.Class.extend({\n\n includes: L.Mixin.Events,\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n initialize: function (options) {\n options = options || {};\n this._requestQueue = [];\n this._authenticating = false;\n L.Util.setOptions(this, options);\n this.options.url = EsriLeaflet.Util.cleanUrl(this.options.url);\n },\n\n get: function (path, params, callback, context) {\n return this._request('get', path, params, callback, context);\n },\n\n post: function (path, params, callback, context) {\n return this._request('post', path, params, callback, context);\n },\n\n request: function (path, params, callback, context) {\n return this._request('request', path, params, callback, context);\n },\n\n metadata: function (callback, context) {\n return this._request('get', '', {}, callback, context);\n },\n\n authenticate: function(token){\n this._authenticating = false;\n this.options.token = token;\n this._runQueue();\n return this;\n },\n\n _request: function(method, path, params, callback, context){\n this.fire('requeststart', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n\n var wrappedCallback = this._createServiceCallback(method, path, params, callback, context);\n\n if (this.options.token) {\n params.token = this.options.token;\n }\n\n if (this._authenticating) {\n this._requestQueue.push([method, path, params, callback, context]);\n return;\n } else {\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, wrappedCallback);\n } else {\n return EsriLeaflet[method](url, params, wrappedCallback);\n }\n }\n },\n\n _createServiceCallback: function(method, path, params, callback, context){\n var request = [method, path, params, callback, context];\n\n return L.Util.bind(function(error, response){\n\n if (error && (error.code === 499 || error.code === 498)) {\n this._authenticating = true;\n\n this._requestQueue.push(request);\n\n this.fire('authenticationrequired', {\n authenticate: L.Util.bind(this.authenticate, this)\n });\n } else {\n callback.call(context, error, response);\n\n if(error) {\n this.fire('requesterror', {\n url: this.options.url + path,\n params: params,\n message: error.message,\n code: error.code,\n method: method\n });\n } else {\n this.fire('requestsuccess', {\n url: this.options.url + path,\n params: params,\n response: response,\n method: method\n });\n }\n\n this.fire('requestend', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n }\n }, this);\n },\n\n _runQueue: function(){\n for (var i = this._requestQueue.length - 1; i >= 0; i--) {\n var request = this._requestQueue[i];\n var method = request.shift();\n this[method].apply(this, request);\n }\n this._requestQueue = [];\n }\n\n});\n\nEsriLeaflet.Services.service = function(params){\n return new EsriLeaflet.Services.Service(params);\n};","EsriLeaflet.Services.MapService = EsriLeaflet.Services.Service.extend({\n\n identify: function () {\n return new EsriLeaflet.Tasks.identifyFeatures(this);\n },\n\n find: function () {\n return new EsriLeaflet.Tasks.Find(this);\n },\n\n query: function () {\n return new EsriLeaflet.Tasks.Query(this);\n }\n\n});\n\nEsriLeaflet.Services.mapService = function(params){\n return new EsriLeaflet.Services.MapService(params);\n};","EsriLeaflet.Tasks.Task = L.Class.extend({\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n //Generate a method for each methodName:paramName in the setters for this task.\n generateSetter: function(param, context){\n return L.Util.bind(function(value){\n this.params[param] = value;\n return this;\n }, context);\n },\n\n initialize: function(endpoint){\n // endpoint can be either a url (and options) for an ArcGIS Rest Service or an instance of EsriLeaflet.Service\n if(endpoint.request && endpoint.options){\n this._service = endpoint;\n L.Util.setOptions(this, endpoint.options);\n } else {\n L.Util.setOptions(this, endpoint);\n this.options.url = L.esri.Util.cleanUrl(endpoint.url);\n }\n\n // clone default params into this object\n this.params = L.Util.extend({}, this.params || {});\n\n // generate setter methods based on the setters object implimented a child class\n if(this.setters){\n for (var setter in this.setters){\n var param = this.setters[setter];\n this[setter] = this.generateSetter(param, this);\n }\n }\n },\n\n token: function(token){\n if(this._service){\n this._service.authenticate(token);\n } else {\n this.params.token = token;\n }\n return this;\n },\n\n request: function(callback, context){\n if(this._service){\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n },\n\n _request: function(method, path, params, callback, context){\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, callback, context);\n } else{\n return EsriLeaflet[method](url, params, callback, context);\n }\n }\n});","EsriLeaflet.Tasks.Identify = EsriLeaflet.Tasks.Task.extend({\n path: 'identify',\n\n between: function(start, end){\n this.params.time = [start.valueOf(), end.valueOf()];\n return this;\n }\n});\n","EsriLeaflet.Tasks.IdentifyFeatures = EsriLeaflet.Tasks.Identify.extend({\n setters: {\n 'layers': 'layers',\n 'precision': 'geometryPrecision',\n 'tolerance': 'tolerance',\n 'returnGeometry': 'returnGeometry'\n },\n\n params: {\n sr: 4326,\n layers: 'all',\n tolerance: 3,\n returnGeometry: true\n },\n\n on: function(map){\n var extent = EsriLeaflet.Util.boundsToExtent(map.getBounds());\n var size = map.getSize();\n this.params.imageDisplay = [size.x, size.y, 96];\n this.params.mapExtent = [extent.xmin, extent.ymin, extent.xmax, extent.ymax];\n return this;\n },\n\n at: function(latlng){\n latlng = L.latLng(latlng);\n this.params.geometry = [latlng.lng, latlng.lat];\n this.params.geometryType = 'esriGeometryPoint';\n return this;\n },\n\n layerDef: function (id, where){\n this.params.layerDefs = (this.params.layerDefs) ? this.params.layerDefs + ';' : '';\n this.params.layerDefs += ([id, where]).join(':');\n return this;\n },\n\n simplify: function(map, factor){\n var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());\n this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * (1 - factor);\n return this;\n },\n\n run: function (callback, context){\n return this.request(function(error, response){\n var featureCollection = EsriLeaflet.Util.responseToFeatureCollection(response);\n var count = featureCollection.features.length;\n // tag each feature with the Id of its parent layer\n if(!error && count > 0){\n response.results = response.results.reverse();\n for (var i = 0; i < count; i++) {\n var feature = featureCollection.features[i];\n feature.layerId = response.results[i].layerId;\n }\n }\n callback.call(context, error, (response && featureCollection), response);\n }, context);\n }\n\n});\n\nEsriLeaflet.Tasks.identifyFeatures = function(params){\n return new EsriLeaflet.Tasks.IdentifyFeatures(params);\n};","EsriLeaflet.Tasks.Query = EsriLeaflet.Tasks.Task.extend({\n setters: {\n 'offset': 'offset',\n 'limit': 'limit',\n 'fields': 'outFields',\n 'precision': 'geometryPrecision',\n 'featureIds': 'objectIds',\n 'returnGeometry': 'returnGeometry',\n 'token': 'token'\n },\n\n path: 'query',\n\n params: {\n returnGeometry: true,\n where: '1=1',\n outSr: 4326,\n outFields: '*'\n },\n\n within: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelContains'; // will make code read layer within geometry, to the api this will reads geometry contains layer\n return this;\n },\n\n intersects: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelIntersects';\n return this;\n },\n\n contains: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelWithin'; // will make code read layer contains geometry, to the api this will reads geometry within layer\n return this;\n },\n\n // crosses: function(geometry){\n // this._setGeometry(geometry);\n // this.params.spatialRel = 'esriSpatialRelCrosses';\n // return this;\n // },\n\n // touches: function(geometry){\n // this._setGeometry(geometry);\n // this.params.spatialRel = 'esriSpatialRelTouches';\n // return this;\n // },\n\n overlaps: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelOverlaps';\n return this;\n },\n\n // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online\n nearby: function(latlng, radius){\n latlng = L.latLng(latlng);\n this.params.geometry = [latlng.lng, latlng.lat];\n this.params.geometryType = 'esriGeometryPoint';\n this.params.spatialRel = 'esriSpatialRelIntersects';\n this.params.units = 'esriSRUnit_Meter';\n this.params.distance = radius;\n this.params.inSr = 4326;\n return this;\n },\n\n where: function(string){\n this.params.where = string.replace(/\"/g, \"\\'\"); // jshint ignore:line\n return this;\n },\n\n between: function(start, end){\n this.params.time = [start.valueOf(), end.valueOf()];\n return this;\n },\n\n simplify: function(map, factor){\n var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());\n this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;\n return this;\n },\n\n orderBy: function(fieldName, order){\n order = order || 'ASC';\n this.params.orderByFields = (this.params.orderByFields) ? this.params.orderByFields + ',' : '';\n this.params.orderByFields += ([fieldName, order]).join(' ');\n return this;\n },\n\n run: function(callback, context){\n this._cleanParams();\n\n // if the service is hosted on arcgis online request geojson directly\n if(EsriLeaflet.Util.isArcgisOnline(this.options.url)){\n this.params.f = 'geojson';\n\n return this.request(function(error, response){\n callback.call(context, error, response, response);\n }, context);\n\n // otherwise convert it in the callback then pass it on\n } else {\n return this.request(function(error, response){\n callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);\n }, context);\n }\n },\n\n count: function(callback, context){\n this._cleanParams();\n this.params.returnCountOnly = true;\n return this.request(function(error, response){\n callback.call(this, error, (response && response.count), response);\n }, context);\n },\n\n ids: function(callback, context){\n this._cleanParams();\n this.params.returnIdsOnly = true;\n return this.request(function(error, response){\n callback.call(this, error, (response && response.objectIds), response);\n }, context);\n },\n\n // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online\n bounds: function(callback, context){\n this._cleanParams();\n this.params.returnExtentOnly = true;\n return this.request(function(error, response){\n callback.call(context, error, (response && response.extent && EsriLeaflet.Util.extentToBounds(response.extent)), response);\n }, context);\n },\n\n // only valid for image services\n pixelSize: function(point){\n point = L.point(point);\n this.params.pixelSize = [point.x,point.y];\n return this;\n },\n\n // only valid for map services\n layer: function(layer){\n this.path = layer + '/query';\n return this;\n },\n\n _cleanParams: function(){\n delete this.params.returnIdsOnly;\n delete this.params.returnExtentOnly;\n delete this.params.returnCountOnly;\n },\n\n _setGeometry: function(geometry) {\n this.params.inSr = 4326;\n\n // convert bounds to extent and finish\n if ( geometry instanceof L.LatLngBounds ) {\n // set geometry + geometryType\n this.params.geometry = EsriLeaflet.Util.boundsToExtent(geometry);\n this.params.geometryType = 'esriGeometryEnvelope';\n return;\n }\n\n // convert L.Marker > L.LatLng\n if(geometry.getLatLng){\n geometry = geometry.getLatLng();\n }\n\n // convert L.LatLng to a geojson point and continue;\n if (geometry instanceof L.LatLng) {\n geometry = {\n type: 'Point',\n coordinates: [geometry.lng, geometry.lat]\n };\n }\n\n // handle L.GeoJSON, pull out the first geometry\n if ( geometry instanceof L.GeoJSON ) {\n //reassign geometry to the GeoJSON value (we are assuming that only one feature is present)\n geometry = geometry.getLayers()[0].feature.geometry;\n this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);\n this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);\n }\n\n // Handle L.Polyline and L.Polygon\n if (geometry.toGeoJSON) {\n geometry = geometry.toGeoJSON();\n }\n\n // handle GeoJSON feature by pulling out the geometry\n if ( geometry.type === 'Feature' ) {\n // get the geometry of the geojson feature\n geometry = geometry.geometry;\n }\n\n // confirm that our GeoJSON is a point, line or polygon\n if ( geometry.type === 'Point' || geometry.type === 'LineString' || geometry.type === 'Polygon') {\n this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);\n this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);\n return;\n }\n\n // warn the user if we havn't found a\n /* global console */\n if(console && console.warn) {\n console.warn('invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object');\n }\n\n return;\n }\n});\n\nEsriLeaflet.Tasks.query = function(params){\n return new EsriLeaflet.Tasks.Query(params);\n};","EsriLeaflet.Tasks.Find = EsriLeaflet.Tasks.Task.extend({\n setters: {\n // method name > param name\n 'contains': 'contains',\n 'text': 'searchText',\n 'fields': 'searchFields', // denote an array or single string\n 'spatialReference': 'sr',\n 'sr': 'sr',\n 'layers': 'layers',\n 'returnGeometry': 'returnGeometry',\n 'maxAllowableOffset': 'maxAllowableOffset',\n 'precision': 'geometryPrecision',\n 'dynamicLayers': 'dynamicLayers',\n 'returnZ' : 'returnZ',\n 'returnM' : 'returnM',\n 'gdbVersion' : 'gdbVersion',\n 'token' : 'token'\n },\n\n path: 'find',\n\n params: {\n sr: 4326,\n contains: true,\n returnGeometry: true,\n returnZ: true,\n returnM: false\n },\n\n layerDefs: function (id, where) {\n this.params.layerDefs = (this.params.layerDefs) ? this.params.layerDefs + ';' : '';\n this.params.layerDefs += ([id, where]).join(':');\n return this;\n },\n\n simplify: function(map, factor){\n var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());\n this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;\n return this;\n },\n\n run: function (callback, context) {\n return this.request(function(error, response){\n callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);\n }, context);\n }\n});\n\nEsriLeaflet.Tasks.find = function (params) {\n return new EsriLeaflet.Tasks.Find(params);\n};","EsriLeaflet.Layers.RasterLayer = L.Class.extend({\n includes: L.Mixin.Events,\n\n options: {\n opacity: 1,\n position: 'front',\n f: 'image'\n },\n\n onAdd: function (map) {\n this._map = map;\n\n this._update = L.Util.limitExecByInterval(this._update, this.options.updateInterval, this);\n\n if (map.options.crs && map.options.crs.code) {\n var sr = map.options.crs.code.split(':')[1];\n this.options.bboxSR = sr;\n this.options.imageSR = sr;\n }\n\n map.on('moveend', this._update, this);\n\n // if we had an image loaded and it matches the\n // current bounds show the image otherwise remove it\n if(this._currentImage && this._currentImage._bounds.equals(this._map.getBounds())){\n map.addLayer(this._currentImage);\n } else if(this._currentImage) {\n this._map.removeLayer(this._currentImage);\n this._currentImage = null;\n }\n\n this._update();\n\n if(this._popup){\n this._map.on('click', this._getPopupData, this);\n this._map.on('dblclick', this._resetPopupState, this);\n }\n },\n\n bindPopup: function(fn, popupOptions){\n this._shouldRenderPopup = false;\n this._lastClick = false;\n this._popup = L.popup(popupOptions);\n this._popupFunction = fn;\n if(this._map){\n this._map.on('click', this._getPopupData, this);\n this._map.on('dblclick', this._resetPopupState, this);\n }\n return this;\n },\n\n unbindPopup: function(){\n if(this._map){\n this._map.closePopup(this._popup);\n this._map.off('click', this._getPopupData, this);\n this._map.off('dblclick', this._resetPopupState, this);\n }\n this._popup = false;\n return this;\n },\n\n onRemove: function (map) {\n if (this._currentImage) {\n this._map.removeLayer(this._currentImage);\n }\n\n if(this._popup){\n this._map.off('click', this._getPopupData, this);\n this._map.off('dblclick', this._resetPopupState, this);\n }\n\n this._map.off('moveend', this._update, this);\n this._map = null;\n },\n\n addTo: function(map){\n map.addLayer(this);\n return this;\n },\n\n removeFrom: function(map){\n map.removeLayer(this);\n return this;\n },\n\n bringToFront: function(){\n this.options.position = 'front';\n if(this._currentImage){\n this._currentImage.bringToFront();\n }\n return this;\n },\n\n bringToBack: function(){\n this.options.position = 'back';\n if(this._currentImage){\n this._currentImage.bringToBack();\n }\n return this;\n },\n\n getAttribution: function () {\n return this.options.attribution;\n },\n\n getOpacity: function(){\n return this.options.opacity;\n },\n\n setOpacity: function(opacity){\n this.options.opacity = opacity;\n this._currentImage.setOpacity(opacity);\n return this;\n },\n\n getTimeRange: function(){\n return [this.options.from, this.options.to];\n },\n\n setTimeRange: function(from, to){\n this.options.from = from;\n this.options.to = to;\n this._update();\n return this;\n },\n\n metadata: function(callback, context){\n this._service.metadata(callback, context);\n return this;\n },\n\n authenticate: function(token){\n this._service.authenticate(token);\n return this;\n },\n\n _renderImage: function(url, bounds){\n if(this._map){\n // create a new image overlay and add it to the map\n // to start loading the image\n // opacity is 0 while the image is loading\n var image = new L.ImageOverlay(url, bounds, {\n opacity: 0\n }).addTo(this._map);\n\n // once the image loads\n image.once('load', function(e){\n var newImage = e.target;\n var oldImage = this._currentImage;\n\n // if the bounds of this image matches the bounds that\n // _renderImage was called with and we have a map\n // hide the old image if there is one and set the opacity\n // of the new image otherwise remove the new image\n if(newImage._bounds.equals(bounds)){\n this._currentImage = newImage;\n\n if(this.options.position === 'front'){\n this.bringToFront();\n } else {\n this.bringToBack();\n }\n\n if(this._map && this._currentImage._map){\n this._currentImage.setOpacity(this.options.opacity);\n } else {\n this._currentImage._map.removeLayer(this._currentImage);\n }\n\n if(oldImage && this._map) {\n this._map.removeLayer(oldImage);\n }\n\n if(oldImage && oldImage._map){\n oldImage._map.removeLayer(oldImage);\n }\n } else {\n this._map.removeLayer(newImage);\n }\n\n this.fire('load', {\n bounds: bounds\n });\n\n }, this);\n\n this.fire('loading', {\n bounds: bounds\n });\n }\n },\n\n _update: function () {\n if(!this._map){\n return;\n }\n\n var zoom = this._map.getZoom();\n var bounds = this._map.getBounds();\n\n if(this._animatingZoom){\n return;\n }\n\n if (this._map._panTransition && this._map._panTransition._inProgress) {\n return;\n }\n\n if (zoom > this.options.maxZoom || zoom < this.options.minZoom) {\n return;\n }\n var params = this._buildExportParams();\n\n this._requestExport(params, bounds);\n },\n\n // TODO: refactor these into raster layer\n _renderPopup: function(latlng, error, results, response){\n latlng = L.latLng(latlng);\n if(this._shouldRenderPopup && this._lastClick.equals(latlng)){\n //add the popup to the map where the mouse was clicked at\n var content = this._popupFunction(error, results, response);\n if (content) {\n this._popup.setLatLng(latlng).setContent(content).openOn(this._map);\n }\n }\n },\n\n _resetPopupState: function(e){\n this._shouldRenderPopup = false;\n this._lastClick = e.latlng;\n },\n\n // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js\n // @TODO remove at Leaflet 0.8\n _propagateEvent: function (e) {\n e = L.extend({\n layer: e.target,\n target: this\n }, e);\n this.fire(e.type, e);\n }\n});","EsriLeaflet.Layers.DynamicMapLayer = EsriLeaflet.Layers.RasterLayer.extend({\n\n options: {\n updateInterval: 150,\n layers: false,\n layerDefs: false,\n timeOptions: false,\n format: 'png24',\n transparent: true\n },\n\n initialize: function (url, options) {\n options = options || {};\n options.url = EsriLeaflet.Util.cleanUrl(url);\n this._service = new EsriLeaflet.Services.MapService(options);\n this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);\n if (options.proxy){\n options.f = 'json';\n }\n L.Util.setOptions(this, options);\n },\n\n getLayers: function(){\n return this.options.layers;\n },\n\n setLayers: function(layers){\n this.options.layers = layers;\n this._update();\n return this;\n },\n\n getLayerDefs: function(){\n return this.options.layerDefs;\n },\n\n setLayerDefs: function(layerDefs){\n this.options.layerDefs = layerDefs;\n this._update();\n return this;\n },\n\n getTimeOptions: function(){\n return this.options.timeOptions;\n },\n\n setTimeOptions: function(timeOptions){\n this.options.timeOptions = timeOptions;\n this._update();\n return this;\n },\n\n query: function(){\n return this._service.query();\n },\n\n identify: function(){\n return this._service.identify();\n },\n\n find: function(){\n return this._service.find();\n },\n\n _getPopupData: function(e){\n var callback = L.Util.bind(function(error, featureCollection, response) {\n setTimeout(L.Util.bind(function(){\n this._renderPopup(e.latlng, error, featureCollection, response);\n }, this), 300);\n }, this);\n\n var identifyRequest = this.identify().on(this._map).at(e.latlng);\n\n if(this.options.layers){\n identifyRequest.layers('visible:' + this.options.layers.join(','));\n } else {\n identifyRequest.layers('visible');\n }\n\n identifyRequest.run(callback);\n\n // set the flags to show the popup\n this._shouldRenderPopup = true;\n this._lastClick = e.latlng;\n },\n\n _buildExportParams: function () {\n var bounds = this._map.getBounds();\n var size = this._map.getSize();\n var ne = this._map.options.crs.project(bounds._northEast);\n var sw = this._map.options.crs.project(bounds._southWest);\n\n var params = {\n bbox: [sw.x, sw.y, ne.x, ne.y].join(','),\n size: size.x + ',' + size.y,\n dpi: 96,\n format: this.options.format,\n transparent: this.options.transparent,\n bboxSR: this.options.bboxSR,\n imageSR: this.options.imageSR\n };\n\n if(this.options.layers){\n params.layers = 'show:' + this.options.layers.join(',');\n }\n\n if(this.options.layerDefs){\n params.layerDefs = JSON.stringify(this.options.layerDefs);\n }\n\n if(this.options.timeOptions){\n params.timeOptions = JSON.stringify(this.options.timeOptions);\n }\n\n if(this.options.from && this.options.to){\n params.time = this.options.from.valueOf() + ',' + this.options.to.valueOf();\n }\n\n if(this._service.options.token) {\n params.token = this._service.options.token;\n }\n\n return params;\n },\n\n _requestExport: function (params, bounds) {\n if(this.options.f === 'json'){\n this._service.get('export', params, function(error, response){\n this._renderImage(response.href, bounds);\n }, this);\n } else {\n params.f = 'image';\n this._renderImage(this.options.url + 'export' + L.Util.getParamString(params), bounds);\n }\n }\n});\n\nEsriLeaflet.DynamicMapLayer = EsriLeaflet.Layers.DynamicMapLayer;\n\nEsriLeaflet.Layers.dynamicMapLayer = function(url, options){\n return new EsriLeaflet.Layers.DynamicMapLayer(url, options);\n};\n\nEsriLeaflet.dynamicMapLayer = function(url, options){\n return new EsriLeaflet.Layers.DynamicMapLayer(url, options);\n};","EsriLeaflet.Layers.TiledMapLayer = L.TileLayer.extend({\n initialize: function(url, options){\n options = options || {};\n options.url = EsriLeaflet.Util.cleanUrl(url);\n options = L.Util.setOptions(this, options);\n\n // set the urls\n //this.url = L.esri.Util.cleanUrl(url);\n this.tileUrl = L.esri.Util.cleanUrl(url) + 'tile/{z}/{y}/{x}';\n this._service = new L.esri.Services.MapService(options);\n this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);\n\n //if this is looking at the AGO tiles subdomain insert the subdomain placeholder\n if(this.tileUrl.match('://tiles.arcgisonline.com')){\n this.tileUrl = this.tileUrl.replace('://tiles.arcgisonline.com', '://tiles{s}.arcgisonline.com');\n options.subdomains = ['1', '2', '3', '4'];\n }\n\n if(this.options.token) {\n this.tileUrl += ('?token=' + this.options.token);\n }\n\n // init layer by calling TileLayers initialize method\n L.TileLayer.prototype.initialize.call(this, this.tileUrl, options);\n },\n\n metadata: function(callback, context){\n this._service.metadata(callback, context);\n return this;\n },\n\n identify: function(){\n return this._service.identify();\n },\n\n authenticate: function(token){\n var tokenQs = '?token=' + token;\n this.tileUrl = (this.options.token) ? this.tileUrl.replace(/\\?token=(.+)/g, tokenQs) : this.tileUrl + tokenQs;\n this.options.token = token;\n this._service.authenticate(token);\n return this;\n },\n\n // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js\n // @TODO remove at Leaflet 0.8\n _propagateEvent: function (e) {\n e = L.extend({\n layer: e.target,\n target: this\n }, e);\n this.fire(e.type, e);\n }\n});\n\nL.esri.TiledMapLayer = L.esri.Layers.tiledMapLayer;\n\nL.esri.Layers.tiledMapLayer = function(url, options){\n return new L.esri.Layers.TiledMapLayer(url, options);\n};\n\nL.esri.tiledMapLayer = function(url, options){\n return new L.esri.Layers.TiledMapLayer(url, options);\n};"]}
\ No newline at end of file
diff --git a/dist/esri-leaflet-src.js b/dist/esri-leaflet-src.js
new file mode 100644
index 000000000..8bb747c4c
--- /dev/null
+++ b/dist/esri-leaflet-src.js
@@ -0,0 +1,3473 @@
+/*! esri-leaflet - v1.0.0-rc.6 - 2015-03-05
+* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
+* Apache License*/
+(function (factory) {
+ //define an AMD module that relies on 'leaflet'
+ if (typeof define === 'function' && define.amd) {
+ define(['leaflet'], function (L) {
+ return factory(L);
+ });
+ //define a common js module that relies on 'leaflet'
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ module.exports = factory(require('leaflet'));
+ }
+
+ if(typeof window !== 'undefined' && window.L){
+ factory(window.L);
+ }
+}(function (L) {
+var EsriLeaflet = { //jshint ignore:line
+ VERSION: '1.0.0-rc.5',
+ Layers: {},
+ Services: {},
+ Controls: {},
+ Tasks: {},
+ Util: {},
+ Support: {
+ CORS: !!(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()),
+ pointerEvents: document.documentElement.style.pointerEvents === ''
+ }
+};
+
+if(typeof window !== 'undefined' && window.L){
+ window.L.esri = EsriLeaflet;
+}
+
+
+(function(EsriLeaflet){
+
+ // normalize request animation frame
+ var raf = window.requestAnimationFrame ||
+ window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.msRequestAnimationFrame ||
+ function(cb) { return window.setTimeout(cb, 1000 / 60); };
+
+ // shallow object clone for feature properties and attributes
+ // from http://jsperf.com/cloning-an-object/2
+ function clone(obj) {
+ var target = {};
+ for (var i in obj) {
+ if (obj.hasOwnProperty(i)) {
+ target[i] = obj[i];
+ }
+ }
+ return target;
+ }
+
+ // checks if 2 x,y points are equal
+ function pointsEqual(a, b) {
+ for (var i = 0; i < a.length; i++) {
+ if (a[i] !== b[i]) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ // checks if the first and last points of a ring are equal and closes the ring
+ function closeRing(coordinates) {
+ if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {
+ coordinates.push(coordinates[0]);
+ }
+ return coordinates;
+ }
+
+ // determine if polygon ring coordinates are clockwise. clockwise signifies outer ring, counter-clockwise an inner ring
+ // or hole. this logic was found at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-
+ // points-are-in-clockwise-order
+ function ringIsClockwise(ringToTest) {
+ var total = 0,i = 0;
+ var rLength = ringToTest.length;
+ var pt1 = ringToTest[i];
+ var pt2;
+ for (i; i < rLength - 1; i++) {
+ pt2 = ringToTest[i + 1];
+ total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);
+ pt1 = pt2;
+ }
+ return (total >= 0);
+ }
+
+ // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L504-L519
+ function vertexIntersectsVertex(a1, a2, b1, b2) {
+ var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);
+ var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);
+ var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);
+
+ if ( uB !== 0 ) {
+ var ua = uaT / uB;
+ var ub = ubT / uB;
+
+ if ( 0 <= ua && ua <= 1 && 0 <= ub && ub <= 1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L521-L531
+ function arrayIntersectsArray(a, b) {
+ for (var i = 0; i < a.length - 1; i++) {
+ for (var j = 0; j < b.length - 1; j++) {
+ if (vertexIntersectsVertex(a[i], a[i + 1], b[j], b[j + 1])) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L470-L480
+ function coordinatesContainPoint(coordinates, point) {
+ var contains = false;
+ for(var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {
+ if (((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||
+ (coordinates[j][1] <= point[1] && point[1] < coordinates[i][1])) &&
+ (point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0])) {
+ contains = !contains;
+ }
+ }
+ return contains;
+ }
+
+ // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L106-L113
+ function coordinatesContainCoordinates(outer, inner){
+ var intersects = arrayIntersectsArray(outer, inner);
+ var contains = coordinatesContainPoint(outer, inner[0]);
+ if(!intersects && contains){
+ return true;
+ }
+ return false;
+ }
+
+ // do any polygons in this array contain any other polygons in this array?
+ // used for checking for holes in arcgis rings
+ // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L117-L172
+ function convertRingsToGeoJSON(rings){
+ var outerRings = [];
+ var holes = [];
+ var x; // iterator
+ var outerRing; // current outer ring being evaluated
+ var hole; // current hole being evaluated
+
+ // for each ring
+ for (var r = 0; r < rings.length; r++) {
+ var ring = closeRing(rings[r].slice(0));
+ if(ring.length < 4){
+ continue;
+ }
+ // is this ring an outer ring? is it clockwise?
+ if(ringIsClockwise(ring)){
+ var polygon = [ ring ];
+ outerRings.push(polygon); // push to outer rings
+ } else {
+ holes.push(ring); // counterclockwise push to holes
+ }
+ }
+
+ var uncontainedHoles = [];
+
+ // while there are holes left...
+ while(holes.length){
+ // pop a hole off out stack
+ hole = holes.pop();
+
+ // loop over all outer rings and see if they contain our hole.
+ var contained = false;
+ for (x = outerRings.length - 1; x >= 0; x--) {
+ outerRing = outerRings[x][0];
+ if(coordinatesContainCoordinates(outerRing, hole)){
+ // the hole is contained push it into our polygon
+ outerRings[x].push(hole);
+ contained = true;
+ break;
+ }
+ }
+
+ // ring is not contained in any outer ring
+ // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320
+ if(!contained){
+ uncontainedHoles.push(hole);
+ }
+ }
+
+ // if we couldn't match any holes using contains we can try intersects...
+ while(uncontainedHoles.length){
+ // pop a hole off out stack
+ hole = uncontainedHoles.pop();
+
+ // loop over all outer rings and see if any intersect our hole.
+ var intersects = false;
+ for (x = outerRings.length - 1; x >= 0; x--) {
+ outerRing = outerRings[x][0];
+ if(arrayIntersectsArray(outerRing, hole)){
+ // the hole is contained push it into our polygon
+ outerRings[x].push(hole);
+ intersects = true;
+ break;
+ }
+ }
+
+ if(!intersects) {
+ outerRings.push([hole.reverse()]);
+ }
+ }
+
+ if(outerRings.length === 1){
+ return {
+ type: 'Polygon',
+ coordinates: outerRings[0]
+ };
+ } else {
+ return {
+ type: 'MultiPolygon',
+ coordinates: outerRings
+ };
+ }
+ }
+
+ // This function ensures that rings are oriented in the right directions
+ // outer rings are clockwise, holes are counterclockwise
+ // used for converting GeoJSON Polygons to ArcGIS Polygons
+ function orientRings(poly){
+ var output = [];
+ var polygon = poly.slice(0);
+ var outerRing = closeRing(polygon.shift().slice(0));
+ if(outerRing.length >= 4){
+ if(!ringIsClockwise(outerRing)){
+ outerRing.reverse();
+ }
+
+ output.push(outerRing);
+
+ for (var i = 0; i < polygon.length; i++) {
+ var hole = closeRing(polygon[i].slice(0));
+ if(hole.length >= 4){
+ if(ringIsClockwise(hole)){
+ hole.reverse();
+ }
+ output.push(hole);
+ }
+ }
+ }
+
+ return output;
+ }
+
+ // This function flattens holes in multipolygons to one array of polygons
+ // used for converting GeoJSON Polygons to ArcGIS Polygons
+ function flattenMultiPolygonRings(rings){
+ var output = [];
+ for (var i = 0; i < rings.length; i++) {
+ var polygon = orientRings(rings[i]);
+ for (var x = polygon.length - 1; x >= 0; x--) {
+ var ring = polygon[x].slice(0);
+ output.push(ring);
+ }
+ }
+ return output;
+ }
+
+ // convert an extent (ArcGIS) to LatLngBounds (Leaflet)
+ EsriLeaflet.Util.extentToBounds = function(extent){
+ var sw = new L.LatLng(extent.ymin, extent.xmin);
+ var ne = new L.LatLng(extent.ymax, extent.xmax);
+ return new L.LatLngBounds(sw, ne);
+ };
+
+ // convert an LatLngBounds (Leaflet) to extent (ArcGIS)
+ EsriLeaflet.Util.boundsToExtent = function(bounds) {
+ bounds = L.latLngBounds(bounds);
+ return {
+ 'xmin': bounds.getSouthWest().lng,
+ 'ymin': bounds.getSouthWest().lat,
+ 'xmax': bounds.getNorthEast().lng,
+ 'ymax': bounds.getNorthEast().lat,
+ 'spatialReference': {
+ 'wkid' : 4326
+ }
+ };
+ };
+
+ EsriLeaflet.Util.arcgisToGeojson = function (arcgis, idAttribute){
+ var geojson = {};
+
+ if(typeof arcgis.x === 'number' && typeof arcgis.y === 'number'){
+ geojson.type = 'Point';
+ geojson.coordinates = [arcgis.x, arcgis.y];
+ }
+
+ if(arcgis.points){
+ geojson.type = 'MultiPoint';
+ geojson.coordinates = arcgis.points.slice(0);
+ }
+
+ if(arcgis.paths) {
+ if(arcgis.paths.length === 1){
+ geojson.type = 'LineString';
+ geojson.coordinates = arcgis.paths[0].slice(0);
+ } else {
+ geojson.type = 'MultiLineString';
+ geojson.coordinates = arcgis.paths.slice(0);
+ }
+ }
+
+ if(arcgis.rings) {
+ geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));
+ }
+
+ if(arcgis.geometry || arcgis.attributes) {
+ geojson.type = 'Feature';
+ geojson.geometry = (arcgis.geometry) ? EsriLeaflet.Util.arcgisToGeojson(arcgis.geometry) : null;
+ geojson.properties = (arcgis.attributes) ? clone(arcgis.attributes) : null;
+ if(arcgis.attributes) {
+ geojson.id = arcgis.attributes[idAttribute] || arcgis.attributes.OBJECTID || arcgis.attributes.FID;
+ }
+ }
+
+ return geojson;
+ };
+
+ // GeoJSON -> ArcGIS
+ EsriLeaflet.Util.geojsonToArcGIS = function(geojson, idAttribute){
+ idAttribute = idAttribute || 'OBJECTID';
+ var spatialReference = { wkid: 4326 };
+ var result = {};
+ var i;
+
+ switch(geojson.type){
+ case 'Point':
+ result.x = geojson.coordinates[0];
+ result.y = geojson.coordinates[1];
+ result.spatialReference = spatialReference;
+ break;
+ case 'MultiPoint':
+ result.points = geojson.coordinates.slice(0);
+ result.spatialReference = spatialReference;
+ break;
+ case 'LineString':
+ result.paths = [geojson.coordinates.slice(0)];
+ result.spatialReference = spatialReference;
+ break;
+ case 'MultiLineString':
+ result.paths = geojson.coordinates.slice(0);
+ result.spatialReference = spatialReference;
+ break;
+ case 'Polygon':
+ result.rings = orientRings(geojson.coordinates.slice(0));
+ result.spatialReference = spatialReference;
+ break;
+ case 'MultiPolygon':
+ result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));
+ result.spatialReference = spatialReference;
+ break;
+ case 'Feature':
+ if(geojson.geometry) {
+ result.geometry = EsriLeaflet.Util.geojsonToArcGIS(geojson.geometry, idAttribute);
+ }
+ result.attributes = (geojson.properties) ? clone(geojson.properties) : {};
+ if(geojson.id){
+ result.attributes[idAttribute] = geojson.id;
+ }
+ break;
+ case 'FeatureCollection':
+ result = [];
+ for (i = 0; i < geojson.features.length; i++){
+ result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.features[i], idAttribute));
+ }
+ break;
+ case 'GeometryCollection':
+ result = [];
+ for (i = 0; i < geojson.geometries.length; i++){
+ result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.geometries[i], idAttribute));
+ }
+ break;
+ }
+
+ return result;
+ };
+
+ EsriLeaflet.Util.responseToFeatureCollection = function(response, idAttribute){
+ var objectIdField;
+
+ if(idAttribute){
+ objectIdField = idAttribute;
+ } else if(response.objectIdFieldName){
+ objectIdField = response.objectIdFieldName;
+ } else if(response.fields) {
+ for (var j = 0; j <= response.fields.length - 1; j++) {
+ if(response.fields[j].type === 'esriFieldTypeOID') {
+ objectIdField = response.fields[j].name;
+ break;
+ }
+ }
+ } else {
+ objectIdField = 'OBJECTID';
+ }
+
+ var featureCollection = {
+ type: 'FeatureCollection',
+ features: []
+ };
+ var features = response.features || response.results;
+ if(features.length){
+ for (var i = features.length - 1; i >= 0; i--) {
+ featureCollection.features.push(EsriLeaflet.Util.arcgisToGeojson(features[i], objectIdField));
+ }
+ }
+
+ return featureCollection;
+ };
+
+ // trim whitespace and add a tailing slash is needed to a url
+ EsriLeaflet.Util.cleanUrl = function(url){
+ url = url.replace(/\s\s*/g, '');
+
+ //add a trailing slash to the url if the user omitted it
+ if(url[url.length-1] !== '/'){
+ url += '/';
+ }
+
+ return url;
+ };
+
+ EsriLeaflet.Util.isArcgisOnline = function(url){
+ return (/\.arcgis\.com/g).test(url);
+ };
+
+ EsriLeaflet.Util.geojsonTypeToArcGIS = function (geoJsonType) {
+ var arcgisGeometryType;
+ switch (geoJsonType) {
+ case 'Point':
+ arcgisGeometryType = 'esriGeometryPoint';
+ break;
+ case 'MultiPoint':
+ arcgisGeometryType = 'esriGeometryMultipoint';
+ break;
+ case 'LineString':
+ arcgisGeometryType = 'esriGeometryPolyline';
+ break;
+ case 'MultiLineString':
+ arcgisGeometryType = 'esriGeometryPolyline';
+ break;
+ case 'Polygon':
+ arcgisGeometryType = 'esriGeometryPolygon';
+ break;
+ case 'MultiPolygon':
+ arcgisGeometryType = 'esriGeometryPolygon';
+ break;
+ }
+ return arcgisGeometryType;
+ };
+
+ EsriLeaflet.Util.requestAnimationFrame = L.Util.bind(raf, window);
+
+})(EsriLeaflet);
+
+(function(EsriLeaflet){
+
+ var callbacks = 0;
+
+ window._EsriLeafletCallbacks = {};
+
+ function serialize(params){
+ var data = '';
+
+ params.f = params.f || 'json';
+
+ for (var key in params){
+ if(params.hasOwnProperty(key)){
+ var param = params[key];
+ var type = Object.prototype.toString.call(param);
+ var value;
+
+ if(data.length){
+ data += '&';
+ }
+
+ if (type === '[object Array]'){
+ value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');
+ } else if (type === '[object Object]') {
+ value = JSON.stringify(param);
+ } else if (type === '[object Date]'){
+ value = param.valueOf();
+ } else {
+ value = param;
+ }
+
+ data += encodeURIComponent(key) + '=' + encodeURIComponent(value);
+ }
+ }
+
+ return data;
+ }
+
+ function createRequest(callback, context){
+ var httpRequest = new XMLHttpRequest();
+
+ httpRequest.onerror = function(e) {
+ httpRequest.onreadystatechange = L.Util.falseFn;
+
+ callback.call(context, {
+ error: {
+ code: 500,
+ message: 'XMLHttpRequest error'
+ }
+ }, null);
+ };
+
+ httpRequest.onreadystatechange = function(){
+ var response;
+ var error;
+
+ if (httpRequest.readyState === 4) {
+ try {
+ response = JSON.parse(httpRequest.responseText);
+ } catch(e) {
+ response = null;
+ error = {
+ code: 500,
+ message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'
+ };
+ }
+
+ if (!error && response.error) {
+ error = response.error;
+ response = null;
+ }
+
+ httpRequest.onerror = L.Util.falseFn;
+
+ callback.call(context, error, response);
+ }
+ };
+
+ return httpRequest;
+ }
+
+ // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)
+ EsriLeaflet.Request = {
+ request: function(url, params, callback, context){
+ var paramString = serialize(params);
+ var httpRequest = createRequest(callback, context);
+ var requestLength = (url + '?' + paramString).length;
+
+ // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest
+ if(requestLength <= 2000 && L.esri.Support.CORS){
+ httpRequest.open('GET', url + '?' + paramString);
+ httpRequest.send(null);
+
+ // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest
+ } else if (requestLength > 2000 && L.esri.Support.CORS){
+ httpRequest.open('POST', url);
+ httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ httpRequest.send(paramString);
+
+ // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request
+ } else if(requestLength <= 2000 && !L.esri.Support.CORS){
+ return L.esri.Request.get.JSONP(url, params, callback, context);
+
+ // request is longer then 2000 characters and the browser does not support CORS, log a warning
+ } else {
+ if(console && console.warn){
+ console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');
+ return;
+ }
+ }
+
+ return httpRequest;
+ },
+ post: {
+ XMLHTTP: function (url, params, callback, context) {
+ var httpRequest = createRequest(callback, context);
+ httpRequest.open('POST', url);
+ httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ httpRequest.send(serialize(params));
+
+ return httpRequest;
+ }
+ },
+
+ get: {
+ CORS: function (url, params, callback, context) {
+ var httpRequest = createRequest(callback, context);
+
+ httpRequest.open('GET', url + '?' + serialize(params), true);
+ httpRequest.send(null);
+
+ return httpRequest;
+ },
+ JSONP: function(url, params, callback, context){
+ var callbackId = 'c' + callbacks;
+
+ params.callback = 'window._EsriLeafletCallbacks.' + callbackId;
+
+ var script = L.DomUtil.create('script', null, document.body);
+ script.type = 'text/javascript';
+ script.src = url + '?' + serialize(params);
+ script.id = callbackId;
+
+ window._EsriLeafletCallbacks[callbackId] = function(response){
+ if(window._EsriLeafletCallbacks[callbackId] !== true){
+ var error;
+ var responseType = Object.prototype.toString.call(response);
+
+ if(!(responseType === '[object Object]' || responseType === '[object Array]')){
+ error = {
+ error: {
+ code: 500,
+ message: 'Expected array or object as JSONP response'
+ }
+ };
+ response = null;
+ }
+
+ if (!error && response.error) {
+ error = response;
+ response = null;
+ }
+
+ callback.call(context, error, response);
+ window._EsriLeafletCallbacks[callbackId] = true;
+ }
+ };
+
+ callbacks++;
+
+ return {
+ id: callbackId,
+ url: script.src,
+ abort: function(){
+ window._EsriLeafletCallbacks._callback[callbackId]({
+ code: 0,
+ message: 'Request aborted.'
+ });
+ }
+ };
+ }
+ }
+ };
+
+ // choose the correct AJAX handler depending on CORS support
+ EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;
+
+ // always use XMLHttpRequest for posts
+ EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;
+
+ // expose a common request method the uses GET\POST based on request length
+ EsriLeaflet.request = EsriLeaflet.Request.request;
+
+})(EsriLeaflet);
+
+EsriLeaflet.Services.Service = L.Class.extend({
+
+ includes: L.Mixin.Events,
+
+ options: {
+ proxy: false,
+ useCors: EsriLeaflet.Support.CORS
+ },
+
+ initialize: function (options) {
+ options = options || {};
+ this._requestQueue = [];
+ this._authenticating = false;
+ L.Util.setOptions(this, options);
+ this.options.url = EsriLeaflet.Util.cleanUrl(this.options.url);
+ },
+
+ get: function (path, params, callback, context) {
+ return this._request('get', path, params, callback, context);
+ },
+
+ post: function (path, params, callback, context) {
+ return this._request('post', path, params, callback, context);
+ },
+
+ request: function (path, params, callback, context) {
+ return this._request('request', path, params, callback, context);
+ },
+
+ metadata: function (callback, context) {
+ return this._request('get', '', {}, callback, context);
+ },
+
+ authenticate: function(token){
+ this._authenticating = false;
+ this.options.token = token;
+ this._runQueue();
+ return this;
+ },
+
+ _request: function(method, path, params, callback, context){
+ this.fire('requeststart', {
+ url: this.options.url + path,
+ params: params,
+ method: method
+ });
+
+ var wrappedCallback = this._createServiceCallback(method, path, params, callback, context);
+
+ if (this.options.token) {
+ params.token = this.options.token;
+ }
+
+ if (this._authenticating) {
+ this._requestQueue.push([method, path, params, callback, context]);
+ return;
+ } else {
+ var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;
+
+ if((method === 'get' || method === 'request') && !this.options.useCors){
+ return EsriLeaflet.Request.get.JSONP(url, params, wrappedCallback);
+ } else {
+ return EsriLeaflet[method](url, params, wrappedCallback);
+ }
+ }
+ },
+
+ _createServiceCallback: function(method, path, params, callback, context){
+ var request = [method, path, params, callback, context];
+
+ return L.Util.bind(function(error, response){
+
+ if (error && (error.code === 499 || error.code === 498)) {
+ this._authenticating = true;
+
+ this._requestQueue.push(request);
+
+ this.fire('authenticationrequired', {
+ authenticate: L.Util.bind(this.authenticate, this)
+ });
+ } else {
+ callback.call(context, error, response);
+
+ if(error) {
+ this.fire('requesterror', {
+ url: this.options.url + path,
+ params: params,
+ message: error.message,
+ code: error.code,
+ method: method
+ });
+ } else {
+ this.fire('requestsuccess', {
+ url: this.options.url + path,
+ params: params,
+ response: response,
+ method: method
+ });
+ }
+
+ this.fire('requestend', {
+ url: this.options.url + path,
+ params: params,
+ method: method
+ });
+ }
+ }, this);
+ },
+
+ _runQueue: function(){
+ for (var i = this._requestQueue.length - 1; i >= 0; i--) {
+ var request = this._requestQueue[i];
+ var method = request.shift();
+ this[method].apply(this, request);
+ }
+ this._requestQueue = [];
+ }
+
+});
+
+EsriLeaflet.Services.service = function(params){
+ return new EsriLeaflet.Services.Service(params);
+};
+
+EsriLeaflet.Services.FeatureLayer = EsriLeaflet.Services.Service.extend({
+
+ options: {
+ idAttribute: 'OBJECTID'
+ },
+
+ query: function(){
+ return new EsriLeaflet.Tasks.Query(this);
+ },
+
+ addFeature: function(feature, callback, context) {
+ delete feature.id;
+
+ feature = EsriLeaflet.Util.geojsonToArcGIS(feature);
+
+ return this.post('addFeatures', {
+ features: [feature]
+ }, function(error, response){
+ var result = (response && response.addResults) ? response.addResults[0] : undefined;
+ if(callback){
+ callback.call(this, error || response.addResults[0].error, result);
+ }
+ }, context);
+ },
+
+ updateFeature: function(feature, callback, context) {
+ feature = EsriLeaflet.Util.geojsonToArcGIS(feature, this.options.idAttribute);
+
+ return this.post('updateFeatures', {
+ features: [feature]
+ }, function(error, response){
+ var result = (response && response.updateResults) ? response.updateResults[0] : undefined;
+ if(callback){
+ callback.call(context, error || response.updateResults[0].error, result);
+ }
+ }, context);
+ },
+
+ deleteFeature: function(id, callback, context) {
+ return this.post('deleteFeatures', {
+ objectIds: id
+ }, function(error, response){
+ var result = (response && response.deleteResults) ? response.deleteResults[0] : undefined;
+ if(callback){
+ callback.call(context, error || response.deleteResults[0].error, result);
+ }
+ }, context);
+ }
+
+});
+
+EsriLeaflet.Services.featureLayer = function(options) {
+ return new EsriLeaflet.Services.FeatureLayer(options);
+};
+
+EsriLeaflet.Services.MapService = EsriLeaflet.Services.Service.extend({
+
+ identify: function () {
+ return new EsriLeaflet.Tasks.identifyFeatures(this);
+ },
+
+ find: function () {
+ return new EsriLeaflet.Tasks.Find(this);
+ },
+
+ query: function () {
+ return new EsriLeaflet.Tasks.Query(this);
+ }
+
+});
+
+EsriLeaflet.Services.mapService = function(params){
+ return new EsriLeaflet.Services.MapService(params);
+};
+
+EsriLeaflet.Services.ImageService = EsriLeaflet.Services.Service.extend({
+
+ query: function () {
+ return new EsriLeaflet.Tasks.Query(this);
+ },
+
+ identify: function() {
+ return new EsriLeaflet.Tasks.IdentifyImage(this);
+ }
+});
+
+EsriLeaflet.Services.imageService = function(params){
+ return new EsriLeaflet.Services.ImageService(params);
+};
+
+EsriLeaflet.Tasks.Task = L.Class.extend({
+
+ options: {
+ proxy: false,
+ useCors: EsriLeaflet.Support.CORS
+ },
+
+ //Generate a method for each methodName:paramName in the setters for this task.
+ generateSetter: function(param, context){
+ return L.Util.bind(function(value){
+ this.params[param] = value;
+ return this;
+ }, context);
+ },
+
+ initialize: function(endpoint){
+ // endpoint can be either a url (and options) for an ArcGIS Rest Service or an instance of EsriLeaflet.Service
+ if(endpoint.request && endpoint.options){
+ this._service = endpoint;
+ L.Util.setOptions(this, endpoint.options);
+ } else {
+ L.Util.setOptions(this, endpoint);
+ this.options.url = L.esri.Util.cleanUrl(endpoint.url);
+ }
+
+ // clone default params into this object
+ this.params = L.Util.extend({}, this.params || {});
+
+ // generate setter methods based on the setters object implimented a child class
+ if(this.setters){
+ for (var setter in this.setters){
+ var param = this.setters[setter];
+ this[setter] = this.generateSetter(param, this);
+ }
+ }
+ },
+
+ token: function(token){
+ if(this._service){
+ this._service.authenticate(token);
+ } else {
+ this.params.token = token;
+ }
+ return this;
+ },
+
+ request: function(callback, context){
+ if(this._service){
+ return this._service.request(this.path, this.params, callback, context);
+ } else {
+ return this._request('request', this.path, this.params, callback, context);
+ }
+ },
+
+ _request: function(method, path, params, callback, context){
+ var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;
+ if((method === 'get' || method === 'request') && !this.options.useCors){
+ return EsriLeaflet.Request.get.JSONP(url, params, callback, context);
+ } else{
+ return EsriLeaflet[method](url, params, callback, context);
+ }
+ }
+});
+
+EsriLeaflet.Tasks.Query = EsriLeaflet.Tasks.Task.extend({
+ setters: {
+ 'offset': 'offset',
+ 'limit': 'limit',
+ 'fields': 'outFields',
+ 'precision': 'geometryPrecision',
+ 'featureIds': 'objectIds',
+ 'returnGeometry': 'returnGeometry',
+ 'token': 'token'
+ },
+
+ path: 'query',
+
+ params: {
+ returnGeometry: true,
+ where: '1=1',
+ outSr: 4326,
+ outFields: '*'
+ },
+
+ within: function(geometry){
+ this._setGeometry(geometry);
+ this.params.spatialRel = 'esriSpatialRelContains'; // will make code read layer within geometry, to the api this will reads geometry contains layer
+ return this;
+ },
+
+ intersects: function(geometry){
+ this._setGeometry(geometry);
+ this.params.spatialRel = 'esriSpatialRelIntersects';
+ return this;
+ },
+
+ contains: function(geometry){
+ this._setGeometry(geometry);
+ this.params.spatialRel = 'esriSpatialRelWithin'; // will make code read layer contains geometry, to the api this will reads geometry within layer
+ return this;
+ },
+
+ // crosses: function(geometry){
+ // this._setGeometry(geometry);
+ // this.params.spatialRel = 'esriSpatialRelCrosses';
+ // return this;
+ // },
+
+ // touches: function(geometry){
+ // this._setGeometry(geometry);
+ // this.params.spatialRel = 'esriSpatialRelTouches';
+ // return this;
+ // },
+
+ overlaps: function(geometry){
+ this._setGeometry(geometry);
+ this.params.spatialRel = 'esriSpatialRelOverlaps';
+ return this;
+ },
+
+ // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online
+ nearby: function(latlng, radius){
+ latlng = L.latLng(latlng);
+ this.params.geometry = [latlng.lng, latlng.lat];
+ this.params.geometryType = 'esriGeometryPoint';
+ this.params.spatialRel = 'esriSpatialRelIntersects';
+ this.params.units = 'esriSRUnit_Meter';
+ this.params.distance = radius;
+ this.params.inSr = 4326;
+ return this;
+ },
+
+ where: function(string){
+ this.params.where = string.replace(/"/g, "\'"); // jshint ignore:line
+ return this;
+ },
+
+ between: function(start, end){
+ this.params.time = [start.valueOf(), end.valueOf()];
+ return this;
+ },
+
+ simplify: function(map, factor){
+ var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());
+ this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;
+ return this;
+ },
+
+ orderBy: function(fieldName, order){
+ order = order || 'ASC';
+ this.params.orderByFields = (this.params.orderByFields) ? this.params.orderByFields + ',' : '';
+ this.params.orderByFields += ([fieldName, order]).join(' ');
+ return this;
+ },
+
+ run: function(callback, context){
+ this._cleanParams();
+
+ // if the service is hosted on arcgis online request geojson directly
+ if(EsriLeaflet.Util.isArcgisOnline(this.options.url)){
+ this.params.f = 'geojson';
+
+ return this.request(function(error, response){
+ callback.call(context, error, response, response);
+ }, context);
+
+ // otherwise convert it in the callback then pass it on
+ } else {
+ return this.request(function(error, response){
+ callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);
+ }, context);
+ }
+ },
+
+ count: function(callback, context){
+ this._cleanParams();
+ this.params.returnCountOnly = true;
+ return this.request(function(error, response){
+ callback.call(this, error, (response && response.count), response);
+ }, context);
+ },
+
+ ids: function(callback, context){
+ this._cleanParams();
+ this.params.returnIdsOnly = true;
+ return this.request(function(error, response){
+ callback.call(this, error, (response && response.objectIds), response);
+ }, context);
+ },
+
+ // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online
+ bounds: function(callback, context){
+ this._cleanParams();
+ this.params.returnExtentOnly = true;
+ return this.request(function(error, response){
+ callback.call(context, error, (response && response.extent && EsriLeaflet.Util.extentToBounds(response.extent)), response);
+ }, context);
+ },
+
+ // only valid for image services
+ pixelSize: function(point){
+ point = L.point(point);
+ this.params.pixelSize = [point.x,point.y];
+ return this;
+ },
+
+ // only valid for map services
+ layer: function(layer){
+ this.path = layer + '/query';
+ return this;
+ },
+
+ _cleanParams: function(){
+ delete this.params.returnIdsOnly;
+ delete this.params.returnExtentOnly;
+ delete this.params.returnCountOnly;
+ },
+
+ _setGeometry: function(geometry) {
+ this.params.inSr = 4326;
+
+ // convert bounds to extent and finish
+ if ( geometry instanceof L.LatLngBounds ) {
+ // set geometry + geometryType
+ this.params.geometry = EsriLeaflet.Util.boundsToExtent(geometry);
+ this.params.geometryType = 'esriGeometryEnvelope';
+ return;
+ }
+
+ // convert L.Marker > L.LatLng
+ if(geometry.getLatLng){
+ geometry = geometry.getLatLng();
+ }
+
+ // convert L.LatLng to a geojson point and continue;
+ if (geometry instanceof L.LatLng) {
+ geometry = {
+ type: 'Point',
+ coordinates: [geometry.lng, geometry.lat]
+ };
+ }
+
+ // handle L.GeoJSON, pull out the first geometry
+ if ( geometry instanceof L.GeoJSON ) {
+ //reassign geometry to the GeoJSON value (we are assuming that only one feature is present)
+ geometry = geometry.getLayers()[0].feature.geometry;
+ this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);
+ this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);
+ }
+
+ // Handle L.Polyline and L.Polygon
+ if (geometry.toGeoJSON) {
+ geometry = geometry.toGeoJSON();
+ }
+
+ // handle GeoJSON feature by pulling out the geometry
+ if ( geometry.type === 'Feature' ) {
+ // get the geometry of the geojson feature
+ geometry = geometry.geometry;
+ }
+
+ // confirm that our GeoJSON is a point, line or polygon
+ if ( geometry.type === 'Point' || geometry.type === 'LineString' || geometry.type === 'Polygon') {
+ this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);
+ this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);
+ return;
+ }
+
+ // warn the user if we havn't found a
+ /* global console */
+ if(console && console.warn) {
+ console.warn('invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object');
+ }
+
+ return;
+ }
+});
+
+EsriLeaflet.Tasks.query = function(params){
+ return new EsriLeaflet.Tasks.Query(params);
+};
+
+EsriLeaflet.Tasks.Find = EsriLeaflet.Tasks.Task.extend({
+ setters: {
+ // method name > param name
+ 'contains': 'contains',
+ 'text': 'searchText',
+ 'fields': 'searchFields', // denote an array or single string
+ 'spatialReference': 'sr',
+ 'sr': 'sr',
+ 'layers': 'layers',
+ 'returnGeometry': 'returnGeometry',
+ 'maxAllowableOffset': 'maxAllowableOffset',
+ 'precision': 'geometryPrecision',
+ 'dynamicLayers': 'dynamicLayers',
+ 'returnZ' : 'returnZ',
+ 'returnM' : 'returnM',
+ 'gdbVersion' : 'gdbVersion',
+ 'token' : 'token'
+ },
+
+ path: 'find',
+
+ params: {
+ sr: 4326,
+ contains: true,
+ returnGeometry: true,
+ returnZ: true,
+ returnM: false
+ },
+
+ layerDefs: function (id, where) {
+ this.params.layerDefs = (this.params.layerDefs) ? this.params.layerDefs + ';' : '';
+ this.params.layerDefs += ([id, where]).join(':');
+ return this;
+ },
+
+ simplify: function(map, factor){
+ var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());
+ this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;
+ return this;
+ },
+
+ run: function (callback, context) {
+ return this.request(function(error, response){
+ callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);
+ }, context);
+ }
+});
+
+EsriLeaflet.Tasks.find = function (params) {
+ return new EsriLeaflet.Tasks.Find(params);
+};
+
+EsriLeaflet.Tasks.Identify = EsriLeaflet.Tasks.Task.extend({
+ path: 'identify',
+
+ between: function(start, end){
+ this.params.time = [start.valueOf(), end.valueOf()];
+ return this;
+ }
+});
+
+
+EsriLeaflet.Tasks.IdentifyImage = EsriLeaflet.Tasks.Identify.extend({
+ setters: {
+ 'setMosaicRule': 'mosaicRule',
+ 'setRenderingRule': 'renderingRule',
+ 'setPixelSize': 'pixelSize',
+ 'returnCatalogItems': 'returnCatalogItems',
+ 'returnGeometry': 'returnGeometry'
+ },
+
+ params: {
+ returnGeometry: false
+ },
+
+ at: function(latlng){
+ latlng = L.latLng(latlng);
+ this.params.geometry = JSON.stringify({
+ x: latlng.lng,
+ y: latlng.lat,
+ spatialReference:{
+ wkid: 4326
+ }
+ });
+ this.params.geometryType = 'esriGeometryPoint';
+ return this;
+ },
+
+ getMosaicRule: function() {
+ return this.params.mosaicRule;
+ },
+
+ getRenderingRule: function() {
+ return this.params.renderingRule;
+ },
+
+ getPixelSize: function() {
+ return this.params.pixelSize;
+ },
+
+ run: function (callback, context){
+ return this.request(function(error, response){
+ callback.call(context, error, (response && this._responseToGeoJSON(response)), response);
+ }, this);
+ },
+
+ // get pixel data and return as geoJSON point
+ // populate catalog items (if any)
+ // merging in any catalogItemVisibilities as a propery of each feature
+ _responseToGeoJSON: function(response) {
+ var location = response.location;
+ var catalogItems = response.catalogItems;
+ var catalogItemVisibilities = response.catalogItemVisibilities;
+ var geoJSON = {
+ 'pixel': {
+ 'type': 'Feature',
+ 'geometry': {
+ 'type': 'Point',
+ 'coordinates': [location.x, location.y]
+ },
+ 'crs': {
+ 'type': 'EPSG',
+ 'properties': {
+ 'code': location.spatialReference.wkid
+ }
+ },
+ 'properties': {
+ 'OBJECTID': response.objectId,
+ 'name': response.name,
+ 'value': response.value
+ },
+ 'id': response.objectId
+ }
+ };
+ if (response.properties && response.properties.Values) {
+ geoJSON.pixel.properties.values = response.properties.Values;
+ }
+ if (catalogItems && catalogItems.features) {
+ geoJSON.catalogItems = EsriLeaflet.Util.responseToFeatureCollection(catalogItems);
+ if (catalogItemVisibilities && catalogItemVisibilities.length === geoJSON.catalogItems.features.length) {
+ for (var i = catalogItemVisibilities.length - 1; i >= 0; i--) {
+ geoJSON.catalogItems.features[i].properties.catalogItemVisibility = catalogItemVisibilities[i];
+ }
+ }
+ }
+ return geoJSON;
+ }
+
+});
+
+EsriLeaflet.Tasks.identifyImage = function(params){
+ return new EsriLeaflet.Tasks.IdentifyImage(params);
+};
+
+EsriLeaflet.Tasks.IdentifyFeatures = EsriLeaflet.Tasks.Identify.extend({
+ setters: {
+ 'layers': 'layers',
+ 'precision': 'geometryPrecision',
+ 'tolerance': 'tolerance',
+ 'returnGeometry': 'returnGeometry'
+ },
+
+ params: {
+ sr: 4326,
+ layers: 'all',
+ tolerance: 3,
+ returnGeometry: true
+ },
+
+ on: function(map){
+ var extent = EsriLeaflet.Util.boundsToExtent(map.getBounds());
+ var size = map.getSize();
+ this.params.imageDisplay = [size.x, size.y, 96];
+ this.params.mapExtent = [extent.xmin, extent.ymin, extent.xmax, extent.ymax];
+ return this;
+ },
+
+ at: function(latlng){
+ latlng = L.latLng(latlng);
+ this.params.geometry = [latlng.lng, latlng.lat];
+ this.params.geometryType = 'esriGeometryPoint';
+ return this;
+ },
+
+ layerDef: function (id, where){
+ this.params.layerDefs = (this.params.layerDefs) ? this.params.layerDefs + ';' : '';
+ this.params.layerDefs += ([id, where]).join(':');
+ return this;
+ },
+
+ simplify: function(map, factor){
+ var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());
+ this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * (1 - factor);
+ return this;
+ },
+
+ run: function (callback, context){
+ return this.request(function(error, response){
+ var featureCollection = EsriLeaflet.Util.responseToFeatureCollection(response);
+ var count = featureCollection.features.length;
+ // tag each feature with the Id of its parent layer
+ if(!error && count > 0){
+ response.results = response.results.reverse();
+ for (var i = 0; i < count; i++) {
+ var feature = featureCollection.features[i];
+ feature.layerId = response.results[i].layerId;
+ }
+ }
+ callback.call(context, error, (response && featureCollection), response);
+ }, context);
+ }
+
+});
+
+EsriLeaflet.Tasks.identifyFeatures = function(params){
+ return new EsriLeaflet.Tasks.IdentifyFeatures(params);
+};
+
+(function(EsriLeaflet){
+
+ var tileProtocol = (window.location.protocol !== 'https:') ? 'http:' : 'https:';
+
+ EsriLeaflet.Layers.BasemapLayer = L.TileLayer.extend({
+ statics: {
+ TILES: {
+ Streets: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',
+ attributionUrl: 'https://static.arcgis.com/attribution/World_Street_Map',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 19,
+ subdomains: ['server', 'services'],
+ attribution: 'Esri'
+ }
+ },
+ Topographic: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}',
+ attributionUrl: 'https://static.arcgis.com/attribution/World_Topo_Map',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 19,
+ subdomains: ['server', 'services'],
+ attribution: 'Esri'
+ }
+ },
+ Oceans: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}',
+ attributionUrl: 'https://static.arcgis.com/attribution/Ocean_Basemap',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 16,
+ subdomains: ['server', 'services'],
+ attribution: 'Esri'
+ }
+ },
+ OceansLabels: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: true,
+ logoPosition: 'bottomright',
+ //pane: 'esri-label',
+ minZoom: 1,
+ maxZoom: 16,
+ subdomains: ['server', 'services']
+ }
+ },
+ NationalGeographic: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 16,
+ subdomains: ['server', 'services'],
+ attribution: 'Esri'
+ }
+ },
+ DarkGray: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 16,
+ subdomains: ['server', 'services'],
+ attribution: 'Esri, DeLorme, HERE'
+ }
+ },
+ DarkGrayLabels: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: true,
+ logoPosition: 'bottomright',
+ //pane: 'esri-label',
+ minZoom: 1,
+ maxZoom: 16,
+ subdomains: ['server', 'services']
+ }
+ },
+ Gray: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 16,
+ subdomains: ['server', 'services'],
+ attribution: 'Esri, NAVTEQ, DeLorme'
+ }
+ },
+ GrayLabels: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: true,
+ logoPosition: 'bottomright',
+ //pane: 'esri-label',
+ minZoom: 1,
+ maxZoom: 16,
+ subdomains: ['server', 'services']
+ }
+ },
+ Imagery: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 19,
+ subdomains: ['server', 'services'],
+ attribution: 'Esri, DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community'
+ }
+ },
+ ImageryLabels: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: true,
+ logoPosition: 'bottomright',
+ //pane: 'esri-label',
+ minZoom: 1,
+ maxZoom: 19,
+ subdomains: ['server', 'services']
+ }
+ },
+ ImageryTransportation: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}',
+ //pane: 'esri-label',
+ options: {
+ hideLogo: true,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 19,
+ subdomains: ['server', 'services']
+ }
+ },
+ ShadedRelief: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 13,
+ subdomains: ['server', 'services'],
+ attribution: 'ESRI, NAVTEQ, DeLorme'
+ }
+ },
+ ShadedReliefLabels: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: true,
+ logoPosition: 'bottomright',
+ //pane: 'esri-label',
+ minZoom: 1,
+ maxZoom: 12,
+ subdomains: ['server', 'services']
+ }
+ },
+ Terrain: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: false,
+ logoPosition: 'bottomright',
+ minZoom: 1,
+ maxZoom: 13,
+ subdomains: ['server', 'services'],
+ attribution: 'Esri, USGS, NOAA'
+ }
+ },
+ TerrainLabels: {
+ urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}',
+ options: {
+ hideLogo: true,
+ logoPosition: 'bottomright',
+ //pane: 'esri-label',
+ minZoom: 1,
+ maxZoom: 13,
+ subdomains: ['server', 'services']
+ }
+ }
+ }
+ },
+ initialize: function(key, options){
+ var config;
+
+ // set the config variable with the appropriate config object
+ if (typeof key === 'object' && key.urlTemplate && key.options){
+ config = key;
+ } else if(typeof key === 'string' && EsriLeaflet.BasemapLayer.TILES[key]){
+ config = EsriLeaflet.BasemapLayer.TILES[key];
+ } else {
+ throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of "Streets", "Topographic", "Oceans", "OceansLabels", "NationalGeographic", "Gray", "GrayLabels", "DarkGray", "DarkGrayLabels", "Imagery", "ImageryLabels", "ImageryTransportation", "ShadedRelief", "ShadedReliefLabels", "Terrain" or "TerrainLabels"');
+ }
+
+ // merge passed options into the config options
+ var tileOptions = L.Util.extend(config.options, options);
+
+ // call the initialize method on L.TileLayer to set everything up
+ L.TileLayer.prototype.initialize.call(this, config.urlTemplate, L.Util.setOptions(this, tileOptions));
+
+ // if this basemap requires dynamic attribution set it up
+ if(config.attributionUrl){
+ this._getAttributionData(config.attributionUrl);
+ }
+ this._logo = new EsriLeaflet.Controls.Logo({
+ position: this.options.logoPosition
+ });
+ },
+ onAdd: function(map){
+ if(!this.options.hideLogo && !map._hasEsriLogo){
+ this._logo.addTo(map);
+ map._hasEsriLogo = true;
+ }
+
+ // if(this.options.pane && EsriLeaflet.Support.pointerEvents){
+ // this._initPane();
+ // }
+
+ L.TileLayer.prototype.onAdd.call(this, map);
+
+ map.on('moveend', this._updateMapAttribution, this);
+ },
+ onRemove: function(map){
+ // check to make sure the logo hasn't already been removed
+ if(this._logo && this._logo._container){
+ map.removeControl(this._logo);
+ map._hasEsriLogo = false;
+ }
+
+ L.TileLayer.prototype.onRemove.call(this, map);
+
+ map.off('moveend', this._updateMapAttribution, this);
+ },
+ getAttribution:function(){
+ var attribution = '' + this.options.attribution + ''/* + logo*/;
+ return attribution;
+ },
+ // _initPane: function(){
+ // if(!this._map.getPane(this.options.pane)){
+ // var pane = this._map.createPane(this.options.pane);
+ // pane.style.pointerEvents = 'none';
+ // pane.style.zIndex = 5;
+ // }
+ // },
+ _getAttributionData: function(url){
+ EsriLeaflet.get(url, {}, function(error, attributions){
+ this._attributions = [];
+ for (var c = 0; c < attributions.contributors.length; c++) {
+ var contributor = attributions.contributors[c];
+ for (var i = 0; i < contributor.coverageAreas.length; i++) {
+ var coverageArea = contributor.coverageAreas[i];
+ var southWest = new L.LatLng(coverageArea.bbox[0], coverageArea.bbox[1]);
+ var northEast = new L.LatLng(coverageArea.bbox[2], coverageArea.bbox[3]);
+ this._attributions.push({
+ attribution: contributor.attribution,
+ score: coverageArea.score,
+ bounds: new L.LatLngBounds(southWest, northEast),
+ minZoom: coverageArea.zoomMin,
+ maxZoom: coverageArea.zoomMax
+ });
+ }
+ }
+
+ this._attributions.sort(function(a, b){
+ return b.score - a.score;
+ });
+
+ this._updateMapAttribution();
+ }, this);
+ },
+ _updateMapAttribution: function(){
+ if(this._map && this._map.attributionControl && this._attributions){
+ var newAttributions = '';
+ var bounds = this._map.getBounds();
+ var zoom = this._map.getZoom();
+
+ for (var i = 0; i < this._attributions.length; i++) {
+ var attribution = this._attributions[i];
+ var text = attribution.attribution;
+ if(!newAttributions.match(text) && bounds.intersects(attribution.bounds) && zoom >= attribution.minZoom && zoom <= attribution.maxZoom) {
+ newAttributions += (', ' + text);
+ }
+ }
+ newAttributions = newAttributions.substr(2);
+ var attributionElement = this._map.attributionControl._container.querySelector('.esri-attributions');
+ attributionElement.innerHTML = newAttributions;
+ attributionElement.style.maxWidth = (this._map.getSize().x * 0.65) + 'px';
+ this.fire('attributionupdated', {
+ attribution: newAttributions
+ });
+ }
+ }
+ });
+
+ EsriLeaflet.BasemapLayer = EsriLeaflet.Layers.BasemapLayer;
+
+ EsriLeaflet.Layers.basemapLayer = function(key, options){
+ return new EsriLeaflet.Layers.BasemapLayer(key, options);
+ };
+
+ EsriLeaflet.basemapLayer = function(key, options){
+ return new EsriLeaflet.Layers.BasemapLayer(key, options);
+ };
+
+})(EsriLeaflet);
+
+EsriLeaflet.Layers.RasterLayer = L.Class.extend({
+ includes: L.Mixin.Events,
+
+ options: {
+ opacity: 1,
+ position: 'front',
+ f: 'image'
+ },
+
+ onAdd: function (map) {
+ this._map = map;
+
+ this._update = L.Util.limitExecByInterval(this._update, this.options.updateInterval, this);
+
+ if (map.options.crs && map.options.crs.code) {
+ var sr = map.options.crs.code.split(':')[1];
+ this.options.bboxSR = sr;
+ this.options.imageSR = sr;
+ }
+
+ map.on('moveend', this._update, this);
+
+ // if we had an image loaded and it matches the
+ // current bounds show the image otherwise remove it
+ if(this._currentImage && this._currentImage._bounds.equals(this._map.getBounds())){
+ map.addLayer(this._currentImage);
+ } else if(this._currentImage) {
+ this._map.removeLayer(this._currentImage);
+ this._currentImage = null;
+ }
+
+ this._update();
+
+ if(this._popup){
+ this._map.on('click', this._getPopupData, this);
+ this._map.on('dblclick', this._resetPopupState, this);
+ }
+ },
+
+ bindPopup: function(fn, popupOptions){
+ this._shouldRenderPopup = false;
+ this._lastClick = false;
+ this._popup = L.popup(popupOptions);
+ this._popupFunction = fn;
+ if(this._map){
+ this._map.on('click', this._getPopupData, this);
+ this._map.on('dblclick', this._resetPopupState, this);
+ }
+ return this;
+ },
+
+ unbindPopup: function(){
+ if(this._map){
+ this._map.closePopup(this._popup);
+ this._map.off('click', this._getPopupData, this);
+ this._map.off('dblclick', this._resetPopupState, this);
+ }
+ this._popup = false;
+ return this;
+ },
+
+ onRemove: function (map) {
+ if (this._currentImage) {
+ this._map.removeLayer(this._currentImage);
+ }
+
+ if(this._popup){
+ this._map.off('click', this._getPopupData, this);
+ this._map.off('dblclick', this._resetPopupState, this);
+ }
+
+ this._map.off('moveend', this._update, this);
+ this._map = null;
+ },
+
+ addTo: function(map){
+ map.addLayer(this);
+ return this;
+ },
+
+ removeFrom: function(map){
+ map.removeLayer(this);
+ return this;
+ },
+
+ bringToFront: function(){
+ this.options.position = 'front';
+ if(this._currentImage){
+ this._currentImage.bringToFront();
+ }
+ return this;
+ },
+
+ bringToBack: function(){
+ this.options.position = 'back';
+ if(this._currentImage){
+ this._currentImage.bringToBack();
+ }
+ return this;
+ },
+
+ getAttribution: function () {
+ return this.options.attribution;
+ },
+
+ getOpacity: function(){
+ return this.options.opacity;
+ },
+
+ setOpacity: function(opacity){
+ this.options.opacity = opacity;
+ this._currentImage.setOpacity(opacity);
+ return this;
+ },
+
+ getTimeRange: function(){
+ return [this.options.from, this.options.to];
+ },
+
+ setTimeRange: function(from, to){
+ this.options.from = from;
+ this.options.to = to;
+ this._update();
+ return this;
+ },
+
+ metadata: function(callback, context){
+ this._service.metadata(callback, context);
+ return this;
+ },
+
+ authenticate: function(token){
+ this._service.authenticate(token);
+ return this;
+ },
+
+ _renderImage: function(url, bounds){
+ if(this._map){
+ // create a new image overlay and add it to the map
+ // to start loading the image
+ // opacity is 0 while the image is loading
+ var image = new L.ImageOverlay(url, bounds, {
+ opacity: 0
+ }).addTo(this._map);
+
+ // once the image loads
+ image.once('load', function(e){
+ var newImage = e.target;
+ var oldImage = this._currentImage;
+
+ // if the bounds of this image matches the bounds that
+ // _renderImage was called with and we have a map
+ // hide the old image if there is one and set the opacity
+ // of the new image otherwise remove the new image
+ if(newImage._bounds.equals(bounds)){
+ this._currentImage = newImage;
+
+ if(this.options.position === 'front'){
+ this.bringToFront();
+ } else {
+ this.bringToBack();
+ }
+
+ if(this._map && this._currentImage._map){
+ this._currentImage.setOpacity(this.options.opacity);
+ } else {
+ this._currentImage._map.removeLayer(this._currentImage);
+ }
+
+ if(oldImage && this._map) {
+ this._map.removeLayer(oldImage);
+ }
+
+ if(oldImage && oldImage._map){
+ oldImage._map.removeLayer(oldImage);
+ }
+ } else {
+ this._map.removeLayer(newImage);
+ }
+
+ this.fire('load', {
+ bounds: bounds
+ });
+
+ }, this);
+
+ this.fire('loading', {
+ bounds: bounds
+ });
+ }
+ },
+
+ _update: function () {
+ if(!this._map){
+ return;
+ }
+
+ var zoom = this._map.getZoom();
+ var bounds = this._map.getBounds();
+
+ if(this._animatingZoom){
+ return;
+ }
+
+ if (this._map._panTransition && this._map._panTransition._inProgress) {
+ return;
+ }
+
+ if (zoom > this.options.maxZoom || zoom < this.options.minZoom) {
+ return;
+ }
+ var params = this._buildExportParams();
+
+ this._requestExport(params, bounds);
+ },
+
+ // TODO: refactor these into raster layer
+ _renderPopup: function(latlng, error, results, response){
+ latlng = L.latLng(latlng);
+ if(this._shouldRenderPopup && this._lastClick.equals(latlng)){
+ //add the popup to the map where the mouse was clicked at
+ var content = this._popupFunction(error, results, response);
+ if (content) {
+ this._popup.setLatLng(latlng).setContent(content).openOn(this._map);
+ }
+ }
+ },
+
+ _resetPopupState: function(e){
+ this._shouldRenderPopup = false;
+ this._lastClick = e.latlng;
+ },
+
+ // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js
+ // @TODO remove at Leaflet 0.8
+ _propagateEvent: function (e) {
+ e = L.extend({
+ layer: e.target,
+ target: this
+ }, e);
+ this.fire(e.type, e);
+ }
+});
+
+EsriLeaflet.Layers.DynamicMapLayer = EsriLeaflet.Layers.RasterLayer.extend({
+
+ options: {
+ updateInterval: 150,
+ layers: false,
+ layerDefs: false,
+ timeOptions: false,
+ format: 'png24',
+ transparent: true
+ },
+
+ initialize: function (url, options) {
+ options = options || {};
+ options.url = EsriLeaflet.Util.cleanUrl(url);
+ this._service = new EsriLeaflet.Services.MapService(options);
+ this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);
+ if (options.proxy){
+ options.f = 'json';
+ }
+ L.Util.setOptions(this, options);
+ },
+
+ getLayers: function(){
+ return this.options.layers;
+ },
+
+ setLayers: function(layers){
+ this.options.layers = layers;
+ this._update();
+ return this;
+ },
+
+ getLayerDefs: function(){
+ return this.options.layerDefs;
+ },
+
+ setLayerDefs: function(layerDefs){
+ this.options.layerDefs = layerDefs;
+ this._update();
+ return this;
+ },
+
+ getTimeOptions: function(){
+ return this.options.timeOptions;
+ },
+
+ setTimeOptions: function(timeOptions){
+ this.options.timeOptions = timeOptions;
+ this._update();
+ return this;
+ },
+
+ query: function(){
+ return this._service.query();
+ },
+
+ identify: function(){
+ return this._service.identify();
+ },
+
+ find: function(){
+ return this._service.find();
+ },
+
+ _getPopupData: function(e){
+ var callback = L.Util.bind(function(error, featureCollection, response) {
+ setTimeout(L.Util.bind(function(){
+ this._renderPopup(e.latlng, error, featureCollection, response);
+ }, this), 300);
+ }, this);
+
+ var identifyRequest = this.identify().on(this._map).at(e.latlng);
+
+ if(this.options.layers){
+ identifyRequest.layers('visible:' + this.options.layers.join(','));
+ } else {
+ identifyRequest.layers('visible');
+ }
+
+ identifyRequest.run(callback);
+
+ // set the flags to show the popup
+ this._shouldRenderPopup = true;
+ this._lastClick = e.latlng;
+ },
+
+ _buildExportParams: function () {
+ var bounds = this._map.getBounds();
+ var size = this._map.getSize();
+ var ne = this._map.options.crs.project(bounds._northEast);
+ var sw = this._map.options.crs.project(bounds._southWest);
+
+ var params = {
+ bbox: [sw.x, sw.y, ne.x, ne.y].join(','),
+ size: size.x + ',' + size.y,
+ dpi: 96,
+ format: this.options.format,
+ transparent: this.options.transparent,
+ bboxSR: this.options.bboxSR,
+ imageSR: this.options.imageSR
+ };
+
+ if(this.options.layers){
+ params.layers = 'show:' + this.options.layers.join(',');
+ }
+
+ if(this.options.layerDefs){
+ params.layerDefs = JSON.stringify(this.options.layerDefs);
+ }
+
+ if(this.options.timeOptions){
+ params.timeOptions = JSON.stringify(this.options.timeOptions);
+ }
+
+ if(this.options.from && this.options.to){
+ params.time = this.options.from.valueOf() + ',' + this.options.to.valueOf();
+ }
+
+ if(this._service.options.token) {
+ params.token = this._service.options.token;
+ }
+
+ return params;
+ },
+
+ _requestExport: function (params, bounds) {
+ if(this.options.f === 'json'){
+ this._service.get('export', params, function(error, response){
+ this._renderImage(response.href, bounds);
+ }, this);
+ } else {
+ params.f = 'image';
+ this._renderImage(this.options.url + 'export' + L.Util.getParamString(params), bounds);
+ }
+ }
+});
+
+EsriLeaflet.DynamicMapLayer = EsriLeaflet.Layers.DynamicMapLayer;
+
+EsriLeaflet.Layers.dynamicMapLayer = function(url, options){
+ return new EsriLeaflet.Layers.DynamicMapLayer(url, options);
+};
+
+EsriLeaflet.dynamicMapLayer = function(url, options){
+ return new EsriLeaflet.Layers.DynamicMapLayer(url, options);
+};
+
+EsriLeaflet.Layers.ImageMapLayer = EsriLeaflet.Layers.RasterLayer.extend({
+
+ options: {
+ updateInterval: 150,
+ format: 'jpgpng'
+ },
+
+ query: function(){
+ return this._service.query();
+ },
+
+ identify: function(){
+ return this._service.identify();
+ },
+
+ initialize: function (url, options) {
+ options = options || {};
+ options.url = EsriLeaflet.Util.cleanUrl(url);
+ this._service = new EsriLeaflet.Services.ImageService(options);
+ this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);
+ L.Util.setOptions(this, options);
+ },
+
+ setPixelType: function (pixelType) {
+ this.options.pixelType = pixelType;
+ this._update();
+ return this;
+ },
+
+ getPixelType: function () {
+ return this.options.pixelType;
+ },
+
+ setBandIds: function (bandIds) {
+ if (L.Util.isArray(bandIds)) {
+ this.options.bandIds = bandIds.join(',');
+ } else {
+ this.options.bandIds = bandIds.toString();
+ }
+ this._update();
+ return this;
+ },
+
+ getBandIds: function () {
+ return this.options.bandIds;
+ },
+
+ setNoData: function (noData, noDataInterpretation) {
+ if (L.Util.isArray(noData)) {
+ this.options.noData = noData.join(',');
+ } else {
+ this.options.noData = noData.toString();
+ }
+ if (noDataInterpretation) {
+ this.options.noDataInterpretation = noDataInterpretation;
+ }
+ this._update();
+ return this;
+ },
+
+ getNoData: function () {
+ return this.options.noData;
+ },
+
+ getNoDataInterpretation: function () {
+ return this.options.noDataInterpretation;
+ },
+
+ setRenderingRule: function(renderingRule) {
+ this.options.renderingRule = renderingRule;
+ this._update();
+ },
+
+ getRenderingRule: function() {
+ return this.options.renderingRule;
+ },
+
+ setMosaicRule: function(mosaicRule) {
+ this.options.mosaicRule = mosaicRule;
+ this._update();
+ },
+
+ getMosaicRule: function() {
+ return this.options.mosaicRule;
+ },
+
+ _getPopupData: function(e){
+ var callback = L.Util.bind(function(error, results, response) {
+ setTimeout(L.Util.bind(function(){
+ this._renderPopup(e.latlng, error, results, response);
+ }, this), 300);
+ }, this);
+
+ var identifyRequest = this.identify().at(e.latlng);
+
+ // set mosaic rule for identify task if it is set for layer
+ if (this.options.mosaicRule) {
+ identifyRequest.setMosaicRule(this.options.mosaicRule);
+ // @TODO: force return catalog items too?
+ }
+
+ // @TODO: set rendering rule? Not sure,
+ // sometimes you want raw pixel values
+ // if (this.options.renderingRule) {
+ // identifyRequest.setRenderingRule(this.options.renderingRule);
+ // }
+
+ identifyRequest.run(callback);
+
+ // set the flags to show the popup
+ this._shouldRenderPopup = true;
+ this._lastClick = e.latlng;
+ },
+
+ _buildExportParams: function () {
+ var bounds = this._map.getBounds();
+ var size = this._map.getSize();
+ var ne = this._map.options.crs.project(bounds._northEast);
+ var sw = this._map.options.crs.project(bounds._southWest);
+
+ var params = {
+ bbox: [sw.x, sw.y, ne.x, ne.y].join(','),
+ size: size.x + ',' + size.y,
+ format: this.options.format,
+ bboxSR: this.options.bboxSR,
+ imageSR: this.options.imageSR
+ };
+
+ if (this.options.from && this.options.to) {
+ params.time = this.options.from.valueOf() + ',' + this.options.to.valueOf();
+ }
+
+ if (this.options.pixelType) {
+ params.pixelType = this.options.pixelType;
+ }
+
+ if (this.options.interpolation) {
+ params.interpolation = this.options.interpolation;
+ }
+
+ if (this.options.compressionQuality) {
+ params.compressionQuality = this.options.compressionQuality;
+ }
+
+ if (this.options.bandIds) {
+ params.bandIds = this.options.bandIds;
+ }
+
+ if (this.options.noData) {
+ params.noData = this.options.noData;
+ }
+
+ if (this.options.noDataInterpretation) {
+ params.noDataInterpretation = this.options.noDataInterpretation;
+ }
+
+ if (this._service.options.token) {
+ params.token = this._service.options.token;
+ }
+
+ if(this.options.renderingRule) {
+ params.renderingRule = JSON.stringify(this.options.renderingRule);
+ }
+
+ if(this.options.mosaicRule) {
+ params.mosaicRule = JSON.stringify(this.options.mosaicRule);
+ }
+
+ return params;
+ },
+
+ _requestExport: function (params, bounds) {
+ if (this.options.f === 'json') {
+ this._service.get('exportImage', params, function(error, response){
+ this._renderImage(response.href, bounds);
+ }, this);
+ } else {
+ params.f = 'image';
+ this._renderImage(this.options.url + 'exportImage' + L.Util.getParamString(params), bounds);
+ }
+ }
+});
+
+EsriLeaflet.ImageMapLayer = EsriLeaflet.Layers.ImageMapLayer;
+
+EsriLeaflet.Layers.imageMapLayer = function (url, options) {
+ return new EsriLeaflet.Layers.ImageMapLayer(url, options);
+};
+
+EsriLeaflet.imageMapLayer = function (url, options) {
+ return new EsriLeaflet.Layers.ImageMapLayer(url, options);
+};
+
+EsriLeaflet.Layers.TiledMapLayer = L.TileLayer.extend({
+ initialize: function(url, options){
+ options = options || {};
+ options.url = EsriLeaflet.Util.cleanUrl(url);
+ options = L.Util.setOptions(this, options);
+
+ // set the urls
+ //this.url = L.esri.Util.cleanUrl(url);
+ this.tileUrl = L.esri.Util.cleanUrl(url) + 'tile/{z}/{y}/{x}';
+ this._service = new L.esri.Services.MapService(options);
+ this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);
+
+ //if this is looking at the AGO tiles subdomain insert the subdomain placeholder
+ if(this.tileUrl.match('://tiles.arcgisonline.com')){
+ this.tileUrl = this.tileUrl.replace('://tiles.arcgisonline.com', '://tiles{s}.arcgisonline.com');
+ options.subdomains = ['1', '2', '3', '4'];
+ }
+
+ if(this.options.token) {
+ this.tileUrl += ('?token=' + this.options.token);
+ }
+
+ // init layer by calling TileLayers initialize method
+ L.TileLayer.prototype.initialize.call(this, this.tileUrl, options);
+ },
+
+ metadata: function(callback, context){
+ this._service.metadata(callback, context);
+ return this;
+ },
+
+ identify: function(){
+ return this._service.identify();
+ },
+
+ authenticate: function(token){
+ var tokenQs = '?token=' + token;
+ this.tileUrl = (this.options.token) ? this.tileUrl.replace(/\?token=(.+)/g, tokenQs) : this.tileUrl + tokenQs;
+ this.options.token = token;
+ this._service.authenticate(token);
+ return this;
+ },
+
+ // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js
+ // @TODO remove at Leaflet 0.8
+ _propagateEvent: function (e) {
+ e = L.extend({
+ layer: e.target,
+ target: this
+ }, e);
+ this.fire(e.type, e);
+ }
+});
+
+L.esri.TiledMapLayer = L.esri.Layers.tiledMapLayer;
+
+L.esri.Layers.tiledMapLayer = function(url, options){
+ return new L.esri.Layers.TiledMapLayer(url, options);
+};
+
+L.esri.tiledMapLayer = function(url, options){
+ return new L.esri.Layers.TiledMapLayer(url, options);
+};
+
+EsriLeaflet.Layers.FeatureGrid = L.Class.extend({
+
+ includes: L.Mixin.Events,
+
+ options: {
+ cellSize: 512,
+ updateInterval: 150
+ },
+
+ initialize: function (options) {
+ options = L.setOptions(this, options);
+ },
+
+ onAdd: function (map) {
+ this._map = map;
+ this._update = L.Util.limitExecByInterval(this._update, this.options.updateInterval, this);
+
+ // @TODO remove for leaflet 0.8
+ this._map.addEventListener(this.getEvents(), this);
+
+ this._reset();
+ this._update();
+ },
+
+ onRemove: function(){
+ this._map.removeEventListener(this.getEvents(), this);
+ this._removeCells();
+ },
+
+ getEvents: function () {
+ var events = {
+ viewreset: this._reset,
+ moveend: this._update,
+ zoomend : this._onZoom
+ };
+
+ return events;
+ },
+
+ addTo: function(map){
+ map.addLayer(this);
+ return this;
+ },
+
+ removeFrom: function(map){
+ map.removeLayer(this);
+ return this;
+ },
+
+ _onZoom : function () {
+ var zoom = this._map.getZoom();
+
+ if (zoom > this.options.maxZoom ||
+ zoom < this.options.minZoom) {
+ this.removeFrom(this._map);
+ this._map.addEventListener('zoomend', this.getEvents().zoomend, this);
+ } else if (!this._map.hasLayer(this)) {
+ this._map.removeEventListener('zoomend', this.getEvents().zoomend, this);
+ this.addTo(this._map);
+ }
+
+ },
+
+ _reset: function () {
+ this._removeCells();
+
+ this._cells = {};
+ this._activeCells = {};
+ this._cellsToLoad = 0;
+ this._cellsTotal = 0;
+
+ // @TODO enable at Leaflet 0.8
+ // this._cellNumBounds = this._getCellNumBounds();
+
+ this._resetWrap();
+ },
+
+ _resetWrap: function () {
+ var map = this._map,
+ crs = map.options.crs;
+
+ if (crs.infinite) { return; }
+
+ var cellSize = this._getCellSize();
+
+ if (crs.wrapLng) {
+ this._wrapLng = [
+ Math.floor(map.project([0, crs.wrapLng[0]]).x / cellSize),
+ Math.ceil(map.project([0, crs.wrapLng[1]]).x / cellSize)
+ ];
+ }
+
+ if (crs.wrapLat) {
+ this._wrapLat = [
+ Math.floor(map.project([crs.wrapLat[0], 0]).y / cellSize),
+ Math.ceil(map.project([crs.wrapLat[1], 0]).y / cellSize)
+ ];
+ }
+ },
+
+ _getCellSize: function () {
+ return this.options.cellSize;
+ },
+
+ _update: function () {
+ if (!this._map) { return; }
+
+ var bounds = this._map.getPixelBounds(),
+ zoom = this._map.getZoom(),
+ cellSize = this._getCellSize(),
+ cellPadding = [cellSize/2,cellSize/2];
+ // cellPadding = [0,0]
+
+ if (zoom > this.options.maxZoom ||
+ zoom < this.options.minZoom) { return; }
+
+ // cell coordinates range for the current view
+ var topLeft = bounds.min.subtract(cellPadding).divideBy(cellSize).floor();
+ topLeft.x = Math.max(topLeft.x, 0);
+ topLeft.y = Math.max(topLeft.y, 0);
+
+ var cellBounds = L.bounds(topLeft, bounds.max.add(cellPadding).divideBy(cellSize).floor());
+
+ // remove any present cells that are off the specified bounds
+ this._removeOtherCells(cellBounds);
+ this._addCells(cellBounds);
+ },
+
+ _addCells: function (bounds) {
+ var queue = [],
+ center = bounds.getCenter(),
+ zoom = this._map.getZoom();
+
+ var j, i, coords;
+ // create a queue of coordinates to load cells from
+ for (j = bounds.min.y; j <= bounds.max.y; j++) {
+ for (i = bounds.min.x; i <= bounds.max.x; i++) {
+ coords = new L.Point(i, j);
+ coords.z = zoom;
+
+ // @TODO enable at Leaflet 0.8
+ // if (this._isValidCell(coords)) {
+ // queue.push(coords);
+ // }
+
+ queue.push(coords);
+ }
+ }
+ var cellsToLoad = queue.length;
+
+ if (cellsToLoad === 0) { return; }
+
+ this._cellsToLoad += cellsToLoad;
+ this._cellsTotal += cellsToLoad;
+
+ // sort cell queue to load cells in order of their distance to center
+ queue.sort(function (a, b) {
+ return a.distanceTo(center) - b.distanceTo(center);
+ });
+
+ for (i = 0; i < cellsToLoad; i++) {
+ this._addCell(queue[i]);
+ }
+ },
+
+ // @TODO enable at Leaflet 0.8
+ // _isValidCell: function (coords) {
+ // var crs = this._map.options.crs;
+
+ // if (!crs.infinite) {
+ // // don't load cell if it's out of bounds and not wrapped
+ // var bounds = this._cellNumBounds;
+ // if (
+ // (!crs.wrapLng && (coords.x < bounds.min.x || coords.x > bounds.max.x)) ||
+ // (!crs.wrapLat && (coords.y < bounds.min.y || coords.y > bounds.max.y))
+ // ) {
+ // return false;
+ // }
+ // }
+
+ // if (!this.options.bounds) {
+ // return true;
+ // }
+
+ // // don't load cell if it doesn't intersect the bounds in options
+ // var cellBounds = this._cellCoordsToBounds(coords);
+ // return L.latLngBounds(this.options.bounds).intersects(cellBounds);
+ // },
+
+ // converts cell coordinates to its geographical bounds
+ _cellCoordsToBounds: function (coords) {
+ var map = this._map,
+ cellSize = this.options.cellSize,
+
+ nwPoint = coords.multiplyBy(cellSize),
+ sePoint = nwPoint.add([cellSize, cellSize]),
+
+ // @TODO for Leaflet 0.8
+ // nw = map.wrapLatLng(map.unproject(nwPoint, coords.z)),
+ // se = map.wrapLatLng(map.unproject(sePoint, coords.z));
+
+ nw = map.unproject(nwPoint, coords.z).wrap(),
+ se = map.unproject(sePoint, coords.z).wrap();
+
+ return new L.LatLngBounds(nw, se);
+ },
+
+ // converts cell coordinates to key for the cell cache
+ _cellCoordsToKey: function (coords) {
+ return coords.x + ':' + coords.y;
+ },
+
+ // converts cell cache key to coordiantes
+ _keyToCellCoords: function (key) {
+ var kArr = key.split(':'),
+ x = parseInt(kArr[0], 10),
+ y = parseInt(kArr[1], 10);
+
+ return new L.Point(x, y);
+ },
+
+ // remove any present cells that are off the specified bounds
+ _removeOtherCells: function (bounds) {
+ for (var key in this._cells) {
+ if (!bounds.contains(this._keyToCellCoords(key))) {
+ this._removeCell(key);
+ }
+ }
+ },
+
+ _removeCell: function (key) {
+ var cell = this._activeCells[key];
+ if(cell){
+ delete this._activeCells[key];
+
+ if (this.cellLeave) {
+ this.cellLeave(cell.bounds, cell.coords);
+ }
+
+ this.fire('cellleave', {
+ bounds: cell.bounds,
+ coords: cell.coords
+ });
+ }
+ },
+
+ _removeCells: function(){
+ for (var key in this._cells) {
+ var bounds = this._cells[key].bounds;
+ var coords = this._cells[key].coords;
+
+ if (this.cellLeave) {
+ this.cellLeave(bounds, coords);
+ }
+
+ this.fire('cellleave', {
+ bounds: bounds,
+ coords: coords
+ });
+ }
+ },
+
+ _addCell: function (coords) {
+
+ // wrap cell coords if necessary (depending on CRS)
+ this._wrapCoords(coords);
+
+ // generate the cell key
+ var key = this._cellCoordsToKey(coords);
+
+ // get the cell from the cache
+ var cell = this._cells[key];
+ // if this cell should be shown as isnt active yet (enter)
+
+ if (cell && !this._activeCells[key]) {
+ if (this.cellEnter) {
+ this.cellEnter(cell.bounds, coords);
+ }
+
+ this.fire('cellenter', {
+ bounds: cell.bounds,
+ coords: coords
+ });
+
+ this._activeCells[key] = cell;
+ }
+
+ // if we dont have this cell in the cache yet (create)
+ if (!cell) {
+ cell = {
+ coords: coords,
+ bounds: this._cellCoordsToBounds(coords)
+ };
+
+ this._cells[key] = cell;
+ this._activeCells[key] = cell;
+
+ if(this.createCell){
+ this.createCell(cell.bounds, coords);
+ }
+
+ this.fire('cellcreate', {
+ bounds: cell.bounds,
+ coords: coords
+ });
+ }
+ },
+
+ _wrapCoords: function (coords) {
+ coords.x = this._wrapLng ? L.Util.wrapNum(coords.x, this._wrapLng) : coords.x;
+ coords.y = this._wrapLat ? L.Util.wrapNum(coords.y, this._wrapLat) : coords.y;
+ }
+
+ // get the global cell coordinates range for the current zoom
+ // @TODO enable at Leaflet 0.8
+ // _getCellNumBounds: function () {
+ // // @TODO for Leaflet 0.8
+ // // var bounds = this._map.getPixelWorldBounds(),
+ // // size = this._getCellSize();
+ // //
+ // // return bounds ? L.bounds(
+ // // bounds.min.divideBy(size).floor(),
+ // // bounds.max.divideBy(size).ceil().subtract([1, 1])) : null;
+ // }
+
+});
+
+(function(EsriLeaflet){
+
+ EsriLeaflet.Layers.FeatureManager = EsriLeaflet.Layers.FeatureGrid.extend({
+
+ /**
+ * Options
+ */
+
+ options: {
+ where: '1=1',
+ fields: ['*'],
+ from: false,
+ to: false,
+ timeField: false,
+ timeFilterMode: 'server',
+ simplifyFactor: 0,
+ precision: 6
+ },
+
+ /**
+ * Constructor
+ */
+
+ initialize: function (url, options) {
+ EsriLeaflet.Layers.FeatureGrid.prototype.initialize.call(this, options);
+
+ options = options || {};
+ options.url = EsriLeaflet.Util.cleanUrl(url);
+ options = L.setOptions(this, options);
+
+ this._service = new EsriLeaflet.Services.FeatureLayer(options);
+
+ //use case insensitive regex to look for common fieldnames used for indexing
+ /*global console */
+ if (this.options.fields[0] !== '*'){
+ var oidCheck = false;
+ for (var i = 0; i < this.options.fields.length; i++){
+ if (this.options.fields[i].match(/^(OBJECTID|FID|OID|ID)$/i)){
+ oidCheck = true;
+ }
+ }
+ if (oidCheck === false && console && console.warn){
+ console.warn('no known esriFieldTypeOID field detected in fields Array. Please add an attribute field containing unique IDs to ensure the layer can be drawn correctly.');
+ }
+ }
+
+ // Leaflet 0.8 change to new propagation
+ this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', function (e) {
+ e = L.extend({
+ target: this
+ }, e);
+ this.fire(e.type, e);
+ }, this);
+
+ if(this.options.timeField.start && this.options.timeField.end){
+ this._startTimeIndex = new BinarySearchIndex();
+ this._endTimeIndex = new BinarySearchIndex();
+ } else if(this.options.timeField){
+ this._timeIndex = new BinarySearchIndex();
+ }
+
+ this._cache = {};
+ this._currentSnapshot = []; // cache of what layers should be active
+ this._activeRequests = 0;
+ this._pendingRequests = [];
+ },
+
+ /**
+ * Layer Interface
+ */
+
+ onAdd: function(map){
+ return EsriLeaflet.Layers.FeatureGrid.prototype.onAdd.call(this, map);
+ },
+
+ onRemove: function(map){
+ return EsriLeaflet.Layers.FeatureGrid.prototype.onRemove.call(this, map);
+ },
+
+ getAttribution: function () {
+ return this.options.attribution;
+ },
+
+ /**
+ * Feature Managment
+ */
+
+ createCell: function(bounds, coords){
+ this._requestFeatures(bounds, coords);
+ },
+
+ _requestFeatures: function(bounds, coords, callback){
+ this._activeRequests++;
+
+ // our first active request fires loading
+ if(this._activeRequests === 1){
+ this.fire('loading', {
+ bounds: bounds
+ });
+ }
+
+ return this._buildQuery(bounds).run(function(error, featureCollection, response){
+ if(response && response.exceededTransferLimit){
+ this.fire('drawlimitexceeded');
+ }
+
+ //deincriment the request counter
+ this._activeRequests--;
+
+ if(!error && featureCollection.features.length){
+ // schedule adding features until the next animation frame
+ EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){
+ this._addFeatures(featureCollection.features, coords);
+ }, this));
+ }
+
+ if(callback){
+ callback.call(this, error, featureCollection);
+ }
+
+ // if there are no more active requests fire a load event for this view
+ if(this._activeRequests <= 0){
+ this.fire('load', {
+ bounds: bounds
+ });
+ }
+ }, this);
+ },
+
+ _cacheKey: function (coords){
+ return coords.z + ':' + coords.x + ':' +coords.y;
+ },
+
+ _addFeatures: function(features, coords){
+ var key = this._cacheKey(coords);
+ this._cache[key] = this._cache[key] || [];
+
+ for (var i = features.length - 1; i >= 0; i--) {
+ var id = features[i].id;
+ this._currentSnapshot.push(id);
+ this._cache[key].push(id);
+ }
+
+ if(this.options.timeField){
+ this._buildTimeIndexes(features);
+ }
+
+ var zoom = this._map.getZoom();
+
+ if (zoom > this.options.maxZoom ||
+ zoom < this.options.minZoom) { return; }
+
+ this.createLayers(features);
+ },
+
+ _buildQuery: function(bounds){
+ var query = this._service.query().intersects(bounds).where(this.options.where).fields(this.options.fields).precision(this.options.precision);
+
+ if(this.options.simplifyFactor){
+ query.simplify(this._map, this.options.simplifyFactor);
+ }
+
+ if(this.options.timeFilterMode === 'server' && this.options.from && this.options.to){
+ query.between(this.options.from, this.options.to);
+ }
+
+ return query;
+ },
+
+ /**
+ * Where Methods
+ */
+
+ setWhere: function(where, callback, context){
+
+ this.options.where = (where && where.length) ? where : '1=1';
+
+ var oldSnapshot = [];
+ var newShapshot = [];
+ var pendingRequests = 0;
+ var requestError = null;
+ var requestCallback = L.Util.bind(function(error, featureCollection){
+ if(error){
+ requestError = error;
+ }
+
+ if(featureCollection){
+ for (var i = featureCollection.features.length - 1; i >= 0; i--) {
+ newShapshot.push(featureCollection.features[i].id);
+ }
+ }
+
+ pendingRequests--;
+
+ if(pendingRequests <= 0){
+ this._currentSnapshot = newShapshot;
+ // schedule adding features until the next animation frame
+ EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){
+ this.removeLayers(oldSnapshot);
+ this.addLayers(newShapshot);
+ if(callback) {
+ callback.call(context, requestError);
+ }
+ }, this));
+
+ }
+ }, this);
+
+ for (var i = this._currentSnapshot.length - 1; i >= 0; i--) {
+ oldSnapshot.push(this._currentSnapshot[i]);
+ }
+
+ for(var key in this._activeCells){
+ pendingRequests++;
+ var coords = this._keyToCellCoords(key);
+ var bounds = this._cellCoordsToBounds(coords);
+ this._requestFeatures(bounds, key, requestCallback);
+ }
+
+ return this;
+ },
+
+ getWhere: function(){
+ return this.options.where;
+ },
+
+ /**
+ * Time Range Methods
+ */
+
+ getTimeRange: function(){
+ return [this.options.from, this.options.to];
+ },
+
+ setTimeRange: function(from, to, callback, context){
+ var oldFrom = this.options.from;
+ var oldTo = this.options.to;
+ var pendingRequests = 0;
+ var requestError = null;
+ var requestCallback = L.Util.bind(function(error){
+ if(error){
+ requestError = error;
+ }
+ this._filterExistingFeatures(oldFrom, oldTo, from, to);
+
+ pendingRequests--;
+
+ if(callback && pendingRequests <= 0){
+ callback.call(context, requestError);
+ }
+ }, this);
+
+ this.options.from = from;
+ this.options.to = to;
+
+ this._filterExistingFeatures(oldFrom, oldTo, from, to);
+
+ if(this.options.timeFilterMode === 'server') {
+ for(var key in this._activeCells){
+ pendingRequests++;
+ var coords = this._keyToCellCoords(key);
+ var bounds = this._cellCoordsToBounds(coords);
+ this._requestFeatures(bounds, key, requestCallback);
+ }
+ }
+ },
+
+ refresh: function(){
+ for(var key in this._activeCells){
+ var coords = this._keyToCellCoords(key);
+ var bounds = this._cellCoordsToBounds(coords);
+ this._requestFeatures(bounds, key);
+ }
+ },
+
+ _filterExistingFeatures: function (oldFrom, oldTo, newFrom, newTo) {
+ var layersToRemove = (oldFrom && oldTo) ? this._getFeaturesInTimeRange(oldFrom, oldTo) : this._currentSnapshot;
+ var layersToAdd = this._getFeaturesInTimeRange(newFrom, newTo);
+
+ if(layersToAdd.indexOf){
+ for (var i = 0; i < layersToAdd.length; i++) {
+ var shouldRemoveLayer = layersToRemove.indexOf(layersToAdd[i]);
+ if(shouldRemoveLayer >= 0){
+ layersToRemove.splice(shouldRemoveLayer, 1);
+ }
+ }
+ }
+
+ // schedule adding features until the next animation frame
+ EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){
+ this.removeLayers(layersToRemove);
+ this.addLayers(layersToAdd);
+ }, this));
+ },
+
+ _getFeaturesInTimeRange: function(start, end){
+ var ids = [];
+ var search;
+
+ if(this.options.timeField.start && this.options.timeField.end){
+ var startTimes = this._startTimeIndex.between(start, end);
+ var endTimes = this._endTimeIndex.between(start, end);
+ search = startTimes.concat(endTimes);
+ } else {
+ search = this._timeIndex.between(start, end);
+ }
+
+ for (var i = search.length - 1; i >= 0; i--) {
+ ids.push(search[i].id);
+ }
+
+ return ids;
+ },
+
+ _buildTimeIndexes: function(geojson){
+ var i;
+ var feature;
+ if(this.options.timeField.start && this.options.timeField.end){
+ var startTimeEntries = [];
+ var endTimeEntries = [];
+ for (i = geojson.length - 1; i >= 0; i--) {
+ feature = geojson[i];
+ startTimeEntries.push( {
+ id: feature.id,
+ value: new Date(feature.properties[this.options.timeField.start])
+ });
+ endTimeEntries.push( {
+ id: feature.id,
+ value: new Date(feature.properties[this.options.timeField.end])
+ });
+ }
+ this._startTimeIndex.bulkAdd(startTimeEntries);
+ this._endTimeIndex.bulkAdd(endTimeEntries);
+ } else {
+ var timeEntries = [];
+ for (i = geojson.length - 1; i >= 0; i--) {
+ feature = geojson[i];
+ timeEntries.push( {
+ id: feature.id,
+ value: new Date(feature.properties[this.options.timeField])
+ });
+ }
+
+ this._timeIndex.bulkAdd(timeEntries);
+ }
+ },
+
+ _featureWithinTimeRange: function(feature){
+ if(!this.options.from || !this.options.to){
+ return true;
+ }
+
+ var from = +this.options.from.valueOf();
+ var to = +this.options.to.valueOf();
+
+ if(typeof this.options.timeField === 'string'){
+ var date = +feature.properties[this.options.timeField];
+ return (date >= from) && (date <= to);
+ }
+
+ if(this.options.timeField.start && this.options.timeField.end){
+ var startDate = +feature.properties[this.options.timeField.start];
+ var endDate = +feature.properties[this.options.timeField.end];
+ return ((startDate >= from) && (startDate <= to)) || ((endDate >= from) && (endDate <= to));
+ }
+ },
+
+ /**
+ * Service Methods
+ */
+
+ authenticate: function(token){
+ this._service.authenticate(token);
+ return this;
+ },
+
+ metadata: function(callback, context){
+ this._service.metadata(callback, context);
+ return this;
+ },
+
+ query: function(){
+ return this._service.query();
+ },
+
+ addFeature: function(feature, callback, context){
+ this._service.addFeature(feature, function(error, response){
+ if(!error){
+ this.refresh();
+ }
+ if(callback){
+ callback.call(context, error, response);
+ }
+ }, this);
+ return this;
+ },
+
+ updateFeature: function(feature, callback, context){
+ return this._service.updateFeature(feature, function(error, response){
+ if(!error){
+ this.refresh();
+ }
+ if(callback){
+ callback.call(context, error, response);
+ }
+ }, this);
+ },
+
+ deleteFeature: function(id, callback, context){
+ return this._service.deleteFeature(id, function(error, response){
+ if(!error && response.objectId){
+ this.removeLayers([response.objectId], true);
+ }
+ if(callback){
+ callback.call(context, error, response);
+ }
+ }, this);
+ }
+ });
+
+ /**
+ * Temporal Binary Search Index
+ */
+
+ function BinarySearchIndex(values) {
+ this.values = values || [];
+ }
+
+ BinarySearchIndex.prototype._query = function(query){
+ var minIndex = 0;
+ var maxIndex = this.values.length - 1;
+ var currentIndex;
+ var currentElement;
+ var resultIndex;
+
+ while (minIndex <= maxIndex) {
+ resultIndex = currentIndex = (minIndex + maxIndex) / 2 | 0;
+ currentElement = this.values[Math.round(currentIndex)];
+ if (+currentElement.value < +query) {
+ minIndex = currentIndex + 1;
+ } else if (+currentElement.value > +query) {
+ maxIndex = currentIndex - 1;
+ } else {
+ return currentIndex;
+ }
+ }
+
+ return ~maxIndex;
+ };
+
+ BinarySearchIndex.prototype.sort = function(){
+ this.values.sort(function(a, b) {
+ return +b.value - +a.value;
+ }).reverse();
+ this.dirty = false;
+ };
+
+ BinarySearchIndex.prototype.between = function(start, end){
+ if(this.dirty){
+ this.sort();
+ }
+
+ var startIndex = this._query(start);
+ var endIndex = this._query(end);
+
+ if(startIndex === 0 && endIndex === 0){
+ return [];
+ }
+
+ startIndex = Math.abs(startIndex);
+ endIndex = (endIndex < 0) ? Math.abs(endIndex): endIndex + 1;
+
+ return this.values.slice(startIndex, endIndex);
+ };
+
+ BinarySearchIndex.prototype.bulkAdd = function(items){
+ this.dirty = true;
+ this.values = this.values.concat(items);
+ };
+
+})(EsriLeaflet);
+
+EsriLeaflet.Layers.FeatureLayer = EsriLeaflet.Layers.FeatureManager.extend({
+
+ statics: {
+ EVENTS: 'click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose'
+ },
+
+ options: {
+ cacheLayers: true
+ },
+
+ /**
+ * Constructor
+ */
+
+ initialize: function (url, options) {
+ EsriLeaflet.Layers.FeatureManager.prototype.initialize.call(this, url, options);
+
+ options = L.setOptions(this, options);
+
+ this._layers = {};
+ this._leafletIds = {};
+ this._key = 'c'+(Math.random() * 1e9).toString(36).replace('.', '_');
+ },
+
+ /**
+ * Layer Interface
+ */
+
+ onAdd: function(map){
+ map.on('zoomstart zoomend', function(e){
+ this._zooming = (e.type === 'zoomstart');
+ }, this);
+ return EsriLeaflet.Layers.FeatureManager.prototype.onAdd.call(this, map);
+ },
+
+ onRemove: function(map){
+ for (var i in this._layers) {
+ map.removeLayer(this._layers[i]);
+ }
+
+ return EsriLeaflet.Layers.FeatureManager.prototype.onRemove.call(this, map);
+ },
+
+ createNewLayer: function(geojson){
+ // @TODO Leaflet 0.8
+ //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);
+ return L.GeoJSON.geometryToLayer(geojson, this.options.pointToLayer, L.GeoJSON.coordsToLatLng, this.options);
+ },
+
+ /**
+ * Feature Managment Methods
+ */
+
+ createLayers: function(features){
+ for (var i = features.length - 1; i >= 0; i--) {
+
+ var geojson = features[i];
+
+ var layer = this._layers[geojson.id];
+ var newLayer;
+
+ if(layer && !this._map.hasLayer(layer)){
+ this._map.addLayer(layer);
+ }
+
+ if (layer && layer.setLatLngs) {
+ // @TODO Leaflet 0.8
+ //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);
+
+ var updateGeo = this.createNewLayer(geojson);
+ layer.setLatLngs(updateGeo.getLatLngs());
+ }
+
+ if(!layer){
+ // @TODO Leaflet 0.8
+ //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);
+
+ newLayer = this.createNewLayer(geojson);
+ newLayer.feature = geojson;
+ newLayer.defaultOptions = newLayer.options;
+ newLayer._leaflet_id = this._key + '_' + geojson.id;
+
+ this._leafletIds[newLayer._leaflet_id] = geojson.id;
+
+ // bubble events from layers to this
+ // @TODO Leaflet 0.8
+ // newLayer.addEventParent(this);
+
+ newLayer.on(EsriLeaflet.Layers.FeatureLayer.EVENTS, this._propagateEvent, this);
+
+ // bind a popup if we have one
+ if(this._popup && newLayer.bindPopup){
+ newLayer.bindPopup(this._popup(newLayer.feature, newLayer), this._popupOptions);
+ }
+
+ if(this.options.onEachFeature){
+ this.options.onEachFeature(newLayer.feature, newLayer);
+ }
+
+ // cache the layer
+ this._layers[newLayer.feature.id] = newLayer;
+
+ // style the layer
+ this.resetStyle(newLayer.feature.id);
+
+ this.fire('createfeature', {
+ feature: newLayer.feature
+ });
+
+ // add the layer if it is within the time bounds or our layer is not time enabled
+ if(!this.options.timeField || (this.options.timeField && this._featureWithinTimeRange(geojson)) ){
+ this._map.addLayer(newLayer);
+ }
+ }
+ }
+ },
+
+ addLayers: function(ids){
+ for (var i = ids.length - 1; i >= 0; i--) {
+ var layer = this._layers[ids[i]];
+ if(layer){
+ this.fire('addfeature', {
+ feature: layer.feature
+ });
+ this._map.addLayer(layer);
+ }
+ }
+ },
+
+ removeLayers: function(ids, permanent){
+ for (var i = ids.length - 1; i >= 0; i--) {
+ var id = ids[i];
+ var layer = this._layers[id];
+ if(layer){
+ this.fire('removefeature', {
+ feature: layer.feature,
+ permanent: permanent
+ });
+ this._map.removeLayer(layer);
+ }
+ if(layer && permanent){
+ delete this._layers[id];
+ }
+ }
+ },
+
+ cellEnter: function(bounds, coords){
+ if(!this._zooming){
+ EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){
+ var cacheKey = this._cacheKey(coords);
+ var cellKey = this._cellCoordsToKey(coords);
+ var layers = this._cache[cacheKey];
+ if(this._activeCells[cellKey] && layers){
+ this.addLayers(layers);
+ }
+ }, this));
+ }
+ },
+
+ cellLeave: function(bounds, coords){
+ if(!this._zooming){
+ EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){
+ var cacheKey = this._cacheKey(coords);
+ var cellKey = this._cellCoordsToKey(coords);
+ var layers = this._cache[cacheKey];
+ var mapBounds = this._map.getBounds();
+ if(!this._activeCells[cellKey] && layers){
+ var removable = true;
+
+ for (var i = 0; i < layers.length; i++) {
+ var layer = this._layers[layers[i]];
+ if(layer && layer.getBounds && mapBounds.intersects(layer.getBounds())){
+ removable = false;
+ }
+ }
+
+ if(removable){
+ this.removeLayers(layers, !this.options.cacheLayers);
+ }
+
+ if(!this.options.cacheLayers && removable){
+ delete this._cache[cacheKey];
+ delete this._cells[cellKey];
+ delete this._activeCells[cellKey];
+ }
+ }
+ }, this));
+ }
+ },
+
+ /**
+ * Styling Methods
+ */
+
+ resetStyle: function (id) {
+ var layer = this._layers[id];
+
+ if(layer){
+ layer.options = layer.defaultOptions;
+ this.setFeatureStyle(layer.feature.id, this.options.style);
+ }
+
+ return this;
+ },
+
+ setStyle: function (style) {
+ this.options.style = style;
+ this.eachFeature(function (layer) {
+ this.setFeatureStyle(layer.feature.id, style);
+ }, this);
+ return this;
+ },
+
+ setFeatureStyle: function (id, style) {
+ var layer = this._layers[id];
+
+ if (typeof style === 'function') {
+ style = style(layer.feature);
+ }
+
+ /*trap inability to access default style options from MultiLine/MultiPolygon
+ please revisit at Leaflet 1.0*/
+ else if (!style && !layer.defaultOptions) {
+ var dummyPath = new L.Path();
+ style = L.Path.prototype.options;
+ style.fill = true; //not set by default
+ }
+
+ if (layer.setStyle) {
+ layer.setStyle(style);
+ }
+ },
+
+ /**
+ * Popup Methods
+ */
+
+ bindPopup: function (fn, options) {
+ this._popup = fn;
+ this._popupOptions = options;
+ for (var i in this._layers) {
+ var layer = this._layers[i];
+ var popupContent = this._popup(layer.feature, layer);
+ layer.bindPopup(popupContent, options);
+ }
+ return this;
+ },
+
+ unbindPopup: function () {
+ this._popup = false;
+ for (var i in this._layers) {
+ var layer = this._layers[i];
+ if (layer.unbindPopup) {
+ layer.unbindPopup();
+ } else if (layer.getLayers) {
+ var groupLayers = layer.getLayers();
+ for (var j in groupLayers) {
+ var gLayer = groupLayers[j];
+ gLayer.unbindPopup();
+ }
+ }
+ }
+ return this;
+ },
+
+ /**
+ * Utility Methods
+ */
+
+ eachFeature: function (fn, context) {
+ for (var i in this._layers) {
+ fn.call(context, this._layers[i]);
+ }
+ return this;
+ },
+
+ getFeature: function (id) {
+ return this._layers[id];
+ },
+
+ // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js
+ // @TODO remove at Leaflet 0.8
+ _propagateEvent: function (e) {
+ e.layer = this._layers[this._leafletIds[e.target._leaflet_id]];
+ e.target = this;
+ this.fire(e.type, e);
+ }
+});
+
+EsriLeaflet.FeatureLayer = EsriLeaflet.Layers.FeatureLayer;
+
+EsriLeaflet.Layers.featureLayer = function(url, options){
+ return new EsriLeaflet.Layers.FeatureLayer(url, options);
+};
+
+EsriLeaflet.featureLayer = function(url, options){
+ return new EsriLeaflet.Layers.FeatureLayer(url, options);
+};
+
+EsriLeaflet.Controls.Logo = L.Control.extend({
+ options: {
+ position: 'bottomright',
+ marginTop: 0,
+ marginLeft: 0,
+ marginBottom: 0,
+ marginRight: 0
+ },
+ onAdd: function () {
+ var div = L.DomUtil.create('div', 'esri-leaflet-logo');
+ div.style.marginTop = this.options.marginTop;
+ div.style.marginLeft = this.options.marginLeft;
+ div.style.marginBottom = this.options.marginBottom;
+ div.style.marginRight = this.options.marginRight;
+ div.innerHTML = '';
+ return div;
+ }
+});
+
+EsriLeaflet.Controls.logo = function(options){
+ return new L.esri.Controls.Logo(options);
+};
+
+
+ return EsriLeaflet;
+}));
+//# sourceMappingURL=esri-leaflet-src.js.map
\ No newline at end of file
diff --git a/dist/esri-leaflet-src.js.map b/dist/esri-leaflet-src.js.map
new file mode 100644
index 000000000..c043f9822
--- /dev/null
+++ b/dist/esri-leaflet-src.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["../src/EsriLeaflet.js","../src/Util.js","../src/Request.js","../src/Services/Service.js","../src/Services/FeatureLayer.js","../src/Services/MapService.js","../src/Services/ImageService.js","../src/Tasks/Task.js","../src/Tasks/Query.js","../src/Tasks/Find.js","../src/Tasks/Identify.js","../src/Tasks/IdentifyImage.js","../src/Tasks/IdentifyFeatures.js","../src/Layers/BasemapLayer.js","../src/Layers/RasterLayer.js","../src/Layers/DynamicMapLayer.js","../src/Layers/ImageMapLayer.js","../src/Layers/TiledMapLayer.js","../src/Layers/FeatureLayer/FeatureGrid.js","../src/Layers/FeatureLayer/FeatureManager.js","../src/Layers/FeatureLayer/FeatureLayer.js","../src/Controls/Logo.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI;AACxC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;AACxB,EAAE,MAAM,CAAC,CAAC,GAAG;AACb,EAAE,QAAQ,CAAC,CAAC,GAAG;AACf,EAAE,QAAQ,CAAC,CAAC,GAAG;AACf,EAAE,KAAK,CAAC,CAAC,GAAG;AACZ,EAAE,IAAI,CAAC,CAAC,GAAG;AACX,EAAE,OAAO,CAAC,CAAC,CAAC;AACZ,IAAI,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,GAAG,CAA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,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG;AAClL,IAAI,MAAM,CAAC,GAAG,CAAC;AACf,EAAE,CAAC;AACH,GAAG;AACH;AACA,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE;AAC9C,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE;AAC3C,EAAE","file":"esri-leaflet-src.js","sourcesContent":["var EsriLeaflet = { //jshint ignore:line\n VERSION: '1.0.0-rc.5',\n Layers: {},\n Services: {},\n Controls: {},\n Tasks: {},\n Util: {},\n Support: {\n CORS: !!(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()),\n pointerEvents: document.documentElement.style.pointerEvents === ''\n }\n};\n\nif(typeof window !== 'undefined' && window.L){\n window.L.esri = EsriLeaflet;\n}\n","(function(EsriLeaflet){\n\n // normalize request animation frame\n var raf = window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function(cb) { return window.setTimeout(cb, 1000 / 60); };\n\n // shallow object clone for feature properties and attributes\n // from http://jsperf.com/cloning-an-object/2\n function clone(obj) {\n var target = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n target[i] = obj[i];\n }\n }\n return target;\n }\n\n // checks if 2 x,y points are equal\n function pointsEqual(a, b) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n }\n\n // checks if the first and last points of a ring are equal and closes the ring\n function closeRing(coordinates) {\n if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {\n coordinates.push(coordinates[0]);\n }\n return coordinates;\n }\n\n // determine if polygon ring coordinates are clockwise. clockwise signifies outer ring, counter-clockwise an inner ring\n // or hole. this logic was found at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-\n // points-are-in-clockwise-order\n function ringIsClockwise(ringToTest) {\n var total = 0,i = 0;\n var rLength = ringToTest.length;\n var pt1 = ringToTest[i];\n var pt2;\n for (i; i < rLength - 1; i++) {\n pt2 = ringToTest[i + 1];\n total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);\n pt1 = pt2;\n }\n return (total >= 0);\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L504-L519\n function vertexIntersectsVertex(a1, a2, b1, b2) {\n var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);\n var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);\n var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);\n\n if ( uB !== 0 ) {\n var ua = uaT / uB;\n var ub = ubT / uB;\n\n if ( 0 <= ua && ua <= 1 && 0 <= ub && ub <= 1 ) {\n return true;\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L521-L531\n function arrayIntersectsArray(a, b) {\n for (var i = 0; i < a.length - 1; i++) {\n for (var j = 0; j < b.length - 1; j++) {\n if (vertexIntersectsVertex(a[i], a[i + 1], b[j], b[j + 1])) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L470-L480\n function coordinatesContainPoint(coordinates, point) {\n var contains = false;\n for(var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {\n if (((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||\n (coordinates[j][1] <= point[1] && point[1] < coordinates[i][1])) &&\n (point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0])) {\n contains = !contains;\n }\n }\n return contains;\n }\n\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L106-L113\n function coordinatesContainCoordinates(outer, inner){\n var intersects = arrayIntersectsArray(outer, inner);\n var contains = coordinatesContainPoint(outer, inner[0]);\n if(!intersects && contains){\n return true;\n }\n return false;\n }\n\n // do any polygons in this array contain any other polygons in this array?\n // used for checking for holes in arcgis rings\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L117-L172\n function convertRingsToGeoJSON(rings){\n var outerRings = [];\n var holes = [];\n var x; // iterator\n var outerRing; // current outer ring being evaluated\n var hole; // current hole being evaluated\n\n // for each ring\n for (var r = 0; r < rings.length; r++) {\n var ring = closeRing(rings[r].slice(0));\n if(ring.length < 4){\n continue;\n }\n // is this ring an outer ring? is it clockwise?\n if(ringIsClockwise(ring)){\n var polygon = [ ring ];\n outerRings.push(polygon); // push to outer rings\n } else {\n holes.push(ring); // counterclockwise push to holes\n }\n }\n\n var uncontainedHoles = [];\n\n // while there are holes left...\n while(holes.length){\n // pop a hole off out stack\n hole = holes.pop();\n\n // loop over all outer rings and see if they contain our hole.\n var contained = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(coordinatesContainCoordinates(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n contained = true;\n break;\n }\n }\n\n // ring is not contained in any outer ring\n // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320\n if(!contained){\n uncontainedHoles.push(hole);\n }\n }\n\n // if we couldn't match any holes using contains we can try intersects...\n while(uncontainedHoles.length){\n // pop a hole off out stack\n hole = uncontainedHoles.pop();\n\n // loop over all outer rings and see if any intersect our hole.\n var intersects = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(arrayIntersectsArray(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n intersects = true;\n break;\n }\n }\n\n if(!intersects) {\n outerRings.push([hole.reverse()]);\n }\n }\n\n if(outerRings.length === 1){\n return {\n type: 'Polygon',\n coordinates: outerRings[0]\n };\n } else {\n return {\n type: 'MultiPolygon',\n coordinates: outerRings\n };\n }\n }\n\n // This function ensures that rings are oriented in the right directions\n // outer rings are clockwise, holes are counterclockwise\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function orientRings(poly){\n var output = [];\n var polygon = poly.slice(0);\n var outerRing = closeRing(polygon.shift().slice(0));\n if(outerRing.length >= 4){\n if(!ringIsClockwise(outerRing)){\n outerRing.reverse();\n }\n\n output.push(outerRing);\n\n for (var i = 0; i < polygon.length; i++) {\n var hole = closeRing(polygon[i].slice(0));\n if(hole.length >= 4){\n if(ringIsClockwise(hole)){\n hole.reverse();\n }\n output.push(hole);\n }\n }\n }\n\n return output;\n }\n\n // This function flattens holes in multipolygons to one array of polygons\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function flattenMultiPolygonRings(rings){\n var output = [];\n for (var i = 0; i < rings.length; i++) {\n var polygon = orientRings(rings[i]);\n for (var x = polygon.length - 1; x >= 0; x--) {\n var ring = polygon[x].slice(0);\n output.push(ring);\n }\n }\n return output;\n }\n\n // convert an extent (ArcGIS) to LatLngBounds (Leaflet)\n EsriLeaflet.Util.extentToBounds = function(extent){\n var sw = new L.LatLng(extent.ymin, extent.xmin);\n var ne = new L.LatLng(extent.ymax, extent.xmax);\n return new L.LatLngBounds(sw, ne);\n };\n\n // convert an LatLngBounds (Leaflet) to extent (ArcGIS)\n EsriLeaflet.Util.boundsToExtent = function(bounds) {\n bounds = L.latLngBounds(bounds);\n return {\n 'xmin': bounds.getSouthWest().lng,\n 'ymin': bounds.getSouthWest().lat,\n 'xmax': bounds.getNorthEast().lng,\n 'ymax': bounds.getNorthEast().lat,\n 'spatialReference': {\n 'wkid' : 4326\n }\n };\n };\n\n EsriLeaflet.Util.arcgisToGeojson = function (arcgis, idAttribute){\n var geojson = {};\n\n if(typeof arcgis.x === 'number' && typeof arcgis.y === 'number'){\n geojson.type = 'Point';\n geojson.coordinates = [arcgis.x, arcgis.y];\n }\n\n if(arcgis.points){\n geojson.type = 'MultiPoint';\n geojson.coordinates = arcgis.points.slice(0);\n }\n\n if(arcgis.paths) {\n if(arcgis.paths.length === 1){\n geojson.type = 'LineString';\n geojson.coordinates = arcgis.paths[0].slice(0);\n } else {\n geojson.type = 'MultiLineString';\n geojson.coordinates = arcgis.paths.slice(0);\n }\n }\n\n if(arcgis.rings) {\n geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));\n }\n\n if(arcgis.geometry || arcgis.attributes) {\n geojson.type = 'Feature';\n geojson.geometry = (arcgis.geometry) ? EsriLeaflet.Util.arcgisToGeojson(arcgis.geometry) : null;\n geojson.properties = (arcgis.attributes) ? clone(arcgis.attributes) : null;\n if(arcgis.attributes) {\n geojson.id = arcgis.attributes[idAttribute] || arcgis.attributes.OBJECTID || arcgis.attributes.FID;\n }\n }\n\n return geojson;\n };\n\n // GeoJSON -> ArcGIS\n EsriLeaflet.Util.geojsonToArcGIS = function(geojson, idAttribute){\n idAttribute = idAttribute || 'OBJECTID';\n var spatialReference = { wkid: 4326 };\n var result = {};\n var i;\n\n switch(geojson.type){\n case 'Point':\n result.x = geojson.coordinates[0];\n result.y = geojson.coordinates[1];\n result.spatialReference = spatialReference;\n break;\n case 'MultiPoint':\n result.points = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'LineString':\n result.paths = [geojson.coordinates.slice(0)];\n result.spatialReference = spatialReference;\n break;\n case 'MultiLineString':\n result.paths = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'Polygon':\n result.rings = orientRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'MultiPolygon':\n result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'Feature':\n if(geojson.geometry) {\n result.geometry = EsriLeaflet.Util.geojsonToArcGIS(geojson.geometry, idAttribute);\n }\n result.attributes = (geojson.properties) ? clone(geojson.properties) : {};\n if(geojson.id){\n result.attributes[idAttribute] = geojson.id;\n }\n break;\n case 'FeatureCollection':\n result = [];\n for (i = 0; i < geojson.features.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.features[i], idAttribute));\n }\n break;\n case 'GeometryCollection':\n result = [];\n for (i = 0; i < geojson.geometries.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.geometries[i], idAttribute));\n }\n break;\n }\n\n return result;\n };\n\n EsriLeaflet.Util.responseToFeatureCollection = function(response, idAttribute){\n var objectIdField;\n\n if(idAttribute){\n objectIdField = idAttribute;\n } else if(response.objectIdFieldName){\n objectIdField = response.objectIdFieldName;\n } else if(response.fields) {\n for (var j = 0; j <= response.fields.length - 1; j++) {\n if(response.fields[j].type === 'esriFieldTypeOID') {\n objectIdField = response.fields[j].name;\n break;\n }\n }\n } else {\n objectIdField = 'OBJECTID';\n }\n\n var featureCollection = {\n type: 'FeatureCollection',\n features: []\n };\n var features = response.features || response.results;\n if(features.length){\n for (var i = features.length - 1; i >= 0; i--) {\n featureCollection.features.push(EsriLeaflet.Util.arcgisToGeojson(features[i], objectIdField));\n }\n }\n\n return featureCollection;\n };\n\n // trim whitespace and add a tailing slash is needed to a url\n EsriLeaflet.Util.cleanUrl = function(url){\n url = url.replace(/\\s\\s*/g, '');\n\n //add a trailing slash to the url if the user omitted it\n if(url[url.length-1] !== '/'){\n url += '/';\n }\n\n return url;\n };\n\n EsriLeaflet.Util.isArcgisOnline = function(url){\n return (/\\.arcgis\\.com/g).test(url);\n };\n\n EsriLeaflet.Util.geojsonTypeToArcGIS = function (geoJsonType) {\n var arcgisGeometryType;\n switch (geoJsonType) {\n case 'Point':\n arcgisGeometryType = 'esriGeometryPoint';\n break;\n case 'MultiPoint':\n arcgisGeometryType = 'esriGeometryMultipoint';\n break;\n case 'LineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'MultiLineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'Polygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n case 'MultiPolygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n }\n return arcgisGeometryType;\n };\n\n EsriLeaflet.Util.requestAnimationFrame = L.Util.bind(raf, window);\n\n})(EsriLeaflet);","(function(EsriLeaflet){\n\n var callbacks = 0;\n\n window._EsriLeafletCallbacks = {};\n\n function serialize(params){\n var data = '';\n\n params.f = params.f || 'json';\n\n for (var key in params){\n if(params.hasOwnProperty(key)){\n var param = params[key];\n var type = Object.prototype.toString.call(param);\n var value;\n\n if(data.length){\n data += '&';\n }\n\n if (type === '[object Array]'){\n value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');\n } else if (type === '[object Object]') {\n value = JSON.stringify(param);\n } else if (type === '[object Date]'){\n value = param.valueOf();\n } else {\n value = param;\n }\n\n data += encodeURIComponent(key) + '=' + encodeURIComponent(value);\n }\n }\n\n return data;\n }\n\n function createRequest(callback, context){\n var httpRequest = new XMLHttpRequest();\n\n httpRequest.onerror = function(e) {\n httpRequest.onreadystatechange = L.Util.falseFn;\n\n callback.call(context, {\n error: {\n code: 500,\n message: 'XMLHttpRequest error'\n }\n }, null);\n };\n\n httpRequest.onreadystatechange = function(){\n var response;\n var error;\n\n if (httpRequest.readyState === 4) {\n try {\n response = JSON.parse(httpRequest.responseText);\n } catch(e) {\n response = null;\n error = {\n code: 500,\n message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'\n };\n }\n\n if (!error && response.error) {\n error = response.error;\n response = null;\n }\n\n httpRequest.onerror = L.Util.falseFn;\n\n callback.call(context, error, response);\n }\n };\n\n return httpRequest;\n }\n\n // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)\n EsriLeaflet.Request = {\n request: function(url, params, callback, context){\n var paramString = serialize(params);\n var httpRequest = createRequest(callback, context);\n var requestLength = (url + '?' + paramString).length;\n\n // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest\n if(requestLength <= 2000 && L.esri.Support.CORS){\n httpRequest.open('GET', url + '?' + paramString);\n httpRequest.send(null);\n\n // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest\n } else if (requestLength > 2000 && L.esri.Support.CORS){\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(paramString);\n\n // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request\n } else if(requestLength <= 2000 && !L.esri.Support.CORS){\n return L.esri.Request.get.JSONP(url, params, callback, context);\n\n // request is longer then 2000 characters and the browser does not support CORS, log a warning\n } else {\n if(console && console.warn){\n console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');\n return;\n }\n }\n\n return httpRequest;\n },\n post: {\n XMLHTTP: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(serialize(params));\n\n return httpRequest;\n }\n },\n\n get: {\n CORS: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n\n httpRequest.open('GET', url + '?' + serialize(params), true);\n httpRequest.send(null);\n\n return httpRequest;\n },\n JSONP: function(url, params, callback, context){\n var callbackId = 'c' + callbacks;\n\n params.callback = 'window._EsriLeafletCallbacks.' + callbackId;\n\n var script = L.DomUtil.create('script', null, document.body);\n script.type = 'text/javascript';\n script.src = url + '?' + serialize(params);\n script.id = callbackId;\n\n window._EsriLeafletCallbacks[callbackId] = function(response){\n if(window._EsriLeafletCallbacks[callbackId] !== true){\n var error;\n var responseType = Object.prototype.toString.call(response);\n\n if(!(responseType === '[object Object]' || responseType === '[object Array]')){\n error = {\n error: {\n code: 500,\n message: 'Expected array or object as JSONP response'\n }\n };\n response = null;\n }\n\n if (!error && response.error) {\n error = response;\n response = null;\n }\n\n callback.call(context, error, response);\n window._EsriLeafletCallbacks[callbackId] = true;\n }\n };\n\n callbacks++;\n\n return {\n id: callbackId,\n url: script.src,\n abort: function(){\n window._EsriLeafletCallbacks._callback[callbackId]({\n code: 0,\n message: 'Request aborted.'\n });\n }\n };\n }\n }\n };\n\n // choose the correct AJAX handler depending on CORS support\n EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;\n\n // always use XMLHttpRequest for posts\n EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;\n\n // expose a common request method the uses GET\\POST based on request length\n EsriLeaflet.request = EsriLeaflet.Request.request;\n\n})(EsriLeaflet);","EsriLeaflet.Services.Service = L.Class.extend({\n\n includes: L.Mixin.Events,\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n initialize: function (options) {\n options = options || {};\n this._requestQueue = [];\n this._authenticating = false;\n L.Util.setOptions(this, options);\n this.options.url = EsriLeaflet.Util.cleanUrl(this.options.url);\n },\n\n get: function (path, params, callback, context) {\n return this._request('get', path, params, callback, context);\n },\n\n post: function (path, params, callback, context) {\n return this._request('post', path, params, callback, context);\n },\n\n request: function (path, params, callback, context) {\n return this._request('request', path, params, callback, context);\n },\n\n metadata: function (callback, context) {\n return this._request('get', '', {}, callback, context);\n },\n\n authenticate: function(token){\n this._authenticating = false;\n this.options.token = token;\n this._runQueue();\n return this;\n },\n\n _request: function(method, path, params, callback, context){\n this.fire('requeststart', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n\n var wrappedCallback = this._createServiceCallback(method, path, params, callback, context);\n\n if (this.options.token) {\n params.token = this.options.token;\n }\n\n if (this._authenticating) {\n this._requestQueue.push([method, path, params, callback, context]);\n return;\n } else {\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, wrappedCallback);\n } else {\n return EsriLeaflet[method](url, params, wrappedCallback);\n }\n }\n },\n\n _createServiceCallback: function(method, path, params, callback, context){\n var request = [method, path, params, callback, context];\n\n return L.Util.bind(function(error, response){\n\n if (error && (error.code === 499 || error.code === 498)) {\n this._authenticating = true;\n\n this._requestQueue.push(request);\n\n this.fire('authenticationrequired', {\n authenticate: L.Util.bind(this.authenticate, this)\n });\n } else {\n callback.call(context, error, response);\n\n if(error) {\n this.fire('requesterror', {\n url: this.options.url + path,\n params: params,\n message: error.message,\n code: error.code,\n method: method\n });\n } else {\n this.fire('requestsuccess', {\n url: this.options.url + path,\n params: params,\n response: response,\n method: method\n });\n }\n\n this.fire('requestend', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n }\n }, this);\n },\n\n _runQueue: function(){\n for (var i = this._requestQueue.length - 1; i >= 0; i--) {\n var request = this._requestQueue[i];\n var method = request.shift();\n this[method].apply(this, request);\n }\n this._requestQueue = [];\n }\n\n});\n\nEsriLeaflet.Services.service = function(params){\n return new EsriLeaflet.Services.Service(params);\n};","EsriLeaflet.Services.FeatureLayer = EsriLeaflet.Services.Service.extend({\n\n options: {\n idAttribute: 'OBJECTID'\n },\n\n query: function(){\n return new EsriLeaflet.Tasks.Query(this);\n },\n\n addFeature: function(feature, callback, context) {\n delete feature.id;\n\n feature = EsriLeaflet.Util.geojsonToArcGIS(feature);\n\n return this.post('addFeatures', {\n features: [feature]\n }, function(error, response){\n var result = (response && response.addResults) ? response.addResults[0] : undefined;\n if(callback){\n callback.call(this, error || response.addResults[0].error, result);\n }\n }, context);\n },\n\n updateFeature: function(feature, callback, context) {\n feature = EsriLeaflet.Util.geojsonToArcGIS(feature, this.options.idAttribute);\n\n return this.post('updateFeatures', {\n features: [feature]\n }, function(error, response){\n var result = (response && response.updateResults) ? response.updateResults[0] : undefined;\n if(callback){\n callback.call(context, error || response.updateResults[0].error, result);\n }\n }, context);\n },\n\n deleteFeature: function(id, callback, context) {\n return this.post('deleteFeatures', {\n objectIds: id\n }, function(error, response){\n var result = (response && response.deleteResults) ? response.deleteResults[0] : undefined;\n if(callback){\n callback.call(context, error || response.deleteResults[0].error, result);\n }\n }, context);\n }\n\n});\n\nEsriLeaflet.Services.featureLayer = function(options) {\n return new EsriLeaflet.Services.FeatureLayer(options);\n};","EsriLeaflet.Services.MapService = EsriLeaflet.Services.Service.extend({\n\n identify: function () {\n return new EsriLeaflet.Tasks.identifyFeatures(this);\n },\n\n find: function () {\n return new EsriLeaflet.Tasks.Find(this);\n },\n\n query: function () {\n return new EsriLeaflet.Tasks.Query(this);\n }\n\n});\n\nEsriLeaflet.Services.mapService = function(params){\n return new EsriLeaflet.Services.MapService(params);\n};","EsriLeaflet.Services.ImageService = EsriLeaflet.Services.Service.extend({\n\n query: function () {\n return new EsriLeaflet.Tasks.Query(this);\n },\n\n identify: function() {\n return new EsriLeaflet.Tasks.IdentifyImage(this);\n }\n});\n\nEsriLeaflet.Services.imageService = function(params){\n return new EsriLeaflet.Services.ImageService(params);\n};","EsriLeaflet.Tasks.Task = L.Class.extend({\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n //Generate a method for each methodName:paramName in the setters for this task.\n generateSetter: function(param, context){\n return L.Util.bind(function(value){\n this.params[param] = value;\n return this;\n }, context);\n },\n\n initialize: function(endpoint){\n // endpoint can be either a url (and options) for an ArcGIS Rest Service or an instance of EsriLeaflet.Service\n if(endpoint.request && endpoint.options){\n this._service = endpoint;\n L.Util.setOptions(this, endpoint.options);\n } else {\n L.Util.setOptions(this, endpoint);\n this.options.url = L.esri.Util.cleanUrl(endpoint.url);\n }\n\n // clone default params into this object\n this.params = L.Util.extend({}, this.params || {});\n\n // generate setter methods based on the setters object implimented a child class\n if(this.setters){\n for (var setter in this.setters){\n var param = this.setters[setter];\n this[setter] = this.generateSetter(param, this);\n }\n }\n },\n\n token: function(token){\n if(this._service){\n this._service.authenticate(token);\n } else {\n this.params.token = token;\n }\n return this;\n },\n\n request: function(callback, context){\n if(this._service){\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n },\n\n _request: function(method, path, params, callback, context){\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, callback, context);\n } else{\n return EsriLeaflet[method](url, params, callback, context);\n }\n }\n});","EsriLeaflet.Tasks.Query = EsriLeaflet.Tasks.Task.extend({\n setters: {\n 'offset': 'offset',\n 'limit': 'limit',\n 'fields': 'outFields',\n 'precision': 'geometryPrecision',\n 'featureIds': 'objectIds',\n 'returnGeometry': 'returnGeometry',\n 'token': 'token'\n },\n\n path: 'query',\n\n params: {\n returnGeometry: true,\n where: '1=1',\n outSr: 4326,\n outFields: '*'\n },\n\n within: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelContains'; // will make code read layer within geometry, to the api this will reads geometry contains layer\n return this;\n },\n\n intersects: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelIntersects';\n return this;\n },\n\n contains: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelWithin'; // will make code read layer contains geometry, to the api this will reads geometry within layer\n return this;\n },\n\n // crosses: function(geometry){\n // this._setGeometry(geometry);\n // this.params.spatialRel = 'esriSpatialRelCrosses';\n // return this;\n // },\n\n // touches: function(geometry){\n // this._setGeometry(geometry);\n // this.params.spatialRel = 'esriSpatialRelTouches';\n // return this;\n // },\n\n overlaps: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelOverlaps';\n return this;\n },\n\n // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online\n nearby: function(latlng, radius){\n latlng = L.latLng(latlng);\n this.params.geometry = [latlng.lng, latlng.lat];\n this.params.geometryType = 'esriGeometryPoint';\n this.params.spatialRel = 'esriSpatialRelIntersects';\n this.params.units = 'esriSRUnit_Meter';\n this.params.distance = radius;\n this.params.inSr = 4326;\n return this;\n },\n\n where: function(string){\n this.params.where = string.replace(/\"/g, \"\\'\"); // jshint ignore:line\n return this;\n },\n\n between: function(start, end){\n this.params.time = [start.valueOf(), end.valueOf()];\n return this;\n },\n\n simplify: function(map, factor){\n var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());\n this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;\n return this;\n },\n\n orderBy: function(fieldName, order){\n order = order || 'ASC';\n this.params.orderByFields = (this.params.orderByFields) ? this.params.orderByFields + ',' : '';\n this.params.orderByFields += ([fieldName, order]).join(' ');\n return this;\n },\n\n run: function(callback, context){\n this._cleanParams();\n\n // if the service is hosted on arcgis online request geojson directly\n if(EsriLeaflet.Util.isArcgisOnline(this.options.url)){\n this.params.f = 'geojson';\n\n return this.request(function(error, response){\n callback.call(context, error, response, response);\n }, context);\n\n // otherwise convert it in the callback then pass it on\n } else {\n return this.request(function(error, response){\n callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);\n }, context);\n }\n },\n\n count: function(callback, context){\n this._cleanParams();\n this.params.returnCountOnly = true;\n return this.request(function(error, response){\n callback.call(this, error, (response && response.count), response);\n }, context);\n },\n\n ids: function(callback, context){\n this._cleanParams();\n this.params.returnIdsOnly = true;\n return this.request(function(error, response){\n callback.call(this, error, (response && response.objectIds), response);\n }, context);\n },\n\n // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online\n bounds: function(callback, context){\n this._cleanParams();\n this.params.returnExtentOnly = true;\n return this.request(function(error, response){\n callback.call(context, error, (response && response.extent && EsriLeaflet.Util.extentToBounds(response.extent)), response);\n }, context);\n },\n\n // only valid for image services\n pixelSize: function(point){\n point = L.point(point);\n this.params.pixelSize = [point.x,point.y];\n return this;\n },\n\n // only valid for map services\n layer: function(layer){\n this.path = layer + '/query';\n return this;\n },\n\n _cleanParams: function(){\n delete this.params.returnIdsOnly;\n delete this.params.returnExtentOnly;\n delete this.params.returnCountOnly;\n },\n\n _setGeometry: function(geometry) {\n this.params.inSr = 4326;\n\n // convert bounds to extent and finish\n if ( geometry instanceof L.LatLngBounds ) {\n // set geometry + geometryType\n this.params.geometry = EsriLeaflet.Util.boundsToExtent(geometry);\n this.params.geometryType = 'esriGeometryEnvelope';\n return;\n }\n\n // convert L.Marker > L.LatLng\n if(geometry.getLatLng){\n geometry = geometry.getLatLng();\n }\n\n // convert L.LatLng to a geojson point and continue;\n if (geometry instanceof L.LatLng) {\n geometry = {\n type: 'Point',\n coordinates: [geometry.lng, geometry.lat]\n };\n }\n\n // handle L.GeoJSON, pull out the first geometry\n if ( geometry instanceof L.GeoJSON ) {\n //reassign geometry to the GeoJSON value (we are assuming that only one feature is present)\n geometry = geometry.getLayers()[0].feature.geometry;\n this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);\n this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);\n }\n\n // Handle L.Polyline and L.Polygon\n if (geometry.toGeoJSON) {\n geometry = geometry.toGeoJSON();\n }\n\n // handle GeoJSON feature by pulling out the geometry\n if ( geometry.type === 'Feature' ) {\n // get the geometry of the geojson feature\n geometry = geometry.geometry;\n }\n\n // confirm that our GeoJSON is a point, line or polygon\n if ( geometry.type === 'Point' || geometry.type === 'LineString' || geometry.type === 'Polygon') {\n this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);\n this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);\n return;\n }\n\n // warn the user if we havn't found a\n /* global console */\n if(console && console.warn) {\n console.warn('invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object');\n }\n\n return;\n }\n});\n\nEsriLeaflet.Tasks.query = function(params){\n return new EsriLeaflet.Tasks.Query(params);\n};","EsriLeaflet.Tasks.Find = EsriLeaflet.Tasks.Task.extend({\n setters: {\n // method name > param name\n 'contains': 'contains',\n 'text': 'searchText',\n 'fields': 'searchFields', // denote an array or single string\n 'spatialReference': 'sr',\n 'sr': 'sr',\n 'layers': 'layers',\n 'returnGeometry': 'returnGeometry',\n 'maxAllowableOffset': 'maxAllowableOffset',\n 'precision': 'geometryPrecision',\n 'dynamicLayers': 'dynamicLayers',\n 'returnZ' : 'returnZ',\n 'returnM' : 'returnM',\n 'gdbVersion' : 'gdbVersion',\n 'token' : 'token'\n },\n\n path: 'find',\n\n params: {\n sr: 4326,\n contains: true,\n returnGeometry: true,\n returnZ: true,\n returnM: false\n },\n\n layerDefs: function (id, where) {\n this.params.layerDefs = (this.params.layerDefs) ? this.params.layerDefs + ';' : '';\n this.params.layerDefs += ([id, where]).join(':');\n return this;\n },\n\n simplify: function(map, factor){\n var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());\n this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;\n return this;\n },\n\n run: function (callback, context) {\n return this.request(function(error, response){\n callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);\n }, context);\n }\n});\n\nEsriLeaflet.Tasks.find = function (params) {\n return new EsriLeaflet.Tasks.Find(params);\n};","EsriLeaflet.Tasks.Identify = EsriLeaflet.Tasks.Task.extend({\n path: 'identify',\n\n between: function(start, end){\n this.params.time = [start.valueOf(), end.valueOf()];\n return this;\n }\n});\n","EsriLeaflet.Tasks.IdentifyImage = EsriLeaflet.Tasks.Identify.extend({\n setters: {\n 'setMosaicRule': 'mosaicRule',\n 'setRenderingRule': 'renderingRule',\n 'setPixelSize': 'pixelSize',\n 'returnCatalogItems': 'returnCatalogItems',\n 'returnGeometry': 'returnGeometry'\n },\n\n params: {\n returnGeometry: false\n },\n\n at: function(latlng){\n latlng = L.latLng(latlng);\n this.params.geometry = JSON.stringify({\n x: latlng.lng,\n y: latlng.lat,\n spatialReference:{\n wkid: 4326\n }\n });\n this.params.geometryType = 'esriGeometryPoint';\n return this;\n },\n\n getMosaicRule: function() {\n return this.params.mosaicRule;\n },\n\n getRenderingRule: function() {\n return this.params.renderingRule;\n },\n\n getPixelSize: function() {\n return this.params.pixelSize;\n },\n\n run: function (callback, context){\n return this.request(function(error, response){\n callback.call(context, error, (response && this._responseToGeoJSON(response)), response);\n }, this);\n },\n\n // get pixel data and return as geoJSON point\n // populate catalog items (if any)\n // merging in any catalogItemVisibilities as a propery of each feature\n _responseToGeoJSON: function(response) {\n var location = response.location;\n var catalogItems = response.catalogItems;\n var catalogItemVisibilities = response.catalogItemVisibilities;\n var geoJSON = {\n 'pixel': {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': [location.x, location.y]\n },\n 'crs': {\n 'type': 'EPSG',\n 'properties': {\n 'code': location.spatialReference.wkid\n }\n },\n 'properties': {\n 'OBJECTID': response.objectId,\n 'name': response.name,\n 'value': response.value\n },\n 'id': response.objectId\n }\n };\n if (response.properties && response.properties.Values) {\n geoJSON.pixel.properties.values = response.properties.Values;\n }\n if (catalogItems && catalogItems.features) {\n geoJSON.catalogItems = EsriLeaflet.Util.responseToFeatureCollection(catalogItems);\n if (catalogItemVisibilities && catalogItemVisibilities.length === geoJSON.catalogItems.features.length) {\n for (var i = catalogItemVisibilities.length - 1; i >= 0; i--) {\n geoJSON.catalogItems.features[i].properties.catalogItemVisibility = catalogItemVisibilities[i];\n }\n }\n }\n return geoJSON;\n }\n\n});\n\nEsriLeaflet.Tasks.identifyImage = function(params){\n return new EsriLeaflet.Tasks.IdentifyImage(params);\n};","EsriLeaflet.Tasks.IdentifyFeatures = EsriLeaflet.Tasks.Identify.extend({\n setters: {\n 'layers': 'layers',\n 'precision': 'geometryPrecision',\n 'tolerance': 'tolerance',\n 'returnGeometry': 'returnGeometry'\n },\n\n params: {\n sr: 4326,\n layers: 'all',\n tolerance: 3,\n returnGeometry: true\n },\n\n on: function(map){\n var extent = EsriLeaflet.Util.boundsToExtent(map.getBounds());\n var size = map.getSize();\n this.params.imageDisplay = [size.x, size.y, 96];\n this.params.mapExtent = [extent.xmin, extent.ymin, extent.xmax, extent.ymax];\n return this;\n },\n\n at: function(latlng){\n latlng = L.latLng(latlng);\n this.params.geometry = [latlng.lng, latlng.lat];\n this.params.geometryType = 'esriGeometryPoint';\n return this;\n },\n\n layerDef: function (id, where){\n this.params.layerDefs = (this.params.layerDefs) ? this.params.layerDefs + ';' : '';\n this.params.layerDefs += ([id, where]).join(':');\n return this;\n },\n\n simplify: function(map, factor){\n var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());\n this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * (1 - factor);\n return this;\n },\n\n run: function (callback, context){\n return this.request(function(error, response){\n var featureCollection = EsriLeaflet.Util.responseToFeatureCollection(response);\n var count = featureCollection.features.length;\n // tag each feature with the Id of its parent layer\n if(!error && count > 0){\n response.results = response.results.reverse();\n for (var i = 0; i < count; i++) {\n var feature = featureCollection.features[i];\n feature.layerId = response.results[i].layerId;\n }\n }\n callback.call(context, error, (response && featureCollection), response);\n }, context);\n }\n\n});\n\nEsriLeaflet.Tasks.identifyFeatures = function(params){\n return new EsriLeaflet.Tasks.IdentifyFeatures(params);\n};","(function(EsriLeaflet){\n\n var tileProtocol = (window.location.protocol !== 'https:') ? 'http:' : 'https:';\n\n EsriLeaflet.Layers.BasemapLayer = L.TileLayer.extend({\n statics: {\n TILES: {\n Streets: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',\n attributionUrl: 'https://static.arcgis.com/attribution/World_Street_Map',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n attribution: 'Esri'\n }\n },\n Topographic: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}',\n attributionUrl: 'https://static.arcgis.com/attribution/World_Topo_Map',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n attribution: 'Esri'\n }\n },\n Oceans: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}',\n attributionUrl: 'https://static.arcgis.com/attribution/Ocean_Basemap',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'Esri'\n }\n },\n OceansLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services']\n }\n },\n NationalGeographic: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'Esri'\n }\n },\n DarkGray: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'Esri, DeLorme, HERE'\n }\n },\n DarkGrayLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services']\n }\n },\n Gray: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'Esri, NAVTEQ, DeLorme'\n }\n },\n GrayLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services']\n }\n },\n Imagery: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n attribution: 'Esri, DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community'\n }\n },\n ImageryLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services']\n }\n },\n ImageryTransportation: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}',\n //pane: 'esri-label',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services']\n }\n },\n ShadedRelief: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 13,\n subdomains: ['server', 'services'],\n attribution: 'ESRI, NAVTEQ, DeLorme'\n }\n },\n ShadedReliefLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 12,\n subdomains: ['server', 'services']\n }\n },\n Terrain: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 13,\n subdomains: ['server', 'services'],\n attribution: 'Esri, USGS, NOAA'\n }\n },\n TerrainLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 13,\n subdomains: ['server', 'services']\n }\n }\n }\n },\n initialize: function(key, options){\n var config;\n\n // set the config variable with the appropriate config object\n if (typeof key === 'object' && key.urlTemplate && key.options){\n config = key;\n } else if(typeof key === 'string' && EsriLeaflet.BasemapLayer.TILES[key]){\n config = EsriLeaflet.BasemapLayer.TILES[key];\n } else {\n throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of \"Streets\", \"Topographic\", \"Oceans\", \"OceansLabels\", \"NationalGeographic\", \"Gray\", \"GrayLabels\", \"DarkGray\", \"DarkGrayLabels\", \"Imagery\", \"ImageryLabels\", \"ImageryTransportation\", \"ShadedRelief\", \"ShadedReliefLabels\", \"Terrain\" or \"TerrainLabels\"');\n }\n\n // merge passed options into the config options\n var tileOptions = L.Util.extend(config.options, options);\n\n // call the initialize method on L.TileLayer to set everything up\n L.TileLayer.prototype.initialize.call(this, config.urlTemplate, L.Util.setOptions(this, tileOptions));\n\n // if this basemap requires dynamic attribution set it up\n if(config.attributionUrl){\n this._getAttributionData(config.attributionUrl);\n }\n this._logo = new EsriLeaflet.Controls.Logo({\n position: this.options.logoPosition\n });\n },\n onAdd: function(map){\n if(!this.options.hideLogo && !map._hasEsriLogo){\n this._logo.addTo(map);\n map._hasEsriLogo = true;\n }\n\n // if(this.options.pane && EsriLeaflet.Support.pointerEvents){\n // this._initPane();\n // }\n\n L.TileLayer.prototype.onAdd.call(this, map);\n\n map.on('moveend', this._updateMapAttribution, this);\n },\n onRemove: function(map){\n // check to make sure the logo hasn't already been removed\n if(this._logo && this._logo._container){\n map.removeControl(this._logo);\n map._hasEsriLogo = false;\n }\n\n L.TileLayer.prototype.onRemove.call(this, map);\n\n map.off('moveend', this._updateMapAttribution, this);\n },\n getAttribution:function(){\n var attribution = '' + this.options.attribution + ''/* + logo*/;\n return attribution;\n },\n // _initPane: function(){\n // if(!this._map.getPane(this.options.pane)){\n // var pane = this._map.createPane(this.options.pane);\n // pane.style.pointerEvents = 'none';\n // pane.style.zIndex = 5;\n // }\n // },\n _getAttributionData: function(url){\n EsriLeaflet.get(url, {}, function(error, attributions){\n this._attributions = [];\n for (var c = 0; c < attributions.contributors.length; c++) {\n var contributor = attributions.contributors[c];\n for (var i = 0; i < contributor.coverageAreas.length; i++) {\n var coverageArea = contributor.coverageAreas[i];\n var southWest = new L.LatLng(coverageArea.bbox[0], coverageArea.bbox[1]);\n var northEast = new L.LatLng(coverageArea.bbox[2], coverageArea.bbox[3]);\n this._attributions.push({\n attribution: contributor.attribution,\n score: coverageArea.score,\n bounds: new L.LatLngBounds(southWest, northEast),\n minZoom: coverageArea.zoomMin,\n maxZoom: coverageArea.zoomMax\n });\n }\n }\n\n this._attributions.sort(function(a, b){\n return b.score - a.score;\n });\n\n this._updateMapAttribution();\n }, this);\n },\n _updateMapAttribution: function(){\n if(this._map && this._map.attributionControl && this._attributions){\n var newAttributions = '';\n var bounds = this._map.getBounds();\n var zoom = this._map.getZoom();\n\n for (var i = 0; i < this._attributions.length; i++) {\n var attribution = this._attributions[i];\n var text = attribution.attribution;\n if(!newAttributions.match(text) && bounds.intersects(attribution.bounds) && zoom >= attribution.minZoom && zoom <= attribution.maxZoom) {\n newAttributions += (', ' + text);\n }\n }\n newAttributions = newAttributions.substr(2);\n var attributionElement = this._map.attributionControl._container.querySelector('.esri-attributions');\n attributionElement.innerHTML = newAttributions;\n attributionElement.style.maxWidth = (this._map.getSize().x * 0.65) + 'px';\n this.fire('attributionupdated', {\n attribution: newAttributions\n });\n }\n }\n });\n\n EsriLeaflet.BasemapLayer = EsriLeaflet.Layers.BasemapLayer;\n\n EsriLeaflet.Layers.basemapLayer = function(key, options){\n return new EsriLeaflet.Layers.BasemapLayer(key, options);\n };\n\n EsriLeaflet.basemapLayer = function(key, options){\n return new EsriLeaflet.Layers.BasemapLayer(key, options);\n };\n\n})(EsriLeaflet);","EsriLeaflet.Layers.RasterLayer = L.Class.extend({\n includes: L.Mixin.Events,\n\n options: {\n opacity: 1,\n position: 'front',\n f: 'image'\n },\n\n onAdd: function (map) {\n this._map = map;\n\n this._update = L.Util.limitExecByInterval(this._update, this.options.updateInterval, this);\n\n if (map.options.crs && map.options.crs.code) {\n var sr = map.options.crs.code.split(':')[1];\n this.options.bboxSR = sr;\n this.options.imageSR = sr;\n }\n\n map.on('moveend', this._update, this);\n\n // if we had an image loaded and it matches the\n // current bounds show the image otherwise remove it\n if(this._currentImage && this._currentImage._bounds.equals(this._map.getBounds())){\n map.addLayer(this._currentImage);\n } else if(this._currentImage) {\n this._map.removeLayer(this._currentImage);\n this._currentImage = null;\n }\n\n this._update();\n\n if(this._popup){\n this._map.on('click', this._getPopupData, this);\n this._map.on('dblclick', this._resetPopupState, this);\n }\n },\n\n bindPopup: function(fn, popupOptions){\n this._shouldRenderPopup = false;\n this._lastClick = false;\n this._popup = L.popup(popupOptions);\n this._popupFunction = fn;\n if(this._map){\n this._map.on('click', this._getPopupData, this);\n this._map.on('dblclick', this._resetPopupState, this);\n }\n return this;\n },\n\n unbindPopup: function(){\n if(this._map){\n this._map.closePopup(this._popup);\n this._map.off('click', this._getPopupData, this);\n this._map.off('dblclick', this._resetPopupState, this);\n }\n this._popup = false;\n return this;\n },\n\n onRemove: function (map) {\n if (this._currentImage) {\n this._map.removeLayer(this._currentImage);\n }\n\n if(this._popup){\n this._map.off('click', this._getPopupData, this);\n this._map.off('dblclick', this._resetPopupState, this);\n }\n\n this._map.off('moveend', this._update, this);\n this._map = null;\n },\n\n addTo: function(map){\n map.addLayer(this);\n return this;\n },\n\n removeFrom: function(map){\n map.removeLayer(this);\n return this;\n },\n\n bringToFront: function(){\n this.options.position = 'front';\n if(this._currentImage){\n this._currentImage.bringToFront();\n }\n return this;\n },\n\n bringToBack: function(){\n this.options.position = 'back';\n if(this._currentImage){\n this._currentImage.bringToBack();\n }\n return this;\n },\n\n getAttribution: function () {\n return this.options.attribution;\n },\n\n getOpacity: function(){\n return this.options.opacity;\n },\n\n setOpacity: function(opacity){\n this.options.opacity = opacity;\n this._currentImage.setOpacity(opacity);\n return this;\n },\n\n getTimeRange: function(){\n return [this.options.from, this.options.to];\n },\n\n setTimeRange: function(from, to){\n this.options.from = from;\n this.options.to = to;\n this._update();\n return this;\n },\n\n metadata: function(callback, context){\n this._service.metadata(callback, context);\n return this;\n },\n\n authenticate: function(token){\n this._service.authenticate(token);\n return this;\n },\n\n _renderImage: function(url, bounds){\n if(this._map){\n // create a new image overlay and add it to the map\n // to start loading the image\n // opacity is 0 while the image is loading\n var image = new L.ImageOverlay(url, bounds, {\n opacity: 0\n }).addTo(this._map);\n\n // once the image loads\n image.once('load', function(e){\n var newImage = e.target;\n var oldImage = this._currentImage;\n\n // if the bounds of this image matches the bounds that\n // _renderImage was called with and we have a map\n // hide the old image if there is one and set the opacity\n // of the new image otherwise remove the new image\n if(newImage._bounds.equals(bounds)){\n this._currentImage = newImage;\n\n if(this.options.position === 'front'){\n this.bringToFront();\n } else {\n this.bringToBack();\n }\n\n if(this._map && this._currentImage._map){\n this._currentImage.setOpacity(this.options.opacity);\n } else {\n this._currentImage._map.removeLayer(this._currentImage);\n }\n\n if(oldImage && this._map) {\n this._map.removeLayer(oldImage);\n }\n\n if(oldImage && oldImage._map){\n oldImage._map.removeLayer(oldImage);\n }\n } else {\n this._map.removeLayer(newImage);\n }\n\n this.fire('load', {\n bounds: bounds\n });\n\n }, this);\n\n this.fire('loading', {\n bounds: bounds\n });\n }\n },\n\n _update: function () {\n if(!this._map){\n return;\n }\n\n var zoom = this._map.getZoom();\n var bounds = this._map.getBounds();\n\n if(this._animatingZoom){\n return;\n }\n\n if (this._map._panTransition && this._map._panTransition._inProgress) {\n return;\n }\n\n if (zoom > this.options.maxZoom || zoom < this.options.minZoom) {\n return;\n }\n var params = this._buildExportParams();\n\n this._requestExport(params, bounds);\n },\n\n // TODO: refactor these into raster layer\n _renderPopup: function(latlng, error, results, response){\n latlng = L.latLng(latlng);\n if(this._shouldRenderPopup && this._lastClick.equals(latlng)){\n //add the popup to the map where the mouse was clicked at\n var content = this._popupFunction(error, results, response);\n if (content) {\n this._popup.setLatLng(latlng).setContent(content).openOn(this._map);\n }\n }\n },\n\n _resetPopupState: function(e){\n this._shouldRenderPopup = false;\n this._lastClick = e.latlng;\n },\n\n // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js\n // @TODO remove at Leaflet 0.8\n _propagateEvent: function (e) {\n e = L.extend({\n layer: e.target,\n target: this\n }, e);\n this.fire(e.type, e);\n }\n});","EsriLeaflet.Layers.DynamicMapLayer = EsriLeaflet.Layers.RasterLayer.extend({\n\n options: {\n updateInterval: 150,\n layers: false,\n layerDefs: false,\n timeOptions: false,\n format: 'png24',\n transparent: true\n },\n\n initialize: function (url, options) {\n options = options || {};\n options.url = EsriLeaflet.Util.cleanUrl(url);\n this._service = new EsriLeaflet.Services.MapService(options);\n this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);\n if (options.proxy){\n options.f = 'json';\n }\n L.Util.setOptions(this, options);\n },\n\n getLayers: function(){\n return this.options.layers;\n },\n\n setLayers: function(layers){\n this.options.layers = layers;\n this._update();\n return this;\n },\n\n getLayerDefs: function(){\n return this.options.layerDefs;\n },\n\n setLayerDefs: function(layerDefs){\n this.options.layerDefs = layerDefs;\n this._update();\n return this;\n },\n\n getTimeOptions: function(){\n return this.options.timeOptions;\n },\n\n setTimeOptions: function(timeOptions){\n this.options.timeOptions = timeOptions;\n this._update();\n return this;\n },\n\n query: function(){\n return this._service.query();\n },\n\n identify: function(){\n return this._service.identify();\n },\n\n find: function(){\n return this._service.find();\n },\n\n _getPopupData: function(e){\n var callback = L.Util.bind(function(error, featureCollection, response) {\n setTimeout(L.Util.bind(function(){\n this._renderPopup(e.latlng, error, featureCollection, response);\n }, this), 300);\n }, this);\n\n var identifyRequest = this.identify().on(this._map).at(e.latlng);\n\n if(this.options.layers){\n identifyRequest.layers('visible:' + this.options.layers.join(','));\n } else {\n identifyRequest.layers('visible');\n }\n\n identifyRequest.run(callback);\n\n // set the flags to show the popup\n this._shouldRenderPopup = true;\n this._lastClick = e.latlng;\n },\n\n _buildExportParams: function () {\n var bounds = this._map.getBounds();\n var size = this._map.getSize();\n var ne = this._map.options.crs.project(bounds._northEast);\n var sw = this._map.options.crs.project(bounds._southWest);\n\n var params = {\n bbox: [sw.x, sw.y, ne.x, ne.y].join(','),\n size: size.x + ',' + size.y,\n dpi: 96,\n format: this.options.format,\n transparent: this.options.transparent,\n bboxSR: this.options.bboxSR,\n imageSR: this.options.imageSR\n };\n\n if(this.options.layers){\n params.layers = 'show:' + this.options.layers.join(',');\n }\n\n if(this.options.layerDefs){\n params.layerDefs = JSON.stringify(this.options.layerDefs);\n }\n\n if(this.options.timeOptions){\n params.timeOptions = JSON.stringify(this.options.timeOptions);\n }\n\n if(this.options.from && this.options.to){\n params.time = this.options.from.valueOf() + ',' + this.options.to.valueOf();\n }\n\n if(this._service.options.token) {\n params.token = this._service.options.token;\n }\n\n return params;\n },\n\n _requestExport: function (params, bounds) {\n if(this.options.f === 'json'){\n this._service.get('export', params, function(error, response){\n this._renderImage(response.href, bounds);\n }, this);\n } else {\n params.f = 'image';\n this._renderImage(this.options.url + 'export' + L.Util.getParamString(params), bounds);\n }\n }\n});\n\nEsriLeaflet.DynamicMapLayer = EsriLeaflet.Layers.DynamicMapLayer;\n\nEsriLeaflet.Layers.dynamicMapLayer = function(url, options){\n return new EsriLeaflet.Layers.DynamicMapLayer(url, options);\n};\n\nEsriLeaflet.dynamicMapLayer = function(url, options){\n return new EsriLeaflet.Layers.DynamicMapLayer(url, options);\n};","EsriLeaflet.Layers.ImageMapLayer = EsriLeaflet.Layers.RasterLayer.extend({\n\n options: {\n updateInterval: 150,\n format: 'jpgpng'\n },\n\n query: function(){\n return this._service.query();\n },\n\n identify: function(){\n return this._service.identify();\n },\n\n initialize: function (url, options) {\n options = options || {};\n options.url = EsriLeaflet.Util.cleanUrl(url);\n this._service = new EsriLeaflet.Services.ImageService(options);\n this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);\n L.Util.setOptions(this, options);\n },\n\n setPixelType: function (pixelType) {\n this.options.pixelType = pixelType;\n this._update();\n return this;\n },\n\n getPixelType: function () {\n return this.options.pixelType;\n },\n\n setBandIds: function (bandIds) {\n if (L.Util.isArray(bandIds)) {\n this.options.bandIds = bandIds.join(',');\n } else {\n this.options.bandIds = bandIds.toString();\n }\n this._update();\n return this;\n },\n\n getBandIds: function () {\n return this.options.bandIds;\n },\n\n setNoData: function (noData, noDataInterpretation) {\n if (L.Util.isArray(noData)) {\n this.options.noData = noData.join(',');\n } else {\n this.options.noData = noData.toString();\n }\n if (noDataInterpretation) {\n this.options.noDataInterpretation = noDataInterpretation;\n }\n this._update();\n return this;\n },\n\n getNoData: function () {\n return this.options.noData;\n },\n\n getNoDataInterpretation: function () {\n return this.options.noDataInterpretation;\n },\n\n setRenderingRule: function(renderingRule) {\n this.options.renderingRule = renderingRule;\n this._update();\n },\n\n getRenderingRule: function() {\n return this.options.renderingRule;\n },\n\n setMosaicRule: function(mosaicRule) {\n this.options.mosaicRule = mosaicRule;\n this._update();\n },\n\n getMosaicRule: function() {\n return this.options.mosaicRule;\n },\n\n _getPopupData: function(e){\n var callback = L.Util.bind(function(error, results, response) {\n setTimeout(L.Util.bind(function(){\n this._renderPopup(e.latlng, error, results, response);\n }, this), 300);\n }, this);\n\n var identifyRequest = this.identify().at(e.latlng);\n\n // set mosaic rule for identify task if it is set for layer\n if (this.options.mosaicRule) {\n identifyRequest.setMosaicRule(this.options.mosaicRule);\n // @TODO: force return catalog items too?\n }\n\n // @TODO: set rendering rule? Not sure,\n // sometimes you want raw pixel values\n // if (this.options.renderingRule) {\n // identifyRequest.setRenderingRule(this.options.renderingRule);\n // }\n\n identifyRequest.run(callback);\n\n // set the flags to show the popup\n this._shouldRenderPopup = true;\n this._lastClick = e.latlng;\n },\n\n _buildExportParams: function () {\n var bounds = this._map.getBounds();\n var size = this._map.getSize();\n var ne = this._map.options.crs.project(bounds._northEast);\n var sw = this._map.options.crs.project(bounds._southWest);\n\n var params = {\n bbox: [sw.x, sw.y, ne.x, ne.y].join(','),\n size: size.x + ',' + size.y,\n format: this.options.format,\n bboxSR: this.options.bboxSR,\n imageSR: this.options.imageSR\n };\n\n if (this.options.from && this.options.to) {\n params.time = this.options.from.valueOf() + ',' + this.options.to.valueOf();\n }\n\n if (this.options.pixelType) {\n params.pixelType = this.options.pixelType;\n }\n\n if (this.options.interpolation) {\n params.interpolation = this.options.interpolation;\n }\n\n if (this.options.compressionQuality) {\n params.compressionQuality = this.options.compressionQuality;\n }\n\n if (this.options.bandIds) {\n params.bandIds = this.options.bandIds;\n }\n\n if (this.options.noData) {\n params.noData = this.options.noData;\n }\n\n if (this.options.noDataInterpretation) {\n params.noDataInterpretation = this.options.noDataInterpretation;\n }\n\n if (this._service.options.token) {\n params.token = this._service.options.token;\n }\n\n if(this.options.renderingRule) {\n params.renderingRule = JSON.stringify(this.options.renderingRule);\n }\n\n if(this.options.mosaicRule) {\n params.mosaicRule = JSON.stringify(this.options.mosaicRule);\n }\n\n return params;\n },\n\n _requestExport: function (params, bounds) {\n if (this.options.f === 'json') {\n this._service.get('exportImage', params, function(error, response){\n this._renderImage(response.href, bounds);\n }, this);\n } else {\n params.f = 'image';\n this._renderImage(this.options.url + 'exportImage' + L.Util.getParamString(params), bounds);\n }\n }\n});\n\nEsriLeaflet.ImageMapLayer = EsriLeaflet.Layers.ImageMapLayer;\n\nEsriLeaflet.Layers.imageMapLayer = function (url, options) {\n return new EsriLeaflet.Layers.ImageMapLayer(url, options);\n};\n\nEsriLeaflet.imageMapLayer = function (url, options) {\n return new EsriLeaflet.Layers.ImageMapLayer(url, options);\n};","EsriLeaflet.Layers.TiledMapLayer = L.TileLayer.extend({\n initialize: function(url, options){\n options = options || {};\n options.url = EsriLeaflet.Util.cleanUrl(url);\n options = L.Util.setOptions(this, options);\n\n // set the urls\n //this.url = L.esri.Util.cleanUrl(url);\n this.tileUrl = L.esri.Util.cleanUrl(url) + 'tile/{z}/{y}/{x}';\n this._service = new L.esri.Services.MapService(options);\n this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);\n\n //if this is looking at the AGO tiles subdomain insert the subdomain placeholder\n if(this.tileUrl.match('://tiles.arcgisonline.com')){\n this.tileUrl = this.tileUrl.replace('://tiles.arcgisonline.com', '://tiles{s}.arcgisonline.com');\n options.subdomains = ['1', '2', '3', '4'];\n }\n\n if(this.options.token) {\n this.tileUrl += ('?token=' + this.options.token);\n }\n\n // init layer by calling TileLayers initialize method\n L.TileLayer.prototype.initialize.call(this, this.tileUrl, options);\n },\n\n metadata: function(callback, context){\n this._service.metadata(callback, context);\n return this;\n },\n\n identify: function(){\n return this._service.identify();\n },\n\n authenticate: function(token){\n var tokenQs = '?token=' + token;\n this.tileUrl = (this.options.token) ? this.tileUrl.replace(/\\?token=(.+)/g, tokenQs) : this.tileUrl + tokenQs;\n this.options.token = token;\n this._service.authenticate(token);\n return this;\n },\n\n // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js\n // @TODO remove at Leaflet 0.8\n _propagateEvent: function (e) {\n e = L.extend({\n layer: e.target,\n target: this\n }, e);\n this.fire(e.type, e);\n }\n});\n\nL.esri.TiledMapLayer = L.esri.Layers.tiledMapLayer;\n\nL.esri.Layers.tiledMapLayer = function(url, options){\n return new L.esri.Layers.TiledMapLayer(url, options);\n};\n\nL.esri.tiledMapLayer = function(url, options){\n return new L.esri.Layers.TiledMapLayer(url, options);\n};","EsriLeaflet.Layers.FeatureGrid = L.Class.extend({\n\n includes: L.Mixin.Events,\n\n options: {\n cellSize: 512,\n updateInterval: 150\n },\n\n initialize: function (options) {\n options = L.setOptions(this, options);\n },\n\n onAdd: function (map) {\n this._map = map;\n this._update = L.Util.limitExecByInterval(this._update, this.options.updateInterval, this);\n\n // @TODO remove for leaflet 0.8\n this._map.addEventListener(this.getEvents(), this);\n\n this._reset();\n this._update();\n },\n\n onRemove: function(){\n this._map.removeEventListener(this.getEvents(), this);\n this._removeCells();\n },\n\n getEvents: function () {\n var events = {\n viewreset: this._reset,\n moveend: this._update,\n zoomend : this._onZoom\n };\n\n return events;\n },\n\n addTo: function(map){\n map.addLayer(this);\n return this;\n },\n\n removeFrom: function(map){\n map.removeLayer(this);\n return this;\n },\n\n _onZoom : function () {\n var zoom = this._map.getZoom();\n\n if (zoom > this.options.maxZoom ||\n zoom < this.options.minZoom) {\n this.removeFrom(this._map);\n this._map.addEventListener('zoomend', this.getEvents().zoomend, this);\n } else if (!this._map.hasLayer(this)) {\n this._map.removeEventListener('zoomend', this.getEvents().zoomend, this);\n this.addTo(this._map);\n }\n\n },\n\n _reset: function () {\n this._removeCells();\n\n this._cells = {};\n this._activeCells = {};\n this._cellsToLoad = 0;\n this._cellsTotal = 0;\n\n // @TODO enable at Leaflet 0.8\n // this._cellNumBounds = this._getCellNumBounds();\n\n this._resetWrap();\n },\n\n _resetWrap: function () {\n var map = this._map,\n crs = map.options.crs;\n\n if (crs.infinite) { return; }\n\n var cellSize = this._getCellSize();\n\n if (crs.wrapLng) {\n this._wrapLng = [\n Math.floor(map.project([0, crs.wrapLng[0]]).x / cellSize),\n Math.ceil(map.project([0, crs.wrapLng[1]]).x / cellSize)\n ];\n }\n\n if (crs.wrapLat) {\n this._wrapLat = [\n Math.floor(map.project([crs.wrapLat[0], 0]).y / cellSize),\n Math.ceil(map.project([crs.wrapLat[1], 0]).y / cellSize)\n ];\n }\n },\n\n _getCellSize: function () {\n return this.options.cellSize;\n },\n\n _update: function () {\n if (!this._map) { return; }\n\n var bounds = this._map.getPixelBounds(),\n zoom = this._map.getZoom(),\n cellSize = this._getCellSize(),\n cellPadding = [cellSize/2,cellSize/2];\n // cellPadding = [0,0]\n\n if (zoom > this.options.maxZoom ||\n zoom < this.options.minZoom) { return; }\n\n // cell coordinates range for the current view\n var topLeft = bounds.min.subtract(cellPadding).divideBy(cellSize).floor();\n topLeft.x = Math.max(topLeft.x, 0);\n topLeft.y = Math.max(topLeft.y, 0);\n\n var cellBounds = L.bounds(topLeft, bounds.max.add(cellPadding).divideBy(cellSize).floor());\n\n // remove any present cells that are off the specified bounds\n this._removeOtherCells(cellBounds);\n this._addCells(cellBounds);\n },\n\n _addCells: function (bounds) {\n var queue = [],\n center = bounds.getCenter(),\n zoom = this._map.getZoom();\n\n var j, i, coords;\n // create a queue of coordinates to load cells from\n for (j = bounds.min.y; j <= bounds.max.y; j++) {\n for (i = bounds.min.x; i <= bounds.max.x; i++) {\n coords = new L.Point(i, j);\n coords.z = zoom;\n\n // @TODO enable at Leaflet 0.8\n // if (this._isValidCell(coords)) {\n // queue.push(coords);\n // }\n\n queue.push(coords);\n }\n }\n var cellsToLoad = queue.length;\n\n if (cellsToLoad === 0) { return; }\n\n this._cellsToLoad += cellsToLoad;\n this._cellsTotal += cellsToLoad;\n\n // sort cell queue to load cells in order of their distance to center\n queue.sort(function (a, b) {\n return a.distanceTo(center) - b.distanceTo(center);\n });\n\n for (i = 0; i < cellsToLoad; i++) {\n this._addCell(queue[i]);\n }\n },\n\n // @TODO enable at Leaflet 0.8\n // _isValidCell: function (coords) {\n // var crs = this._map.options.crs;\n\n // if (!crs.infinite) {\n // // don't load cell if it's out of bounds and not wrapped\n // var bounds = this._cellNumBounds;\n // if (\n // (!crs.wrapLng && (coords.x < bounds.min.x || coords.x > bounds.max.x)) ||\n // (!crs.wrapLat && (coords.y < bounds.min.y || coords.y > bounds.max.y))\n // ) {\n // return false;\n // }\n // }\n\n // if (!this.options.bounds) {\n // return true;\n // }\n\n // // don't load cell if it doesn't intersect the bounds in options\n // var cellBounds = this._cellCoordsToBounds(coords);\n // return L.latLngBounds(this.options.bounds).intersects(cellBounds);\n // },\n\n // converts cell coordinates to its geographical bounds\n _cellCoordsToBounds: function (coords) {\n var map = this._map,\n cellSize = this.options.cellSize,\n\n nwPoint = coords.multiplyBy(cellSize),\n sePoint = nwPoint.add([cellSize, cellSize]),\n\n // @TODO for Leaflet 0.8\n // nw = map.wrapLatLng(map.unproject(nwPoint, coords.z)),\n // se = map.wrapLatLng(map.unproject(sePoint, coords.z));\n\n nw = map.unproject(nwPoint, coords.z).wrap(),\n se = map.unproject(sePoint, coords.z).wrap();\n\n return new L.LatLngBounds(nw, se);\n },\n\n // converts cell coordinates to key for the cell cache\n _cellCoordsToKey: function (coords) {\n return coords.x + ':' + coords.y;\n },\n\n // converts cell cache key to coordiantes\n _keyToCellCoords: function (key) {\n var kArr = key.split(':'),\n x = parseInt(kArr[0], 10),\n y = parseInt(kArr[1], 10);\n\n return new L.Point(x, y);\n },\n\n // remove any present cells that are off the specified bounds\n _removeOtherCells: function (bounds) {\n for (var key in this._cells) {\n if (!bounds.contains(this._keyToCellCoords(key))) {\n this._removeCell(key);\n }\n }\n },\n\n _removeCell: function (key) {\n var cell = this._activeCells[key];\n if(cell){\n delete this._activeCells[key];\n\n if (this.cellLeave) {\n this.cellLeave(cell.bounds, cell.coords);\n }\n\n this.fire('cellleave', {\n bounds: cell.bounds,\n coords: cell.coords\n });\n }\n },\n\n _removeCells: function(){\n for (var key in this._cells) {\n var bounds = this._cells[key].bounds;\n var coords = this._cells[key].coords;\n\n if (this.cellLeave) {\n this.cellLeave(bounds, coords);\n }\n\n this.fire('cellleave', {\n bounds: bounds,\n coords: coords\n });\n }\n },\n\n _addCell: function (coords) {\n\n // wrap cell coords if necessary (depending on CRS)\n this._wrapCoords(coords);\n\n // generate the cell key\n var key = this._cellCoordsToKey(coords);\n\n // get the cell from the cache\n var cell = this._cells[key];\n // if this cell should be shown as isnt active yet (enter)\n\n if (cell && !this._activeCells[key]) {\n if (this.cellEnter) {\n this.cellEnter(cell.bounds, coords);\n }\n\n this.fire('cellenter', {\n bounds: cell.bounds,\n coords: coords\n });\n\n this._activeCells[key] = cell;\n }\n\n // if we dont have this cell in the cache yet (create)\n if (!cell) {\n cell = {\n coords: coords,\n bounds: this._cellCoordsToBounds(coords)\n };\n\n this._cells[key] = cell;\n this._activeCells[key] = cell;\n\n if(this.createCell){\n this.createCell(cell.bounds, coords);\n }\n\n this.fire('cellcreate', {\n bounds: cell.bounds,\n coords: coords\n });\n }\n },\n\n _wrapCoords: function (coords) {\n coords.x = this._wrapLng ? L.Util.wrapNum(coords.x, this._wrapLng) : coords.x;\n coords.y = this._wrapLat ? L.Util.wrapNum(coords.y, this._wrapLat) : coords.y;\n }\n\n // get the global cell coordinates range for the current zoom\n // @TODO enable at Leaflet 0.8\n // _getCellNumBounds: function () {\n // // @TODO for Leaflet 0.8\n // // var bounds = this._map.getPixelWorldBounds(),\n // // size = this._getCellSize();\n // //\n // // return bounds ? L.bounds(\n // // bounds.min.divideBy(size).floor(),\n // // bounds.max.divideBy(size).ceil().subtract([1, 1])) : null;\n // }\n\n});","(function(EsriLeaflet){\n\n EsriLeaflet.Layers.FeatureManager = EsriLeaflet.Layers.FeatureGrid.extend({\n\n /**\n * Options\n */\n\n options: {\n where: '1=1',\n fields: ['*'],\n from: false,\n to: false,\n timeField: false,\n timeFilterMode: 'server',\n simplifyFactor: 0,\n precision: 6\n },\n\n /**\n * Constructor\n */\n\n initialize: function (url, options) {\n EsriLeaflet.Layers.FeatureGrid.prototype.initialize.call(this, options);\n\n options = options || {};\n options.url = EsriLeaflet.Util.cleanUrl(url);\n options = L.setOptions(this, options);\n\n this._service = new EsriLeaflet.Services.FeatureLayer(options);\n\n //use case insensitive regex to look for common fieldnames used for indexing\n /*global console */\n if (this.options.fields[0] !== '*'){\n var oidCheck = false;\n for (var i = 0; i < this.options.fields.length; i++){\n if (this.options.fields[i].match(/^(OBJECTID|FID|OID|ID)$/i)){\n oidCheck = true;\n }\n }\n if (oidCheck === false && console && console.warn){\n console.warn('no known esriFieldTypeOID field detected in fields Array. Please add an attribute field containing unique IDs to ensure the layer can be drawn correctly.');\n }\n }\n\n // Leaflet 0.8 change to new propagation\n this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', function (e) {\n e = L.extend({\n target: this\n }, e);\n this.fire(e.type, e);\n }, this);\n\n if(this.options.timeField.start && this.options.timeField.end){\n this._startTimeIndex = new BinarySearchIndex();\n this._endTimeIndex = new BinarySearchIndex();\n } else if(this.options.timeField){\n this._timeIndex = new BinarySearchIndex();\n }\n\n this._cache = {};\n this._currentSnapshot = []; // cache of what layers should be active\n this._activeRequests = 0;\n this._pendingRequests = [];\n },\n\n /**\n * Layer Interface\n */\n\n onAdd: function(map){\n return EsriLeaflet.Layers.FeatureGrid.prototype.onAdd.call(this, map);\n },\n\n onRemove: function(map){\n return EsriLeaflet.Layers.FeatureGrid.prototype.onRemove.call(this, map);\n },\n\n getAttribution: function () {\n return this.options.attribution;\n },\n\n /**\n * Feature Managment\n */\n\n createCell: function(bounds, coords){\n this._requestFeatures(bounds, coords);\n },\n\n _requestFeatures: function(bounds, coords, callback){\n this._activeRequests++;\n\n // our first active request fires loading\n if(this._activeRequests === 1){\n this.fire('loading', {\n bounds: bounds\n });\n }\n\n return this._buildQuery(bounds).run(function(error, featureCollection, response){\n if(response && response.exceededTransferLimit){\n this.fire('drawlimitexceeded');\n }\n\n //deincriment the request counter\n this._activeRequests--;\n\n if(!error && featureCollection.features.length){\n // schedule adding features until the next animation frame\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n this._addFeatures(featureCollection.features, coords);\n }, this));\n }\n\n if(callback){\n callback.call(this, error, featureCollection);\n }\n\n // if there are no more active requests fire a load event for this view\n if(this._activeRequests <= 0){\n this.fire('load', {\n bounds: bounds\n });\n }\n }, this);\n },\n\n _cacheKey: function (coords){\n return coords.z + ':' + coords.x + ':' +coords.y;\n },\n\n _addFeatures: function(features, coords){\n var key = this._cacheKey(coords);\n this._cache[key] = this._cache[key] || [];\n\n for (var i = features.length - 1; i >= 0; i--) {\n var id = features[i].id;\n this._currentSnapshot.push(id);\n this._cache[key].push(id);\n }\n\n if(this.options.timeField){\n this._buildTimeIndexes(features);\n }\n\n var zoom = this._map.getZoom();\n\n if (zoom > this.options.maxZoom ||\n zoom < this.options.minZoom) { return; }\n\n this.createLayers(features);\n },\n\n _buildQuery: function(bounds){\n var query = this._service.query().intersects(bounds).where(this.options.where).fields(this.options.fields).precision(this.options.precision);\n\n if(this.options.simplifyFactor){\n query.simplify(this._map, this.options.simplifyFactor);\n }\n\n if(this.options.timeFilterMode === 'server' && this.options.from && this.options.to){\n query.between(this.options.from, this.options.to);\n }\n\n return query;\n },\n\n /**\n * Where Methods\n */\n\n setWhere: function(where, callback, context){\n\n this.options.where = (where && where.length) ? where : '1=1';\n\n var oldSnapshot = [];\n var newShapshot = [];\n var pendingRequests = 0;\n var requestError = null;\n var requestCallback = L.Util.bind(function(error, featureCollection){\n if(error){\n requestError = error;\n }\n\n if(featureCollection){\n for (var i = featureCollection.features.length - 1; i >= 0; i--) {\n newShapshot.push(featureCollection.features[i].id);\n }\n }\n\n pendingRequests--;\n\n if(pendingRequests <= 0){\n this._currentSnapshot = newShapshot;\n // schedule adding features until the next animation frame\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n this.removeLayers(oldSnapshot);\n this.addLayers(newShapshot);\n if(callback) {\n callback.call(context, requestError);\n }\n }, this));\n\n }\n }, this);\n\n for (var i = this._currentSnapshot.length - 1; i >= 0; i--) {\n oldSnapshot.push(this._currentSnapshot[i]);\n }\n\n for(var key in this._activeCells){\n pendingRequests++;\n var coords = this._keyToCellCoords(key);\n var bounds = this._cellCoordsToBounds(coords);\n this._requestFeatures(bounds, key, requestCallback);\n }\n\n return this;\n },\n\n getWhere: function(){\n return this.options.where;\n },\n\n /**\n * Time Range Methods\n */\n\n getTimeRange: function(){\n return [this.options.from, this.options.to];\n },\n\n setTimeRange: function(from, to, callback, context){\n var oldFrom = this.options.from;\n var oldTo = this.options.to;\n var pendingRequests = 0;\n var requestError = null;\n var requestCallback = L.Util.bind(function(error){\n if(error){\n requestError = error;\n }\n this._filterExistingFeatures(oldFrom, oldTo, from, to);\n\n pendingRequests--;\n\n if(callback && pendingRequests <= 0){\n callback.call(context, requestError);\n }\n }, this);\n\n this.options.from = from;\n this.options.to = to;\n\n this._filterExistingFeatures(oldFrom, oldTo, from, to);\n\n if(this.options.timeFilterMode === 'server') {\n for(var key in this._activeCells){\n pendingRequests++;\n var coords = this._keyToCellCoords(key);\n var bounds = this._cellCoordsToBounds(coords);\n this._requestFeatures(bounds, key, requestCallback);\n }\n }\n },\n\n refresh: function(){\n for(var key in this._activeCells){\n var coords = this._keyToCellCoords(key);\n var bounds = this._cellCoordsToBounds(coords);\n this._requestFeatures(bounds, key);\n }\n },\n\n _filterExistingFeatures: function (oldFrom, oldTo, newFrom, newTo) {\n var layersToRemove = (oldFrom && oldTo) ? this._getFeaturesInTimeRange(oldFrom, oldTo) : this._currentSnapshot;\n var layersToAdd = this._getFeaturesInTimeRange(newFrom, newTo);\n\n if(layersToAdd.indexOf){\n for (var i = 0; i < layersToAdd.length; i++) {\n var shouldRemoveLayer = layersToRemove.indexOf(layersToAdd[i]);\n if(shouldRemoveLayer >= 0){\n layersToRemove.splice(shouldRemoveLayer, 1);\n }\n }\n }\n\n // schedule adding features until the next animation frame\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n this.removeLayers(layersToRemove);\n this.addLayers(layersToAdd);\n }, this));\n },\n\n _getFeaturesInTimeRange: function(start, end){\n var ids = [];\n var search;\n\n if(this.options.timeField.start && this.options.timeField.end){\n var startTimes = this._startTimeIndex.between(start, end);\n var endTimes = this._endTimeIndex.between(start, end);\n search = startTimes.concat(endTimes);\n } else {\n search = this._timeIndex.between(start, end);\n }\n\n for (var i = search.length - 1; i >= 0; i--) {\n ids.push(search[i].id);\n }\n\n return ids;\n },\n\n _buildTimeIndexes: function(geojson){\n var i;\n var feature;\n if(this.options.timeField.start && this.options.timeField.end){\n var startTimeEntries = [];\n var endTimeEntries = [];\n for (i = geojson.length - 1; i >= 0; i--) {\n feature = geojson[i];\n startTimeEntries.push( {\n id: feature.id,\n value: new Date(feature.properties[this.options.timeField.start])\n });\n endTimeEntries.push( {\n id: feature.id,\n value: new Date(feature.properties[this.options.timeField.end])\n });\n }\n this._startTimeIndex.bulkAdd(startTimeEntries);\n this._endTimeIndex.bulkAdd(endTimeEntries);\n } else {\n var timeEntries = [];\n for (i = geojson.length - 1; i >= 0; i--) {\n feature = geojson[i];\n timeEntries.push( {\n id: feature.id,\n value: new Date(feature.properties[this.options.timeField])\n });\n }\n\n this._timeIndex.bulkAdd(timeEntries);\n }\n },\n\n _featureWithinTimeRange: function(feature){\n if(!this.options.from || !this.options.to){\n return true;\n }\n\n var from = +this.options.from.valueOf();\n var to = +this.options.to.valueOf();\n\n if(typeof this.options.timeField === 'string'){\n var date = +feature.properties[this.options.timeField];\n return (date >= from) && (date <= to);\n }\n\n if(this.options.timeField.start && this.options.timeField.end){\n var startDate = +feature.properties[this.options.timeField.start];\n var endDate = +feature.properties[this.options.timeField.end];\n return ((startDate >= from) && (startDate <= to)) || ((endDate >= from) && (endDate <= to));\n }\n },\n\n /**\n * Service Methods\n */\n\n authenticate: function(token){\n this._service.authenticate(token);\n return this;\n },\n\n metadata: function(callback, context){\n this._service.metadata(callback, context);\n return this;\n },\n\n query: function(){\n return this._service.query();\n },\n\n addFeature: function(feature, callback, context){\n this._service.addFeature(feature, function(error, response){\n if(!error){\n this.refresh();\n }\n if(callback){\n callback.call(context, error, response);\n }\n }, this);\n return this;\n },\n\n updateFeature: function(feature, callback, context){\n return this._service.updateFeature(feature, function(error, response){\n if(!error){\n this.refresh();\n }\n if(callback){\n callback.call(context, error, response);\n }\n }, this);\n },\n\n deleteFeature: function(id, callback, context){\n return this._service.deleteFeature(id, function(error, response){\n if(!error && response.objectId){\n this.removeLayers([response.objectId], true);\n }\n if(callback){\n callback.call(context, error, response);\n }\n }, this);\n }\n });\n\n /**\n * Temporal Binary Search Index\n */\n\n function BinarySearchIndex(values) {\n this.values = values || [];\n }\n\n BinarySearchIndex.prototype._query = function(query){\n var minIndex = 0;\n var maxIndex = this.values.length - 1;\n var currentIndex;\n var currentElement;\n var resultIndex;\n\n while (minIndex <= maxIndex) {\n resultIndex = currentIndex = (minIndex + maxIndex) / 2 | 0;\n currentElement = this.values[Math.round(currentIndex)];\n if (+currentElement.value < +query) {\n minIndex = currentIndex + 1;\n } else if (+currentElement.value > +query) {\n maxIndex = currentIndex - 1;\n } else {\n return currentIndex;\n }\n }\n\n return ~maxIndex;\n };\n\n BinarySearchIndex.prototype.sort = function(){\n this.values.sort(function(a, b) {\n return +b.value - +a.value;\n }).reverse();\n this.dirty = false;\n };\n\n BinarySearchIndex.prototype.between = function(start, end){\n if(this.dirty){\n this.sort();\n }\n\n var startIndex = this._query(start);\n var endIndex = this._query(end);\n\n if(startIndex === 0 && endIndex === 0){\n return [];\n }\n\n startIndex = Math.abs(startIndex);\n endIndex = (endIndex < 0) ? Math.abs(endIndex): endIndex + 1;\n\n return this.values.slice(startIndex, endIndex);\n };\n\n BinarySearchIndex.prototype.bulkAdd = function(items){\n this.dirty = true;\n this.values = this.values.concat(items);\n };\n\n})(EsriLeaflet);","EsriLeaflet.Layers.FeatureLayer = EsriLeaflet.Layers.FeatureManager.extend({\n\n statics: {\n EVENTS: 'click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose'\n },\n\n options: {\n cacheLayers: true\n },\n\n /**\n * Constructor\n */\n\n initialize: function (url, options) {\n EsriLeaflet.Layers.FeatureManager.prototype.initialize.call(this, url, options);\n\n options = L.setOptions(this, options);\n\n this._layers = {};\n this._leafletIds = {};\n this._key = 'c'+(Math.random() * 1e9).toString(36).replace('.', '_');\n },\n\n /**\n * Layer Interface\n */\n\n onAdd: function(map){\n map.on('zoomstart zoomend', function(e){\n this._zooming = (e.type === 'zoomstart');\n }, this);\n return EsriLeaflet.Layers.FeatureManager.prototype.onAdd.call(this, map);\n },\n\n onRemove: function(map){\n for (var i in this._layers) {\n map.removeLayer(this._layers[i]);\n }\n\n return EsriLeaflet.Layers.FeatureManager.prototype.onRemove.call(this, map);\n },\n\n createNewLayer: function(geojson){\n // @TODO Leaflet 0.8\n //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);\n return L.GeoJSON.geometryToLayer(geojson, this.options.pointToLayer, L.GeoJSON.coordsToLatLng, this.options);\n },\n\n /**\n * Feature Managment Methods\n */\n\n createLayers: function(features){\n for (var i = features.length - 1; i >= 0; i--) {\n\n var geojson = features[i];\n\n var layer = this._layers[geojson.id];\n var newLayer;\n\n if(layer && !this._map.hasLayer(layer)){\n this._map.addLayer(layer);\n }\n\n if (layer && layer.setLatLngs) {\n // @TODO Leaflet 0.8\n //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);\n\n var updateGeo = this.createNewLayer(geojson);\n layer.setLatLngs(updateGeo.getLatLngs());\n }\n\n if(!layer){\n // @TODO Leaflet 0.8\n //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);\n\n newLayer = this.createNewLayer(geojson);\n newLayer.feature = geojson;\n newLayer.defaultOptions = newLayer.options;\n newLayer._leaflet_id = this._key + '_' + geojson.id;\n\n this._leafletIds[newLayer._leaflet_id] = geojson.id;\n\n // bubble events from layers to this\n // @TODO Leaflet 0.8\n // newLayer.addEventParent(this);\n\n newLayer.on(EsriLeaflet.Layers.FeatureLayer.EVENTS, this._propagateEvent, this);\n\n // bind a popup if we have one\n if(this._popup && newLayer.bindPopup){\n newLayer.bindPopup(this._popup(newLayer.feature, newLayer), this._popupOptions);\n }\n\n if(this.options.onEachFeature){\n this.options.onEachFeature(newLayer.feature, newLayer);\n }\n\n // cache the layer\n this._layers[newLayer.feature.id] = newLayer;\n\n // style the layer\n this.resetStyle(newLayer.feature.id);\n\n this.fire('createfeature', {\n feature: newLayer.feature\n });\n\n // add the layer if it is within the time bounds or our layer is not time enabled\n if(!this.options.timeField || (this.options.timeField && this._featureWithinTimeRange(geojson)) ){\n this._map.addLayer(newLayer);\n }\n }\n }\n },\n\n addLayers: function(ids){\n for (var i = ids.length - 1; i >= 0; i--) {\n var layer = this._layers[ids[i]];\n if(layer){\n this.fire('addfeature', {\n feature: layer.feature\n });\n this._map.addLayer(layer);\n }\n }\n },\n\n removeLayers: function(ids, permanent){\n for (var i = ids.length - 1; i >= 0; i--) {\n var id = ids[i];\n var layer = this._layers[id];\n if(layer){\n this.fire('removefeature', {\n feature: layer.feature,\n permanent: permanent\n });\n this._map.removeLayer(layer);\n }\n if(layer && permanent){\n delete this._layers[id];\n }\n }\n },\n\n cellEnter: function(bounds, coords){\n if(!this._zooming){\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n var cacheKey = this._cacheKey(coords);\n var cellKey = this._cellCoordsToKey(coords);\n var layers = this._cache[cacheKey];\n if(this._activeCells[cellKey] && layers){\n this.addLayers(layers);\n }\n }, this));\n }\n },\n\n cellLeave: function(bounds, coords){\n if(!this._zooming){\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n var cacheKey = this._cacheKey(coords);\n var cellKey = this._cellCoordsToKey(coords);\n var layers = this._cache[cacheKey];\n var mapBounds = this._map.getBounds();\n if(!this._activeCells[cellKey] && layers){\n var removable = true;\n\n for (var i = 0; i < layers.length; i++) {\n var layer = this._layers[layers[i]];\n if(layer && layer.getBounds && mapBounds.intersects(layer.getBounds())){\n removable = false;\n }\n }\n\n if(removable){\n this.removeLayers(layers, !this.options.cacheLayers);\n }\n\n if(!this.options.cacheLayers && removable){\n delete this._cache[cacheKey];\n delete this._cells[cellKey];\n delete this._activeCells[cellKey];\n }\n }\n }, this));\n }\n },\n\n /**\n * Styling Methods\n */\n\n resetStyle: function (id) {\n var layer = this._layers[id];\n\n if(layer){\n layer.options = layer.defaultOptions;\n this.setFeatureStyle(layer.feature.id, this.options.style);\n }\n\n return this;\n },\n\n setStyle: function (style) {\n this.options.style = style;\n this.eachFeature(function (layer) {\n this.setFeatureStyle(layer.feature.id, style);\n }, this);\n return this;\n },\n\n setFeatureStyle: function (id, style) {\n var layer = this._layers[id];\n\n if (typeof style === 'function') {\n style = style(layer.feature);\n }\n\n /*trap inability to access default style options from MultiLine/MultiPolygon\n please revisit at Leaflet 1.0*/\n else if (!style && !layer.defaultOptions) {\n var dummyPath = new L.Path();\n style = L.Path.prototype.options;\n style.fill = true; //not set by default\n }\n\n if (layer.setStyle) {\n layer.setStyle(style);\n }\n },\n\n /**\n * Popup Methods\n */\n\n bindPopup: function (fn, options) {\n this._popup = fn;\n this._popupOptions = options;\n for (var i in this._layers) {\n var layer = this._layers[i];\n var popupContent = this._popup(layer.feature, layer);\n layer.bindPopup(popupContent, options);\n }\n return this;\n },\n\n unbindPopup: function () {\n this._popup = false;\n for (var i in this._layers) {\n var layer = this._layers[i];\n if (layer.unbindPopup) {\n layer.unbindPopup();\n } else if (layer.getLayers) {\n var groupLayers = layer.getLayers();\n for (var j in groupLayers) {\n var gLayer = groupLayers[j];\n gLayer.unbindPopup();\n }\n }\n }\n return this;\n },\n\n /**\n * Utility Methods\n */\n\n eachFeature: function (fn, context) {\n for (var i in this._layers) {\n fn.call(context, this._layers[i]);\n }\n return this;\n },\n\n getFeature: function (id) {\n return this._layers[id];\n },\n\n // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js\n // @TODO remove at Leaflet 0.8\n _propagateEvent: function (e) {\n e.layer = this._layers[this._leafletIds[e.target._leaflet_id]];\n e.target = this;\n this.fire(e.type, e);\n }\n});\n\nEsriLeaflet.FeatureLayer = EsriLeaflet.Layers.FeatureLayer;\n\nEsriLeaflet.Layers.featureLayer = function(url, options){\n return new EsriLeaflet.Layers.FeatureLayer(url, options);\n};\n\nEsriLeaflet.featureLayer = function(url, options){\n return new EsriLeaflet.Layers.FeatureLayer(url, options);\n};","EsriLeaflet.Controls.Logo = L.Control.extend({\n options: {\n position: 'bottomright',\n marginTop: 0,\n marginLeft: 0,\n marginBottom: 0,\n marginRight: 0\n },\n onAdd: function () {\n var div = L.DomUtil.create('div', 'esri-leaflet-logo');\n div.style.marginTop = this.options.marginTop;\n div.style.marginLeft = this.options.marginLeft;\n div.style.marginBottom = this.options.marginBottom;\n div.style.marginRight = this.options.marginRight;\n div.innerHTML = '';\n return div;\n }\n});\n\nEsriLeaflet.Controls.logo = function(options){\n return new L.esri.Controls.Logo(options);\n};\n"]}
\ No newline at end of file
diff --git a/dist/esri-leaflet.js b/dist/esri-leaflet.js
new file mode 100644
index 000000000..0410979d6
--- /dev/null
+++ b/dist/esri-leaflet.js
@@ -0,0 +1,25 @@
+/*! esri-leaflet - v1.0.0-rc.6 - 2015-03-05
+* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
+* Apache License*/
+(function (factory) {
+ //define an AMD module that relies on 'leaflet'
+ if (typeof define === 'function' && define.amd) {
+ define(['leaflet'], function (L) {
+ return factory(L);
+ });
+ //define a common js module that relies on 'leaflet'
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ module.exports = factory(require('leaflet'));
+ }
+
+ if(typeof window !== 'undefined' && window.L){
+ factory(window.L);
+ }
+}(function (L) {
+
+var EsriLeaflet={VERSION:"1.0.0-rc.5",Layers:{},Services:{},Controls:{},Tasks:{},Util:{},Support:{CORS:!!(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),pointerEvents:""===document.documentElement.style.pointerEvents}};"undefined"!=typeof window&&window.L&&(window.L.esri=EsriLeaflet),function(a){function b(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function c(a,b){for(var c=0;cd;d++)b=a[d+1],c+=(b[0]-f[0])*(b[1]+f[1]),f=b;return c>=0}function f(a,b,c,d){var e=(d[0]-c[0])*(a[1]-c[1])-(d[1]-c[1])*(a[0]-c[0]),f=(b[0]-a[0])*(a[1]-c[1])-(b[1]-a[1])*(a[0]-c[0]),g=(d[1]-c[1])*(b[0]-a[0])-(d[0]-c[0])*(b[1]-a[1]);if(0!==g){var h=e/g,i=f/g;if(h>=0&&1>=h&&i>=0&&1>=i)return!0}return!1}function g(a,b){for(var c=0;c=0;b--)if(c=h[b][0],i(c,f)){h[b].push(f),o=!0;break}o||n.push(f)}for(;n.length;){f=n.pop();var p=!1;for(b=h.length-1;b>=0;b--)if(c=h[b][0],g(c,f)){h[b].push(f),p=!0;break}p||h.push([f.reverse()])}return 1===h.length?{type:"Polygon",coordinates:h[0]}:{type:"MultiPolygon",coordinates:h}}function k(a){var b=[],c=a.slice(0),f=d(c.shift().slice(0));if(f.length>=4){e(f)||f.reverse(),b.push(f);for(var g=0;g=4&&(e(h)&&h.reverse(),b.push(h))}}return b}function l(a){for(var b=[],c=0;c=0;e--){var f=d[e].slice(0);b.push(f)}return b}var m=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(a){return window.setTimeout(a,1e3/60)};a.Util.extentToBounds=function(a){var b=new L.LatLng(a.ymin,a.xmin),c=new L.LatLng(a.ymax,a.xmax);return new L.LatLngBounds(b,c)},a.Util.boundsToExtent=function(a){return a=L.latLngBounds(a),{xmin:a.getSouthWest().lng,ymin:a.getSouthWest().lat,xmax:a.getNorthEast().lng,ymax:a.getNorthEast().lat,spatialReference:{wkid:4326}}},a.Util.arcgisToGeojson=function(c,d){var e={};return"number"==typeof c.x&&"number"==typeof c.y&&(e.type="Point",e.coordinates=[c.x,c.y]),c.points&&(e.type="MultiPoint",e.coordinates=c.points.slice(0)),c.paths&&(1===c.paths.length?(e.type="LineString",e.coordinates=c.paths[0].slice(0)):(e.type="MultiLineString",e.coordinates=c.paths.slice(0))),c.rings&&(e=j(c.rings.slice(0))),(c.geometry||c.attributes)&&(e.type="Feature",e.geometry=c.geometry?a.Util.arcgisToGeojson(c.geometry):null,e.properties=c.attributes?b(c.attributes):null,c.attributes&&(e.id=c.attributes[d]||c.attributes.OBJECTID||c.attributes.FID)),e},a.Util.geojsonToArcGIS=function(c,d){d=d||"OBJECTID";var e,f={wkid:4326},g={};switch(c.type){case"Point":g.x=c.coordinates[0],g.y=c.coordinates[1],g.spatialReference=f;break;case"MultiPoint":g.points=c.coordinates.slice(0),g.spatialReference=f;break;case"LineString":g.paths=[c.coordinates.slice(0)],g.spatialReference=f;break;case"MultiLineString":g.paths=c.coordinates.slice(0),g.spatialReference=f;break;case"Polygon":g.rings=k(c.coordinates.slice(0)),g.spatialReference=f;break;case"MultiPolygon":g.rings=l(c.coordinates.slice(0)),g.spatialReference=f;break;case"Feature":c.geometry&&(g.geometry=a.Util.geojsonToArcGIS(c.geometry,d)),g.attributes=c.properties?b(c.properties):{},c.id&&(g.attributes[d]=c.id);break;case"FeatureCollection":for(g=[],e=0;e=0;h--)f.features.push(a.Util.arcgisToGeojson(g[h],d));return f},a.Util.cleanUrl=function(a){return a=a.replace(/\s\s*/g,""),"/"!==a[a.length-1]&&(a+="/"),a},a.Util.isArcgisOnline=function(a){return/\.arcgis\.com/g.test(a)},a.Util.geojsonTypeToArcGIS=function(a){var b;switch(a){case"Point":b="esriGeometryPoint";break;case"MultiPoint":b="esriGeometryMultipoint";break;case"LineString":b="esriGeometryPolyline";break;case"MultiLineString":b="esriGeometryPolyline";break;case"Polygon":b="esriGeometryPolygon";break;case"MultiPolygon":b="esriGeometryPolygon"}return b},a.Util.requestAnimationFrame=L.Util.bind(m,window)}(EsriLeaflet),function(a){function b(a){var b="";a.f=a.f||"json";for(var c in a)if(a.hasOwnProperty(c)){var d,e=a[c],f=Object.prototype.toString.call(e);b.length&&(b+="&"),d="[object Array]"===f?"[object Object]"===Object.prototype.toString.call(e[0])?JSON.stringify(e):e.join(","):"[object Object]"===f?JSON.stringify(e):"[object Date]"===f?e.valueOf():e,b+=encodeURIComponent(c)+"="+encodeURIComponent(d)}return b}function c(a,b){var c=new XMLHttpRequest;return c.onerror=function(){c.onreadystatechange=L.Util.falseFn,a.call(b,{error:{code:500,message:"XMLHttpRequest error"}},null)},c.onreadystatechange=function(){var d,e;if(4===c.readyState){try{d=JSON.parse(c.responseText)}catch(f){d=null,e={code:500,message:"Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error."}}!e&&d.error&&(e=d.error,d=null),c.onerror=L.Util.falseFn,a.call(b,e,d)}},c}var d=0;window._EsriLeafletCallbacks={},a.Request={request:function(a,d,e,f){var g=b(d),h=c(e,f),i=(a+"?"+g).length;if(2e3>=i&&L.esri.Support.CORS)h.open("GET",a+"?"+g),h.send(null);else if(i>2e3&&L.esri.Support.CORS)h.open("POST",a),h.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),h.send(g);else{if(2e3>=i&&!L.esri.Support.CORS)return L.esri.Request.get.JSONP(a,d,e,f);if(console&&console.warn)return void console.warn("a request to "+a+" was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html")}return h},post:{XMLHTTP:function(a,d,e,f){var g=c(e,f);return g.open("POST",a),g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),g.send(b(d)),g}},get:{CORS:function(a,d,e,f){var g=c(e,f);return g.open("GET",a+"?"+b(d),!0),g.send(null),g},JSONP:function(a,c,e,f){var g="c"+d;c.callback="window._EsriLeafletCallbacks."+g;var h=L.DomUtil.create("script",null,document.body);return h.type="text/javascript",h.src=a+"?"+b(c),h.id=g,window._EsriLeafletCallbacks[g]=function(a){if(window._EsriLeafletCallbacks[g]!==!0){var b,c=Object.prototype.toString.call(a);"[object Object]"!==c&&"[object Array]"!==c&&(b={error:{code:500,message:"Expected array or object as JSONP response"}},a=null),!b&&a.error&&(b=a,a=null),e.call(f,b,a),window._EsriLeafletCallbacks[g]=!0}},d++,{id:g,url:h.src,abort:function(){window._EsriLeafletCallbacks._callback[g]({code:0,message:"Request aborted."})}}}}},a.get=a.Support.CORS?a.Request.get.CORS:a.Request.get.JSONP,a.post=a.Request.post.XMLHTTP,a.request=a.Request.request}(EsriLeaflet),EsriLeaflet.Services.Service=L.Class.extend({includes:L.Mixin.Events,options:{proxy:!1,useCors:EsriLeaflet.Support.CORS},initialize:function(a){a=a||{},this._requestQueue=[],this._authenticating=!1,L.Util.setOptions(this,a),this.options.url=EsriLeaflet.Util.cleanUrl(this.options.url)},get:function(a,b,c,d){return this._request("get",a,b,c,d)},post:function(a,b,c,d){return this._request("post",a,b,c,d)},request:function(a,b,c,d){return this._request("request",a,b,c,d)},metadata:function(a,b){return this._request("get","",{},a,b)},authenticate:function(a){return this._authenticating=!1,this.options.token=a,this._runQueue(),this},_request:function(a,b,c,d,e){this.fire("requeststart",{url:this.options.url+b,params:c,method:a});var f=this._createServiceCallback(a,b,c,d,e);if(this.options.token&&(c.token=this.options.token),this._authenticating)return void this._requestQueue.push([a,b,c,d,e]);var g=this.options.proxy?this.options.proxy+"?"+this.options.url+b:this.options.url+b;return"get"!==a&&"request"!==a||this.options.useCors?EsriLeaflet[a](g,c,f):EsriLeaflet.Request.get.JSONP(g,c,f)},_createServiceCallback:function(a,b,c,d,e){var f=[a,b,c,d,e];return L.Util.bind(function(g,h){!g||499!==g.code&&498!==g.code?(d.call(e,g,h),g?this.fire("requesterror",{url:this.options.url+b,params:c,message:g.message,code:g.code,method:a}):this.fire("requestsuccess",{url:this.options.url+b,params:c,response:h,method:a}),this.fire("requestend",{url:this.options.url+b,params:c,method:a})):(this._authenticating=!0,this._requestQueue.push(f),this.fire("authenticationrequired",{authenticate:L.Util.bind(this.authenticate,this)}))},this)},_runQueue:function(){for(var a=this._requestQueue.length-1;a>=0;a--){var b=this._requestQueue[a],c=b.shift();this[c].apply(this,b)}this._requestQueue=[]}}),EsriLeaflet.Services.service=function(a){return new EsriLeaflet.Services.Service(a)},EsriLeaflet.Services.FeatureLayer=EsriLeaflet.Services.Service.extend({options:{idAttribute:"OBJECTID"},query:function(){return new EsriLeaflet.Tasks.Query(this)},addFeature:function(a,b,c){return delete a.id,a=EsriLeaflet.Util.geojsonToArcGIS(a),this.post("addFeatures",{features:[a]},function(a,c){var d=c&&c.addResults?c.addResults[0]:void 0;b&&b.call(this,a||c.addResults[0].error,d)},c)},updateFeature:function(a,b,c){return a=EsriLeaflet.Util.geojsonToArcGIS(a,this.options.idAttribute),this.post("updateFeatures",{features:[a]},function(a,d){var e=d&&d.updateResults?d.updateResults[0]:void 0;b&&b.call(c,a||d.updateResults[0].error,e)},c)},deleteFeature:function(a,b,c){return this.post("deleteFeatures",{objectIds:a},function(a,d){var e=d&&d.deleteResults?d.deleteResults[0]:void 0;b&&b.call(c,a||d.deleteResults[0].error,e)},c)}}),EsriLeaflet.Services.featureLayer=function(a){return new EsriLeaflet.Services.FeatureLayer(a)},EsriLeaflet.Services.MapService=EsriLeaflet.Services.Service.extend({identify:function(){return new EsriLeaflet.Tasks.identifyFeatures(this)},find:function(){return new EsriLeaflet.Tasks.Find(this)},query:function(){return new EsriLeaflet.Tasks.Query(this)}}),EsriLeaflet.Services.mapService=function(a){return new EsriLeaflet.Services.MapService(a)},EsriLeaflet.Services.ImageService=EsriLeaflet.Services.Service.extend({query:function(){return new EsriLeaflet.Tasks.Query(this)},identify:function(){return new EsriLeaflet.Tasks.IdentifyImage(this)}}),EsriLeaflet.Services.imageService=function(a){return new EsriLeaflet.Services.ImageService(a)},EsriLeaflet.Tasks.Task=L.Class.extend({options:{proxy:!1,useCors:EsriLeaflet.Support.CORS},generateSetter:function(a,b){return L.Util.bind(function(b){return this.params[a]=b,this},b)},initialize:function(a){if(a.request&&a.options?(this._service=a,L.Util.setOptions(this,a.options)):(L.Util.setOptions(this,a),this.options.url=L.esri.Util.cleanUrl(a.url)),this.params=L.Util.extend({},this.params||{}),this.setters)for(var b in this.setters){var c=this.setters[b];this[b]=this.generateSetter(c,this)}},token:function(a){return this._service?this._service.authenticate(a):this.params.token=a,this},request:function(a,b){return this._service?this._service.request(this.path,this.params,a,b):this._request("request",this.path,this.params,a,b)},_request:function(a,b,c,d,e){var f=this.options.proxy?this.options.proxy+"?"+this.options.url+b:this.options.url+b;return"get"!==a&&"request"!==a||this.options.useCors?EsriLeaflet[a](f,c,d,e):EsriLeaflet.Request.get.JSONP(f,c,d,e)}}),EsriLeaflet.Tasks.Query=EsriLeaflet.Tasks.Task.extend({setters:{offset:"offset",limit:"limit",fields:"outFields",precision:"geometryPrecision",featureIds:"objectIds",returnGeometry:"returnGeometry",token:"token"},path:"query",params:{returnGeometry:!0,where:"1=1",outSr:4326,outFields:"*"},within:function(a){return this._setGeometry(a),this.params.spatialRel="esriSpatialRelContains",this},intersects:function(a){return this._setGeometry(a),this.params.spatialRel="esriSpatialRelIntersects",this},contains:function(a){return this._setGeometry(a),this.params.spatialRel="esriSpatialRelWithin",this},overlaps:function(a){return this._setGeometry(a),this.params.spatialRel="esriSpatialRelOverlaps",this},nearby:function(a,b){return a=L.latLng(a),this.params.geometry=[a.lng,a.lat],this.params.geometryType="esriGeometryPoint",this.params.spatialRel="esriSpatialRelIntersects",this.params.units="esriSRUnit_Meter",this.params.distance=b,this.params.inSr=4326,this},where:function(a){return this.params.where=a.replace(/"/g,"'"),this},between:function(a,b){return this.params.time=[a.valueOf(),b.valueOf()],this},simplify:function(a,b){var c=Math.abs(a.getBounds().getWest()-a.getBounds().getEast());return this.params.maxAllowableOffset=c/a.getSize().y*b,this},orderBy:function(a,b){return b=b||"ASC",this.params.orderByFields=this.params.orderByFields?this.params.orderByFields+",":"",this.params.orderByFields+=[a,b].join(" "),this},run:function(a,b){return this._cleanParams(),EsriLeaflet.Util.isArcgisOnline(this.options.url)?(this.params.f="geojson",this.request(function(c,d){a.call(b,c,d,d)},b)):this.request(function(c,d){a.call(b,c,d&&EsriLeaflet.Util.responseToFeatureCollection(d),d)},b)},count:function(a,b){return this._cleanParams(),this.params.returnCountOnly=!0,this.request(function(b,c){a.call(this,b,c&&c.count,c)},b)},ids:function(a,b){return this._cleanParams(),this.params.returnIdsOnly=!0,this.request(function(b,c){a.call(this,b,c&&c.objectIds,c)},b)},bounds:function(a,b){return this._cleanParams(),this.params.returnExtentOnly=!0,this.request(function(c,d){a.call(b,c,d&&d.extent&&EsriLeaflet.Util.extentToBounds(d.extent),d)},b)},pixelSize:function(a){return a=L.point(a),this.params.pixelSize=[a.x,a.y],this},layer:function(a){return this.path=a+"/query",this},_cleanParams:function(){delete this.params.returnIdsOnly,delete this.params.returnExtentOnly,delete this.params.returnCountOnly},_setGeometry:function(a){return this.params.inSr=4326,a instanceof L.LatLngBounds?(this.params.geometry=EsriLeaflet.Util.boundsToExtent(a),void(this.params.geometryType="esriGeometryEnvelope")):(a.getLatLng&&(a=a.getLatLng()),a instanceof L.LatLng&&(a={type:"Point",coordinates:[a.lng,a.lat]}),a instanceof L.GeoJSON&&(a=a.getLayers()[0].feature.geometry,this.params.geometry=EsriLeaflet.Util.geojsonToArcGIS(a),this.params.geometryType=EsriLeaflet.Util.geojsonTypeToArcGIS(a.type)),a.toGeoJSON&&(a=a.toGeoJSON()),"Feature"===a.type&&(a=a.geometry),"Point"===a.type||"LineString"===a.type||"Polygon"===a.type?(this.params.geometry=EsriLeaflet.Util.geojsonToArcGIS(a),void(this.params.geometryType=EsriLeaflet.Util.geojsonTypeToArcGIS(a.type))):void(console&&console.warn&&console.warn("invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object")))}}),EsriLeaflet.Tasks.query=function(a){return new EsriLeaflet.Tasks.Query(a)},EsriLeaflet.Tasks.Find=EsriLeaflet.Tasks.Task.extend({setters:{contains:"contains",text:"searchText",fields:"searchFields",spatialReference:"sr",sr:"sr",layers:"layers",returnGeometry:"returnGeometry",maxAllowableOffset:"maxAllowableOffset",precision:"geometryPrecision",dynamicLayers:"dynamicLayers",returnZ:"returnZ",returnM:"returnM",gdbVersion:"gdbVersion",token:"token"},path:"find",params:{sr:4326,contains:!0,returnGeometry:!0,returnZ:!0,returnM:!1},layerDefs:function(a,b){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[a,b].join(":"),this},simplify:function(a,b){var c=Math.abs(a.getBounds().getWest()-a.getBounds().getEast());return this.params.maxAllowableOffset=c/a.getSize().y*b,this},run:function(a,b){return this.request(function(c,d){a.call(b,c,d&&EsriLeaflet.Util.responseToFeatureCollection(d),d)},b)}}),EsriLeaflet.Tasks.find=function(a){return new EsriLeaflet.Tasks.Find(a)},EsriLeaflet.Tasks.Identify=EsriLeaflet.Tasks.Task.extend({path:"identify",between:function(a,b){return this.params.time=[a.valueOf(),b.valueOf()],this}}),EsriLeaflet.Tasks.IdentifyImage=EsriLeaflet.Tasks.Identify.extend({setters:{setMosaicRule:"mosaicRule",setRenderingRule:"renderingRule",setPixelSize:"pixelSize",returnCatalogItems:"returnCatalogItems",returnGeometry:"returnGeometry"},params:{returnGeometry:!1},at:function(a){return a=L.latLng(a),this.params.geometry=JSON.stringify({x:a.lng,y:a.lat,spatialReference:{wkid:4326}}),this.params.geometryType="esriGeometryPoint",this},getMosaicRule:function(){return this.params.mosaicRule},getRenderingRule:function(){return this.params.renderingRule},getPixelSize:function(){return this.params.pixelSize},run:function(a,b){return this.request(function(c,d){a.call(b,c,d&&this._responseToGeoJSON(d),d)},this)},_responseToGeoJSON:function(a){var b=a.location,c=a.catalogItems,d=a.catalogItemVisibilities,e={pixel:{type:"Feature",geometry:{type:"Point",coordinates:[b.x,b.y]},crs:{type:"EPSG",properties:{code:b.spatialReference.wkid}},properties:{OBJECTID:a.objectId,name:a.name,value:a.value},id:a.objectId}};if(a.properties&&a.properties.Values&&(e.pixel.properties.values=a.properties.Values),c&&c.features&&(e.catalogItems=EsriLeaflet.Util.responseToFeatureCollection(c),d&&d.length===e.catalogItems.features.length))for(var f=d.length-1;f>=0;f--)e.catalogItems.features[f].properties.catalogItemVisibility=d[f];return e}}),EsriLeaflet.Tasks.identifyImage=function(a){return new EsriLeaflet.Tasks.IdentifyImage(a)},EsriLeaflet.Tasks.IdentifyFeatures=EsriLeaflet.Tasks.Identify.extend({setters:{layers:"layers",precision:"geometryPrecision",tolerance:"tolerance",returnGeometry:"returnGeometry"},params:{sr:4326,layers:"all",tolerance:3,returnGeometry:!0},on:function(a){var b=EsriLeaflet.Util.boundsToExtent(a.getBounds()),c=a.getSize();return this.params.imageDisplay=[c.x,c.y,96],this.params.mapExtent=[b.xmin,b.ymin,b.xmax,b.ymax],this},at:function(a){return a=L.latLng(a),this.params.geometry=[a.lng,a.lat],this.params.geometryType="esriGeometryPoint",this},layerDef:function(a,b){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[a,b].join(":"),this},simplify:function(a,b){var c=Math.abs(a.getBounds().getWest()-a.getBounds().getEast());return this.params.maxAllowableOffset=c/a.getSize().y*(1-b),this},run:function(a,b){return this.request(function(c,d){var e=EsriLeaflet.Util.responseToFeatureCollection(d),f=e.features.length;if(!c&&f>0){d.results=d.results.reverse();for(var g=0;f>g;g++){var h=e.features[g];h.layerId=d.results[g].layerId}}a.call(b,c,d&&e,d)},b)}}),EsriLeaflet.Tasks.identifyFeatures=function(a){return new EsriLeaflet.Tasks.IdentifyFeatures(a)},function(a){var b="https:"!==window.location.protocol?"http:":"https:";a.Layers.BasemapLayer=L.TileLayer.extend({statics:{TILES:{Streets:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",attributionUrl:"https://static.arcgis.com/attribution/World_Street_Map",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"Esri"}},Topographic:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}",attributionUrl:"https://static.arcgis.com/attribution/World_Topo_Map",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"Esri"}},Oceans:{urlTemplate:b+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}",attributionUrl:"https://static.arcgis.com/attribution/Ocean_Basemap",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"Esri"}},OceansLabels:{urlTemplate:b+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"]}},NationalGeographic:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"Esri"}},DarkGray:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"Esri, DeLorme, HERE"}},DarkGrayLabels:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"]}},Gray:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"Esri, NAVTEQ, DeLorme"}},GrayLabels:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"]}},Imagery:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"Esri, DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community"}},ImageryLabels:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:19,subdomains:["server","services"]}},ImageryTransportation:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:19,subdomains:["server","services"]}},ShadedRelief:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"ESRI, NAVTEQ, DeLorme"}},ShadedReliefLabels:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:12,subdomains:["server","services"]}},Terrain:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"Esri, USGS, NOAA"}},TerrainLabels:{urlTemplate:b+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:13,subdomains:["server","services"]}}}},initialize:function(b,c){var d;if("object"==typeof b&&b.urlTemplate&&b.options)d=b;else{if("string"!=typeof b||!a.BasemapLayer.TILES[b])throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of "Streets", "Topographic", "Oceans", "OceansLabels", "NationalGeographic", "Gray", "GrayLabels", "DarkGray", "DarkGrayLabels", "Imagery", "ImageryLabels", "ImageryTransportation", "ShadedRelief", "ShadedReliefLabels", "Terrain" or "TerrainLabels"');d=a.BasemapLayer.TILES[b]}var e=L.Util.extend(d.options,c);L.TileLayer.prototype.initialize.call(this,d.urlTemplate,L.Util.setOptions(this,e)),d.attributionUrl&&this._getAttributionData(d.attributionUrl),this._logo=new a.Controls.Logo({position:this.options.logoPosition})},onAdd:function(a){this.options.hideLogo||a._hasEsriLogo||(this._logo.addTo(a),a._hasEsriLogo=!0),L.TileLayer.prototype.onAdd.call(this,a),a.on("moveend",this._updateMapAttribution,this)},onRemove:function(a){this._logo&&this._logo._container&&(a.removeControl(this._logo),a._hasEsriLogo=!1),L.TileLayer.prototype.onRemove.call(this,a),a.off("moveend",this._updateMapAttribution,this)},getAttribution:function(){var a=''+this.options.attribution+"";return a},_getAttributionData:function(b){a.get(b,{},function(a,b){this._attributions=[];for(var c=0;c=e.minZoom&&c<=e.maxZoom&&(a+=", "+f)}a=a.substr(2);var g=this._map.attributionControl._container.querySelector(".esri-attributions");g.innerHTML=a,g.style.maxWidth=.65*this._map.getSize().x+"px",this.fire("attributionupdated",{attribution:a})}}}),a.BasemapLayer=a.Layers.BasemapLayer,a.Layers.basemapLayer=function(b,c){return new a.Layers.BasemapLayer(b,c)},a.basemapLayer=function(b,c){return new a.Layers.BasemapLayer(b,c)}}(EsriLeaflet),EsriLeaflet.Layers.RasterLayer=L.Class.extend({includes:L.Mixin.Events,options:{opacity:1,position:"front",f:"image"},onAdd:function(a){if(this._map=a,this._update=L.Util.limitExecByInterval(this._update,this.options.updateInterval,this),a.options.crs&&a.options.crs.code){var b=a.options.crs.code.split(":")[1];this.options.bboxSR=b,this.options.imageSR=b}a.on("moveend",this._update,this),this._currentImage&&this._currentImage._bounds.equals(this._map.getBounds())?a.addLayer(this._currentImage):this._currentImage&&(this._map.removeLayer(this._currentImage),this._currentImage=null),this._update(),this._popup&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this))},bindPopup:function(a,b){return this._shouldRenderPopup=!1,this._lastClick=!1,this._popup=L.popup(b),this._popupFunction=a,this._map&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this)),this},unbindPopup:function(){return this._map&&(this._map.closePopup(this._popup),this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this)),this._popup=!1,this},onRemove:function(){this._currentImage&&this._map.removeLayer(this._currentImage),this._popup&&(this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this)),this._map.off("moveend",this._update,this),this._map=null},addTo:function(a){return a.addLayer(this),this},removeFrom:function(a){return a.removeLayer(this),this},bringToFront:function(){return this.options.position="front",this._currentImage&&this._currentImage.bringToFront(),this},bringToBack:function(){return this.options.position="back",this._currentImage&&this._currentImage.bringToBack(),this},getAttribution:function(){return this.options.attribution},getOpacity:function(){return this.options.opacity},setOpacity:function(a){return this.options.opacity=a,this._currentImage.setOpacity(a),this},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(a,b){return this.options.from=a,this.options.to=b,this._update(),this},metadata:function(a,b){return this._service.metadata(a,b),this},authenticate:function(a){return this._service.authenticate(a),this},_renderImage:function(a,b){if(this._map){var c=new L.ImageOverlay(a,b,{opacity:0}).addTo(this._map);c.once("load",function(a){var c=a.target,d=this._currentImage;c._bounds.equals(b)?(this._currentImage=c,"front"===this.options.position?this.bringToFront():this.bringToBack(),this._map&&this._currentImage._map?this._currentImage.setOpacity(this.options.opacity):this._currentImage._map.removeLayer(this._currentImage),d&&this._map&&this._map.removeLayer(d),d&&d._map&&d._map.removeLayer(d)):this._map.removeLayer(c),this.fire("load",{bounds:b})},this),this.fire("loading",{bounds:b})}},_update:function(){if(this._map){var a=this._map.getZoom(),b=this._map.getBounds();if(!this._animatingZoom&&!(this._map._panTransition&&this._map._panTransition._inProgress||a>this.options.maxZoom||athis.options.maxZoom||athis.options.maxZoom||bc;c++)this._addCell(e[c])},_cellCoordsToBounds:function(a){var b=this._map,c=this.options.cellSize,d=a.multiplyBy(c),e=d.add([c,c]),f=b.unproject(d,a.z).wrap(),g=b.unproject(e,a.z).wrap();return new L.LatLngBounds(f,g)},_cellCoordsToKey:function(a){return a.x+":"+a.y},_keyToCellCoords:function(a){var b=a.split(":"),c=parseInt(b[0],10),d=parseInt(b[1],10);return new L.Point(c,d)},_removeOtherCells:function(a){for(var b in this._cells)a.contains(this._keyToCellCoords(b))||this._removeCell(b)},_removeCell:function(a){var b=this._activeCells[a];b&&(delete this._activeCells[a],this.cellLeave&&this.cellLeave(b.bounds,b.coords),this.fire("cellleave",{bounds:b.bounds,coords:b.coords}))},_removeCells:function(){for(var a in this._cells){var b=this._cells[a].bounds,c=this._cells[a].coords;this.cellLeave&&this.cellLeave(b,c),this.fire("cellleave",{bounds:b,coords:c})}},_addCell:function(a){this._wrapCoords(a);var b=this._cellCoordsToKey(a),c=this._cells[b];c&&!this._activeCells[b]&&(this.cellEnter&&this.cellEnter(c.bounds,a),this.fire("cellenter",{bounds:c.bounds,coords:a}),this._activeCells[b]=c),c||(c={coords:a,bounds:this._cellCoordsToBounds(a)},this._cells[b]=c,this._activeCells[b]=c,this.createCell&&this.createCell(c.bounds,a),this.fire("cellcreate",{bounds:c.bounds,coords:a}))},_wrapCoords:function(a){a.x=this._wrapLng?L.Util.wrapNum(a.x,this._wrapLng):a.x,a.y=this._wrapLat?L.Util.wrapNum(a.y,this._wrapLat):a.y}}),function(a){function b(a){this.values=a||[]}a.Layers.FeatureManager=a.Layers.FeatureGrid.extend({options:{where:"1=1",fields:["*"],from:!1,to:!1,timeField:!1,timeFilterMode:"server",simplifyFactor:0,precision:6},initialize:function(c,d){if(a.Layers.FeatureGrid.prototype.initialize.call(this,d),d=d||{},d.url=a.Util.cleanUrl(c),d=L.setOptions(this,d),this._service=new a.Services.FeatureLayer(d),"*"!==this.options.fields[0]){for(var e=!1,f=0;f=0;d--){var e=a[d].id;this._currentSnapshot.push(e),this._cache[c].push(e)}this.options.timeField&&this._buildTimeIndexes(a);var f=this._map.getZoom();f>this.options.maxZoom||f=0;j--)f.push(i.features[j].id);g--,0>=g&&(this._currentSnapshot=f,a.Util.requestAnimationFrame(L.Util.bind(function(){this.removeLayers(e),this.addLayers(f),c&&c.call(d,h)},this)))},this),j=this._currentSnapshot.length-1;j>=0;j--)e.push(this._currentSnapshot[j]);for(var k in this._activeCells){g++;var l=this._keyToCellCoords(k),m=this._cellCoordsToBounds(l);this._requestFeatures(m,k,i)}return this},getWhere:function(){return this.options.where},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(a,b,c,d){var e=this.options.from,f=this.options.to,g=0,h=null,i=L.Util.bind(function(i){i&&(h=i),this._filterExistingFeatures(e,f,a,b),g--,c&&0>=g&&c.call(d,h)},this);if(this.options.from=a,this.options.to=b,this._filterExistingFeatures(e,f,a,b),"server"===this.options.timeFilterMode)for(var j in this._activeCells){g++;var k=this._keyToCellCoords(j),l=this._cellCoordsToBounds(k);this._requestFeatures(l,j,i)}},refresh:function(){for(var a in this._activeCells){var b=this._keyToCellCoords(a),c=this._cellCoordsToBounds(b);this._requestFeatures(c,a)}},_filterExistingFeatures:function(b,c,d,e){var f=b&&c?this._getFeaturesInTimeRange(b,c):this._currentSnapshot,g=this._getFeaturesInTimeRange(d,e);if(g.indexOf)for(var h=0;h=0&&f.splice(i,1)}a.Util.requestAnimationFrame(L.Util.bind(function(){this.removeLayers(f),this.addLayers(g)},this))},_getFeaturesInTimeRange:function(a,b){var c,d=[];if(this.options.timeField.start&&this.options.timeField.end){var e=this._startTimeIndex.between(a,b),f=this._endTimeIndex.between(a,b);c=e.concat(f)}else c=this._timeIndex.between(a,b);for(var g=c.length-1;g>=0;g--)d.push(c[g].id);return d},_buildTimeIndexes:function(a){var b,c;if(this.options.timeField.start&&this.options.timeField.end){var d=[],e=[];for(b=a.length-1;b>=0;b--)c=a[b],d.push({id:c.id,value:new Date(c.properties[this.options.timeField.start])}),e.push({id:c.id,value:new Date(c.properties[this.options.timeField.end])});this._startTimeIndex.bulkAdd(d),this._endTimeIndex.bulkAdd(e)}else{var f=[];for(b=a.length-1;b>=0;b--)c=a[b],f.push({id:c.id,value:new Date(c.properties[this.options.timeField])});this._timeIndex.bulkAdd(f)}},_featureWithinTimeRange:function(a){if(!this.options.from||!this.options.to)return!0;var b=+this.options.from.valueOf(),c=+this.options.to.valueOf();if("string"==typeof this.options.timeField){var d=+a.properties[this.options.timeField];return d>=b&&c>=d}if(this.options.timeField.start&&this.options.timeField.end){var e=+a.properties[this.options.timeField.start],f=+a.properties[this.options.timeField.end];return e>=b&&c>=e||f>=b&&c>=f}},authenticate:function(a){return this._service.authenticate(a),this},metadata:function(a,b){return this._service.metadata(a,b),this},query:function(){return this._service.query()},addFeature:function(a,b,c){return this._service.addFeature(a,function(a,d){a||this.refresh(),b&&b.call(c,a,d)},this),this},updateFeature:function(a,b,c){return this._service.updateFeature(a,function(a,d){a||this.refresh(),b&&b.call(c,a,d)},this)},deleteFeature:function(a,b,c){return this._service.deleteFeature(a,function(a,d){!a&&d.objectId&&this.removeLayers([d.objectId],!0),b&&b.call(c,a,d)},this)}}),b.prototype._query=function(a){for(var b,c,d,e=0,f=this.values.length-1;f>=e;)if(d=b=(e+f)/2|0,c=this.values[Math.round(b)],+c.value<+a)e=b+1;else{if(!(+c.value>+a))return b;f=b-1}return~f},b.prototype.sort=function(){this.values.sort(function(a,b){return+b.value-+a.value}).reverse(),this.dirty=!1},b.prototype.between=function(a,b){this.dirty&&this.sort();var c=this._query(a),d=this._query(b);return 0===c&&0===d?[]:(c=Math.abs(c),d=0>d?Math.abs(d):d+1,this.values.slice(c,d))},b.prototype.bulkAdd=function(a){this.dirty=!0,this.values=this.values.concat(a)}}(EsriLeaflet),EsriLeaflet.Layers.FeatureLayer=EsriLeaflet.Layers.FeatureManager.extend({statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},options:{cacheLayers:!0},initialize:function(a,b){EsriLeaflet.Layers.FeatureManager.prototype.initialize.call(this,a,b),b=L.setOptions(this,b),this._layers={},this._leafletIds={},this._key="c"+(1e9*Math.random()).toString(36).replace(".","_")},onAdd:function(a){return a.on("zoomstart zoomend",function(a){this._zooming="zoomstart"===a.type},this),EsriLeaflet.Layers.FeatureManager.prototype.onAdd.call(this,a)},onRemove:function(a){for(var b in this._layers)a.removeLayer(this._layers[b]);return EsriLeaflet.Layers.FeatureManager.prototype.onRemove.call(this,a)},createNewLayer:function(a){return L.GeoJSON.geometryToLayer(a,this.options.pointToLayer,L.GeoJSON.coordsToLatLng,this.options)},createLayers:function(a){for(var b=a.length-1;b>=0;b--){var c,d=a[b],e=this._layers[d.id];if(e&&!this._map.hasLayer(e)&&this._map.addLayer(e),e&&e.setLatLngs){var f=this.createNewLayer(d);e.setLatLngs(f.getLatLngs())}e||(c=this.createNewLayer(d),c.feature=d,c.defaultOptions=c.options,c._leaflet_id=this._key+"_"+d.id,this._leafletIds[c._leaflet_id]=d.id,c.on(EsriLeaflet.Layers.FeatureLayer.EVENTS,this._propagateEvent,this),this._popup&&c.bindPopup&&c.bindPopup(this._popup(c.feature,c),this._popupOptions),this.options.onEachFeature&&this.options.onEachFeature(c.feature,c),this._layers[c.feature.id]=c,this.resetStyle(c.feature.id),this.fire("createfeature",{feature:c.feature}),(!this.options.timeField||this.options.timeField&&this._featureWithinTimeRange(d))&&this._map.addLayer(c))}},addLayers:function(a){for(var b=a.length-1;b>=0;b--){var c=this._layers[a[b]];c&&(this.fire("addfeature",{feature:c.feature}),this._map.addLayer(c))}},removeLayers:function(a,b){for(var c=a.length-1;c>=0;c--){var d=a[c],e=this._layers[d];e&&(this.fire("removefeature",{feature:e.feature,permanent:b}),this._map.removeLayer(e)),e&&b&&delete this._layers[d]}},cellEnter:function(a,b){this._zooming||EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){var a=this._cacheKey(b),c=this._cellCoordsToKey(b),d=this._cache[a];this._activeCells[c]&&d&&this.addLayers(d)},this))},cellLeave:function(a,b){this._zooming||EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){var a=this._cacheKey(b),c=this._cellCoordsToKey(b),d=this._cache[a],e=this._map.getBounds();if(!this._activeCells[c]&&d){for(var f=!0,g=0;g',a}}),EsriLeaflet.Controls.logo=function(a){return new L.esri.Controls.Logo(a)};
+//# sourceMappingURL=esri-leaflet.js.map
+
+ return EsriLeaflet;
+}));
\ No newline at end of file
diff --git a/dist/esri-leaflet.js.map b/dist/esri-leaflet.js.map
new file mode 100644
index 000000000..a0e40545a
--- /dev/null
+++ b/dist/esri-leaflet.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"esri-leaflet.js","sources":["../src/EsriLeaflet.js","../src/Util.js","../src/Request.js","../src/Services/Service.js","../src/Services/FeatureLayer.js","../src/Services/MapService.js","../src/Services/ImageService.js","../src/Tasks/Task.js","../src/Tasks/Query.js","../src/Tasks/Find.js","../src/Tasks/Identify.js","../src/Tasks/IdentifyImage.js","../src/Tasks/IdentifyFeatures.js","../src/Layers/BasemapLayer.js","../src/Layers/RasterLayer.js","../src/Layers/DynamicMapLayer.js","../src/Layers/ImageMapLayer.js","../src/Layers/TiledMapLayer.js","../src/Layers/FeatureLayer/FeatureGrid.js","../src/Layers/FeatureLayer/FeatureManager.js","../src/Layers/FeatureLayer/FeatureLayer.js","../src/Controls/Logo.js"],"names":["EsriLeaflet","VERSION","Layers","Services","Controls","Tasks","Util","Support","CORS","window","XMLHttpRequest","pointerEvents","document","documentElement","style","L","esri","clone","obj","target","i","hasOwnProperty","pointsEqual","a","b","length","closeRing","coordinates","push","ringIsClockwise","ringToTest","pt2","total","rLength","pt1","vertexIntersectsVertex","a1","a2","b1","b2","uaT","ubT","uB","ua","ub","arrayIntersectsArray","j","coordinatesContainPoint","point","contains","l","coordinatesContainCoordinates","outer","inner","intersects","convertRingsToGeoJSON","rings","x","outerRing","hole","outerRings","holes","r","ring","slice","polygon","uncontainedHoles","pop","contained","reverse","type","orientRings","poly","output","shift","flattenMultiPolygonRings","raf","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","msRequestAnimationFrame","cb","setTimeout","extentToBounds","extent","sw","LatLng","ymin","xmin","ne","ymax","xmax","LatLngBounds","boundsToExtent","bounds","latLngBounds","getSouthWest","lng","lat","getNorthEast","spatialReference","wkid","arcgisToGeojson","arcgis","idAttribute","geojson","y","points","paths","geometry","attributes","properties","id","OBJECTID","FID","geojsonToArcGIS","result","features","geometries","responseToFeatureCollection","response","objectIdField","objectIdFieldName","fields","name","featureCollection","results","cleanUrl","url","replace","isArcgisOnline","test","geojsonTypeToArcGIS","geoJsonType","arcgisGeometryType","bind","serialize","params","data","f","key","value","param","Object","prototype","toString","call","JSON","stringify","join","valueOf","encodeURIComponent","createRequest","callback","context","httpRequest","onerror","onreadystatechange","falseFn","error","code","message","readyState","parse","responseText","e","callbacks","_EsriLeafletCallbacks","Request","request","paramString","requestLength","open","send","setRequestHeader","get","JSONP","console","warn","post","XMLHTTP","callbackId","script","DomUtil","create","body","src","responseType","abort","_callback","Service","Class","extend","includes","Mixin","Events","options","proxy","useCors","initialize","this","_requestQueue","_authenticating","setOptions","path","_request","metadata","authenticate","token","_runQueue","method","fire","wrappedCallback","_createServiceCallback","apply","service","FeatureLayer","query","Query","addFeature","feature","addResults","undefined","updateFeature","updateResults","deleteFeature","objectIds","deleteResults","featureLayer","MapService","identify","identifyFeatures","find","Find","mapService","ImageService","IdentifyImage","imageService","Task","generateSetter","endpoint","_service","setters","setter","offset","limit","precision","featureIds","returnGeometry","where","outSr","outFields","within","_setGeometry","spatialRel","overlaps","nearby","latlng","radius","latLng","geometryType","units","distance","inSr","string","between","start","end","time","simplify","map","factor","mapWidth","Math","abs","getBounds","getWest","getEast","maxAllowableOffset","getSize","orderBy","fieldName","order","orderByFields","run","_cleanParams","count","returnCountOnly","ids","returnIdsOnly","returnExtentOnly","pixelSize","layer","getLatLng","GeoJSON","getLayers","toGeoJSON","text","sr","layers","dynamicLayers","returnZ","returnM","gdbVersion","layerDefs","Identify","setMosaicRule","setRenderingRule","setPixelSize","returnCatalogItems","at","getMosaicRule","mosaicRule","getRenderingRule","renderingRule","getPixelSize","_responseToGeoJSON","location","catalogItems","catalogItemVisibilities","geoJSON","pixel","crs","objectId","Values","values","catalogItemVisibility","identifyImage","IdentifyFeatures","tolerance","on","size","imageDisplay","mapExtent","layerDef","layerId","tileProtocol","protocol","BasemapLayer","TileLayer","statics","TILES","Streets","urlTemplate","attributionUrl","hideLogo","logoPosition","minZoom","maxZoom","subdomains","attribution","Topographic","Oceans","OceansLabels","NationalGeographic","DarkGray","DarkGrayLabels","Gray","GrayLabels","Imagery","ImageryLabels","ImageryTransportation","ShadedRelief","ShadedReliefLabels","Terrain","TerrainLabels","config","Error","tileOptions","_getAttributionData","_logo","Logo","position","onAdd","_hasEsriLogo","addTo","_updateMapAttribution","onRemove","_container","removeControl","off","getAttribution","attributions","_attributions","c","contributors","contributor","coverageAreas","coverageArea","southWest","bbox","northEast","score","zoomMin","zoomMax","sort","_map","attributionControl","newAttributions","zoom","getZoom","match","substr","attributionElement","querySelector","innerHTML","maxWidth","basemapLayer","RasterLayer","opacity","_update","limitExecByInterval","updateInterval","split","bboxSR","imageSR","_currentImage","_bounds","equals","addLayer","removeLayer","_popup","_getPopupData","_resetPopupState","bindPopup","fn","popupOptions","_shouldRenderPopup","_lastClick","popup","_popupFunction","unbindPopup","closePopup","removeFrom","bringToFront","bringToBack","getOpacity","setOpacity","getTimeRange","from","to","setTimeRange","_renderImage","image","ImageOverlay","once","newImage","oldImage","_animatingZoom","_panTransition","_inProgress","_buildExportParams","_requestExport","_renderPopup","content","setLatLng","setContent","openOn","_propagateEvent","DynamicMapLayer","timeOptions","format","transparent","setLayers","getLayerDefs","setLayerDefs","getTimeOptions","setTimeOptions","identifyRequest","project","_northEast","_southWest","dpi","href","getParamString","dynamicMapLayer","ImageMapLayer","setPixelType","pixelType","getPixelType","setBandIds","bandIds","isArray","getBandIds","setNoData","noData","noDataInterpretation","getNoData","getNoDataInterpretation","interpolation","compressionQuality","imageMapLayer","TiledMapLayer","tileUrl","tokenQs","tiledMapLayer","FeatureGrid","cellSize","addEventListener","getEvents","_reset","removeEventListener","_removeCells","events","viewreset","moveend","zoomend","_onZoom","hasLayer","_cells","_activeCells","_cellsToLoad","_cellsTotal","_resetWrap","infinite","_getCellSize","wrapLng","_wrapLng","floor","ceil","wrapLat","_wrapLat","getPixelBounds","cellPadding","topLeft","min","subtract","divideBy","max","cellBounds","add","_removeOtherCells","_addCells","coords","queue","center","getCenter","Point","z","cellsToLoad","distanceTo","_addCell","_cellCoordsToBounds","nwPoint","multiplyBy","sePoint","nw","unproject","wrap","se","_cellCoordsToKey","_keyToCellCoords","kArr","parseInt","_removeCell","cell","cellLeave","_wrapCoords","cellEnter","createCell","wrapNum","BinarySearchIndex","FeatureManager","timeField","timeFilterMode","simplifyFactor","oidCheck","_startTimeIndex","_endTimeIndex","_timeIndex","_cache","_currentSnapshot","_activeRequests","_pendingRequests","_requestFeatures","_buildQuery","exceededTransferLimit","_addFeatures","_cacheKey","_buildTimeIndexes","createLayers","setWhere","oldSnapshot","newShapshot","pendingRequests","requestError","requestCallback","removeLayers","addLayers","getWhere","oldFrom","oldTo","_filterExistingFeatures","refresh","newFrom","newTo","layersToRemove","_getFeaturesInTimeRange","layersToAdd","indexOf","shouldRemoveLayer","splice","search","startTimes","endTimes","concat","startTimeEntries","endTimeEntries","Date","bulkAdd","timeEntries","_featureWithinTimeRange","date","startDate","endDate","_query","currentIndex","currentElement","resultIndex","minIndex","maxIndex","round","dirty","startIndex","endIndex","items","EVENTS","cacheLayers","_layers","_leafletIds","_key","random","_zooming","createNewLayer","geometryToLayer","pointToLayer","coordsToLatLng","newLayer","setLatLngs","updateGeo","getLatLngs","defaultOptions","_leaflet_id","_popupOptions","onEachFeature","resetStyle","permanent","cacheKey","cellKey","mapBounds","removable","setFeatureStyle","setStyle","eachFeature","Path","fill","popupContent","groupLayers","gLayer","getFeature","Control","marginTop","marginLeft","marginBottom","marginRight","div","logo"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,GAAIA,cACFC,QAAS,aACTC,UACAC,YACAC,YACAC,SACAC,QACAC,SACEC,QAASC,OAAOC,gBAAkB,mBAAqB,IAAIA,iBAC3DC,cAAgE,KAAjDC,SAASC,gBAAgBC,MAAMH,eAI7B,oBAAXF,SAA0BA,OAAOM,IACzCN,OAAOM,EAAEC,KAAOhB,aCdlB,SAAUA,GAWR,QAASiB,GAAMC,GACb,GAAIC,KACJ,KAAK,GAAIC,KAAKF,GACRA,EAAIG,eAAeD,K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ERSION: '1.0.0-rc.5',\n Layers: {},\n Services: {},\n Controls: {},\n Tasks: {},\n Util: {},\n Support: {\n CORS: !!(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()),\n pointerEvents: document.documentElement.style.pointerEvents === ''\n }\n};\n\nif(typeof window !== 'undefined' && window.L){\n window.L.esri = EsriLeaflet;\n}\n","(function(EsriLeaflet){\n\n // normalize request animation frame\n var raf = window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function(cb) { return window.setTimeout(cb, 1000 / 60); };\n\n // shallow object clone for feature properties and attributes\n // from http://jsperf.com/cloning-an-object/2\n function clone(obj) {\n var target = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n target[i] = obj[i];\n }\n }\n return target;\n }\n\n // checks if 2 x,y points are equal\n function pointsEqual(a, b) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n }\n\n // checks if the first and last points of a ring are equal and closes the ring\n function closeRing(coordinates) {\n if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {\n coordinates.push(coordinates[0]);\n }\n return coordinates;\n }\n\n // determine if polygon ring coordinates are clockwise. clockwise signifies outer ring, counter-clockwise an inner ring\n // or hole. this logic was found at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-\n // points-are-in-clockwise-order\n function ringIsClockwise(ringToTest) {\n var total = 0,i = 0;\n var rLength = ringToTest.length;\n var pt1 = ringToTest[i];\n var pt2;\n for (i; i < rLength - 1; i++) {\n pt2 = ringToTest[i + 1];\n total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);\n pt1 = pt2;\n }\n return (total >= 0);\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L504-L519\n function vertexIntersectsVertex(a1, a2, b1, b2) {\n var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);\n var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);\n var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);\n\n if ( uB !== 0 ) {\n var ua = uaT / uB;\n var ub = ubT / uB;\n\n if ( 0 <= ua && ua <= 1 && 0 <= ub && ub <= 1 ) {\n return true;\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L521-L531\n function arrayIntersectsArray(a, b) {\n for (var i = 0; i < a.length - 1; i++) {\n for (var j = 0; j < b.length - 1; j++) {\n if (vertexIntersectsVertex(a[i], a[i + 1], b[j], b[j + 1])) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n // ported from terraformer.js https://github.com/Esri/Terraformer/blob/master/terraformer.js#L470-L480\n function coordinatesContainPoint(coordinates, point) {\n var contains = false;\n for(var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {\n if (((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||\n (coordinates[j][1] <= point[1] && point[1] < coordinates[i][1])) &&\n (point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0])) {\n contains = !contains;\n }\n }\n return contains;\n }\n\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L106-L113\n function coordinatesContainCoordinates(outer, inner){\n var intersects = arrayIntersectsArray(outer, inner);\n var contains = coordinatesContainPoint(outer, inner[0]);\n if(!intersects && contains){\n return true;\n }\n return false;\n }\n\n // do any polygons in this array contain any other polygons in this array?\n // used for checking for holes in arcgis rings\n // ported from terraformer-arcgis-parser.js https://github.com/Esri/terraformer-arcgis-parser/blob/master/terraformer-arcgis-parser.js#L117-L172\n function convertRingsToGeoJSON(rings){\n var outerRings = [];\n var holes = [];\n var x; // iterator\n var outerRing; // current outer ring being evaluated\n var hole; // current hole being evaluated\n\n // for each ring\n for (var r = 0; r < rings.length; r++) {\n var ring = closeRing(rings[r].slice(0));\n if(ring.length < 4){\n continue;\n }\n // is this ring an outer ring? is it clockwise?\n if(ringIsClockwise(ring)){\n var polygon = [ ring ];\n outerRings.push(polygon); // push to outer rings\n } else {\n holes.push(ring); // counterclockwise push to holes\n }\n }\n\n var uncontainedHoles = [];\n\n // while there are holes left...\n while(holes.length){\n // pop a hole off out stack\n hole = holes.pop();\n\n // loop over all outer rings and see if they contain our hole.\n var contained = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(coordinatesContainCoordinates(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n contained = true;\n break;\n }\n }\n\n // ring is not contained in any outer ring\n // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320\n if(!contained){\n uncontainedHoles.push(hole);\n }\n }\n\n // if we couldn't match any holes using contains we can try intersects...\n while(uncontainedHoles.length){\n // pop a hole off out stack\n hole = uncontainedHoles.pop();\n\n // loop over all outer rings and see if any intersect our hole.\n var intersects = false;\n for (x = outerRings.length - 1; x >= 0; x--) {\n outerRing = outerRings[x][0];\n if(arrayIntersectsArray(outerRing, hole)){\n // the hole is contained push it into our polygon\n outerRings[x].push(hole);\n intersects = true;\n break;\n }\n }\n\n if(!intersects) {\n outerRings.push([hole.reverse()]);\n }\n }\n\n if(outerRings.length === 1){\n return {\n type: 'Polygon',\n coordinates: outerRings[0]\n };\n } else {\n return {\n type: 'MultiPolygon',\n coordinates: outerRings\n };\n }\n }\n\n // This function ensures that rings are oriented in the right directions\n // outer rings are clockwise, holes are counterclockwise\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function orientRings(poly){\n var output = [];\n var polygon = poly.slice(0);\n var outerRing = closeRing(polygon.shift().slice(0));\n if(outerRing.length >= 4){\n if(!ringIsClockwise(outerRing)){\n outerRing.reverse();\n }\n\n output.push(outerRing);\n\n for (var i = 0; i < polygon.length; i++) {\n var hole = closeRing(polygon[i].slice(0));\n if(hole.length >= 4){\n if(ringIsClockwise(hole)){\n hole.reverse();\n }\n output.push(hole);\n }\n }\n }\n\n return output;\n }\n\n // This function flattens holes in multipolygons to one array of polygons\n // used for converting GeoJSON Polygons to ArcGIS Polygons\n function flattenMultiPolygonRings(rings){\n var output = [];\n for (var i = 0; i < rings.length; i++) {\n var polygon = orientRings(rings[i]);\n for (var x = polygon.length - 1; x >= 0; x--) {\n var ring = polygon[x].slice(0);\n output.push(ring);\n }\n }\n return output;\n }\n\n // convert an extent (ArcGIS) to LatLngBounds (Leaflet)\n EsriLeaflet.Util.extentToBounds = function(extent){\n var sw = new L.LatLng(extent.ymin, extent.xmin);\n var ne = new L.LatLng(extent.ymax, extent.xmax);\n return new L.LatLngBounds(sw, ne);\n };\n\n // convert an LatLngBounds (Leaflet) to extent (ArcGIS)\n EsriLeaflet.Util.boundsToExtent = function(bounds) {\n bounds = L.latLngBounds(bounds);\n return {\n 'xmin': bounds.getSouthWest().lng,\n 'ymin': bounds.getSouthWest().lat,\n 'xmax': bounds.getNorthEast().lng,\n 'ymax': bounds.getNorthEast().lat,\n 'spatialReference': {\n 'wkid' : 4326\n }\n };\n };\n\n EsriLeaflet.Util.arcgisToGeojson = function (arcgis, idAttribute){\n var geojson = {};\n\n if(typeof arcgis.x === 'number' && typeof arcgis.y === 'number'){\n geojson.type = 'Point';\n geojson.coordinates = [arcgis.x, arcgis.y];\n }\n\n if(arcgis.points){\n geojson.type = 'MultiPoint';\n geojson.coordinates = arcgis.points.slice(0);\n }\n\n if(arcgis.paths) {\n if(arcgis.paths.length === 1){\n geojson.type = 'LineString';\n geojson.coordinates = arcgis.paths[0].slice(0);\n } else {\n geojson.type = 'MultiLineString';\n geojson.coordinates = arcgis.paths.slice(0);\n }\n }\n\n if(arcgis.rings) {\n geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));\n }\n\n if(arcgis.geometry || arcgis.attributes) {\n geojson.type = 'Feature';\n geojson.geometry = (arcgis.geometry) ? EsriLeaflet.Util.arcgisToGeojson(arcgis.geometry) : null;\n geojson.properties = (arcgis.attributes) ? clone(arcgis.attributes) : null;\n if(arcgis.attributes) {\n geojson.id = arcgis.attributes[idAttribute] || arcgis.attributes.OBJECTID || arcgis.attributes.FID;\n }\n }\n\n return geojson;\n };\n\n // GeoJSON -> ArcGIS\n EsriLeaflet.Util.geojsonToArcGIS = function(geojson, idAttribute){\n idAttribute = idAttribute || 'OBJECTID';\n var spatialReference = { wkid: 4326 };\n var result = {};\n var i;\n\n switch(geojson.type){\n case 'Point':\n result.x = geojson.coordinates[0];\n result.y = geojson.coordinates[1];\n result.spatialReference = spatialReference;\n break;\n case 'MultiPoint':\n result.points = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'LineString':\n result.paths = [geojson.coordinates.slice(0)];\n result.spatialReference = spatialReference;\n break;\n case 'MultiLineString':\n result.paths = geojson.coordinates.slice(0);\n result.spatialReference = spatialReference;\n break;\n case 'Polygon':\n result.rings = orientRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'MultiPolygon':\n result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));\n result.spatialReference = spatialReference;\n break;\n case 'Feature':\n if(geojson.geometry) {\n result.geometry = EsriLeaflet.Util.geojsonToArcGIS(geojson.geometry, idAttribute);\n }\n result.attributes = (geojson.properties) ? clone(geojson.properties) : {};\n if(geojson.id){\n result.attributes[idAttribute] = geojson.id;\n }\n break;\n case 'FeatureCollection':\n result = [];\n for (i = 0; i < geojson.features.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.features[i], idAttribute));\n }\n break;\n case 'GeometryCollection':\n result = [];\n for (i = 0; i < geojson.geometries.length; i++){\n result.push(EsriLeaflet.Util.geojsonToArcGIS(geojson.geometries[i], idAttribute));\n }\n break;\n }\n\n return result;\n };\n\n EsriLeaflet.Util.responseToFeatureCollection = function(response, idAttribute){\n var objectIdField;\n\n if(idAttribute){\n objectIdField = idAttribute;\n } else if(response.objectIdFieldName){\n objectIdField = response.objectIdFieldName;\n } else if(response.fields) {\n for (var j = 0; j <= response.fields.length - 1; j++) {\n if(response.fields[j].type === 'esriFieldTypeOID') {\n objectIdField = response.fields[j].name;\n break;\n }\n }\n } else {\n objectIdField = 'OBJECTID';\n }\n\n var featureCollection = {\n type: 'FeatureCollection',\n features: []\n };\n var features = response.features || response.results;\n if(features.length){\n for (var i = features.length - 1; i >= 0; i--) {\n featureCollection.features.push(EsriLeaflet.Util.arcgisToGeojson(features[i], objectIdField));\n }\n }\n\n return featureCollection;\n };\n\n // trim whitespace and add a tailing slash is needed to a url\n EsriLeaflet.Util.cleanUrl = function(url){\n url = url.replace(/\\s\\s*/g, '');\n\n //add a trailing slash to the url if the user omitted it\n if(url[url.length-1] !== '/'){\n url += '/';\n }\n\n return url;\n };\n\n EsriLeaflet.Util.isArcgisOnline = function(url){\n return (/\\.arcgis\\.com/g).test(url);\n };\n\n EsriLeaflet.Util.geojsonTypeToArcGIS = function (geoJsonType) {\n var arcgisGeometryType;\n switch (geoJsonType) {\n case 'Point':\n arcgisGeometryType = 'esriGeometryPoint';\n break;\n case 'MultiPoint':\n arcgisGeometryType = 'esriGeometryMultipoint';\n break;\n case 'LineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'MultiLineString':\n arcgisGeometryType = 'esriGeometryPolyline';\n break;\n case 'Polygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n case 'MultiPolygon':\n arcgisGeometryType = 'esriGeometryPolygon';\n break;\n }\n return arcgisGeometryType;\n };\n\n EsriLeaflet.Util.requestAnimationFrame = L.Util.bind(raf, window);\n\n})(EsriLeaflet);","(function(EsriLeaflet){\n\n var callbacks = 0;\n\n window._EsriLeafletCallbacks = {};\n\n function serialize(params){\n var data = '';\n\n params.f = params.f || 'json';\n\n for (var key in params){\n if(params.hasOwnProperty(key)){\n var param = params[key];\n var type = Object.prototype.toString.call(param);\n var value;\n\n if(data.length){\n data += '&';\n }\n\n if (type === '[object Array]'){\n value = (Object.prototype.toString.call(param[0]) === '[object Object]') ? JSON.stringify(param) : param.join(',');\n } else if (type === '[object Object]') {\n value = JSON.stringify(param);\n } else if (type === '[object Date]'){\n value = param.valueOf();\n } else {\n value = param;\n }\n\n data += encodeURIComponent(key) + '=' + encodeURIComponent(value);\n }\n }\n\n return data;\n }\n\n function createRequest(callback, context){\n var httpRequest = new XMLHttpRequest();\n\n httpRequest.onerror = function(e) {\n httpRequest.onreadystatechange = L.Util.falseFn;\n\n callback.call(context, {\n error: {\n code: 500,\n message: 'XMLHttpRequest error'\n }\n }, null);\n };\n\n httpRequest.onreadystatechange = function(){\n var response;\n var error;\n\n if (httpRequest.readyState === 4) {\n try {\n response = JSON.parse(httpRequest.responseText);\n } catch(e) {\n response = null;\n error = {\n code: 500,\n message: 'Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error.'\n };\n }\n\n if (!error && response.error) {\n error = response.error;\n response = null;\n }\n\n httpRequest.onerror = L.Util.falseFn;\n\n callback.call(context, error, response);\n }\n };\n\n return httpRequest;\n }\n\n // AJAX handlers for CORS (modern browsers) or JSONP (older browsers)\n EsriLeaflet.Request = {\n request: function(url, params, callback, context){\n var paramString = serialize(params);\n var httpRequest = createRequest(callback, context);\n var requestLength = (url + '?' + paramString).length;\n\n // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest\n if(requestLength <= 2000 && L.esri.Support.CORS){\n httpRequest.open('GET', url + '?' + paramString);\n httpRequest.send(null);\n\n // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest\n } else if (requestLength > 2000 && L.esri.Support.CORS){\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(paramString);\n\n // request is less more then 2000 characters and the browser does not support CORS, make a JSONP request\n } else if(requestLength <= 2000 && !L.esri.Support.CORS){\n return L.esri.Request.get.JSONP(url, params, callback, context);\n\n // request is longer then 2000 characters and the browser does not support CORS, log a warning\n } else {\n if(console && console.warn){\n console.warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');\n return;\n }\n }\n\n return httpRequest;\n },\n post: {\n XMLHTTP: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(serialize(params));\n\n return httpRequest;\n }\n },\n\n get: {\n CORS: function (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n\n httpRequest.open('GET', url + '?' + serialize(params), true);\n httpRequest.send(null);\n\n return httpRequest;\n },\n JSONP: function(url, params, callback, context){\n var callbackId = 'c' + callbacks;\n\n params.callback = 'window._EsriLeafletCallbacks.' + callbackId;\n\n var script = L.DomUtil.create('script', null, document.body);\n script.type = 'text/javascript';\n script.src = url + '?' + serialize(params);\n script.id = callbackId;\n\n window._EsriLeafletCallbacks[callbackId] = function(response){\n if(window._EsriLeafletCallbacks[callbackId] !== true){\n var error;\n var responseType = Object.prototype.toString.call(response);\n\n if(!(responseType === '[object Object]' || responseType === '[object Array]')){\n error = {\n error: {\n code: 500,\n message: 'Expected array or object as JSONP response'\n }\n };\n response = null;\n }\n\n if (!error && response.error) {\n error = response;\n response = null;\n }\n\n callback.call(context, error, response);\n window._EsriLeafletCallbacks[callbackId] = true;\n }\n };\n\n callbacks++;\n\n return {\n id: callbackId,\n url: script.src,\n abort: function(){\n window._EsriLeafletCallbacks._callback[callbackId]({\n code: 0,\n message: 'Request aborted.'\n });\n }\n };\n }\n }\n };\n\n // choose the correct AJAX handler depending on CORS support\n EsriLeaflet.get = (EsriLeaflet.Support.CORS) ? EsriLeaflet.Request.get.CORS : EsriLeaflet.Request.get.JSONP;\n\n // always use XMLHttpRequest for posts\n EsriLeaflet.post = EsriLeaflet.Request.post.XMLHTTP;\n\n // expose a common request method the uses GET\\POST based on request length\n EsriLeaflet.request = EsriLeaflet.Request.request;\n\n})(EsriLeaflet);","EsriLeaflet.Services.Service = L.Class.extend({\n\n includes: L.Mixin.Events,\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n initialize: function (options) {\n options = options || {};\n this._requestQueue = [];\n this._authenticating = false;\n L.Util.setOptions(this, options);\n this.options.url = EsriLeaflet.Util.cleanUrl(this.options.url);\n },\n\n get: function (path, params, callback, context) {\n return this._request('get', path, params, callback, context);\n },\n\n post: function (path, params, callback, context) {\n return this._request('post', path, params, callback, context);\n },\n\n request: function (path, params, callback, context) {\n return this._request('request', path, params, callback, context);\n },\n\n metadata: function (callback, context) {\n return this._request('get', '', {}, callback, context);\n },\n\n authenticate: function(token){\n this._authenticating = false;\n this.options.token = token;\n this._runQueue();\n return this;\n },\n\n _request: function(method, path, params, callback, context){\n this.fire('requeststart', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n\n var wrappedCallback = this._createServiceCallback(method, path, params, callback, context);\n\n if (this.options.token) {\n params.token = this.options.token;\n }\n\n if (this._authenticating) {\n this._requestQueue.push([method, path, params, callback, context]);\n return;\n } else {\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, wrappedCallback);\n } else {\n return EsriLeaflet[method](url, params, wrappedCallback);\n }\n }\n },\n\n _createServiceCallback: function(method, path, params, callback, context){\n var request = [method, path, params, callback, context];\n\n return L.Util.bind(function(error, response){\n\n if (error && (error.code === 499 || error.code === 498)) {\n this._authenticating = true;\n\n this._requestQueue.push(request);\n\n this.fire('authenticationrequired', {\n authenticate: L.Util.bind(this.authenticate, this)\n });\n } else {\n callback.call(context, error, response);\n\n if(error) {\n this.fire('requesterror', {\n url: this.options.url + path,\n params: params,\n message: error.message,\n code: error.code,\n method: method\n });\n } else {\n this.fire('requestsuccess', {\n url: this.options.url + path,\n params: params,\n response: response,\n method: method\n });\n }\n\n this.fire('requestend', {\n url: this.options.url + path,\n params: params,\n method: method\n });\n }\n }, this);\n },\n\n _runQueue: function(){\n for (var i = this._requestQueue.length - 1; i >= 0; i--) {\n var request = this._requestQueue[i];\n var method = request.shift();\n this[method].apply(this, request);\n }\n this._requestQueue = [];\n }\n\n});\n\nEsriLeaflet.Services.service = function(params){\n return new EsriLeaflet.Services.Service(params);\n};","EsriLeaflet.Services.FeatureLayer = EsriLeaflet.Services.Service.extend({\n\n options: {\n idAttribute: 'OBJECTID'\n },\n\n query: function(){\n return new EsriLeaflet.Tasks.Query(this);\n },\n\n addFeature: function(feature, callback, context) {\n delete feature.id;\n\n feature = EsriLeaflet.Util.geojsonToArcGIS(feature);\n\n return this.post('addFeatures', {\n features: [feature]\n }, function(error, response){\n var result = (response && response.addResults) ? response.addResults[0] : undefined;\n if(callback){\n callback.call(this, error || response.addResults[0].error, result);\n }\n }, context);\n },\n\n updateFeature: function(feature, callback, context) {\n feature = EsriLeaflet.Util.geojsonToArcGIS(feature, this.options.idAttribute);\n\n return this.post('updateFeatures', {\n features: [feature]\n }, function(error, response){\n var result = (response && response.updateResults) ? response.updateResults[0] : undefined;\n if(callback){\n callback.call(context, error || response.updateResults[0].error, result);\n }\n }, context);\n },\n\n deleteFeature: function(id, callback, context) {\n return this.post('deleteFeatures', {\n objectIds: id\n }, function(error, response){\n var result = (response && response.deleteResults) ? response.deleteResults[0] : undefined;\n if(callback){\n callback.call(context, error || response.deleteResults[0].error, result);\n }\n }, context);\n }\n\n});\n\nEsriLeaflet.Services.featureLayer = function(options) {\n return new EsriLeaflet.Services.FeatureLayer(options);\n};","EsriLeaflet.Services.MapService = EsriLeaflet.Services.Service.extend({\n\n identify: function () {\n return new EsriLeaflet.Tasks.identifyFeatures(this);\n },\n\n find: function () {\n return new EsriLeaflet.Tasks.Find(this);\n },\n\n query: function () {\n return new EsriLeaflet.Tasks.Query(this);\n }\n\n});\n\nEsriLeaflet.Services.mapService = function(params){\n return new EsriLeaflet.Services.MapService(params);\n};","EsriLeaflet.Services.ImageService = EsriLeaflet.Services.Service.extend({\n\n query: function () {\n return new EsriLeaflet.Tasks.Query(this);\n },\n\n identify: function() {\n return new EsriLeaflet.Tasks.IdentifyImage(this);\n }\n});\n\nEsriLeaflet.Services.imageService = function(params){\n return new EsriLeaflet.Services.ImageService(params);\n};","EsriLeaflet.Tasks.Task = L.Class.extend({\n\n options: {\n proxy: false,\n useCors: EsriLeaflet.Support.CORS\n },\n\n //Generate a method for each methodName:paramName in the setters for this task.\n generateSetter: function(param, context){\n return L.Util.bind(function(value){\n this.params[param] = value;\n return this;\n }, context);\n },\n\n initialize: function(endpoint){\n // endpoint can be either a url (and options) for an ArcGIS Rest Service or an instance of EsriLeaflet.Service\n if(endpoint.request && endpoint.options){\n this._service = endpoint;\n L.Util.setOptions(this, endpoint.options);\n } else {\n L.Util.setOptions(this, endpoint);\n this.options.url = L.esri.Util.cleanUrl(endpoint.url);\n }\n\n // clone default params into this object\n this.params = L.Util.extend({}, this.params || {});\n\n // generate setter methods based on the setters object implimented a child class\n if(this.setters){\n for (var setter in this.setters){\n var param = this.setters[setter];\n this[setter] = this.generateSetter(param, this);\n }\n }\n },\n\n token: function(token){\n if(this._service){\n this._service.authenticate(token);\n } else {\n this.params.token = token;\n }\n return this;\n },\n\n request: function(callback, context){\n if(this._service){\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n },\n\n _request: function(method, path, params, callback, context){\n var url = (this.options.proxy) ? this.options.proxy + '?' + this.options.url + path : this.options.url + path;\n if((method === 'get' || method === 'request') && !this.options.useCors){\n return EsriLeaflet.Request.get.JSONP(url, params, callback, context);\n } else{\n return EsriLeaflet[method](url, params, callback, context);\n }\n }\n});","EsriLeaflet.Tasks.Query = EsriLeaflet.Tasks.Task.extend({\n setters: {\n 'offset': 'offset',\n 'limit': 'limit',\n 'fields': 'outFields',\n 'precision': 'geometryPrecision',\n 'featureIds': 'objectIds',\n 'returnGeometry': 'returnGeometry',\n 'token': 'token'\n },\n\n path: 'query',\n\n params: {\n returnGeometry: true,\n where: '1=1',\n outSr: 4326,\n outFields: '*'\n },\n\n within: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelContains'; // will make code read layer within geometry, to the api this will reads geometry contains layer\n return this;\n },\n\n intersects: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelIntersects';\n return this;\n },\n\n contains: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelWithin'; // will make code read layer contains geometry, to the api this will reads geometry within layer\n return this;\n },\n\n // crosses: function(geometry){\n // this._setGeometry(geometry);\n // this.params.spatialRel = 'esriSpatialRelCrosses';\n // return this;\n // },\n\n // touches: function(geometry){\n // this._setGeometry(geometry);\n // this.params.spatialRel = 'esriSpatialRelTouches';\n // return this;\n // },\n\n overlaps: function(geometry){\n this._setGeometry(geometry);\n this.params.spatialRel = 'esriSpatialRelOverlaps';\n return this;\n },\n\n // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online\n nearby: function(latlng, radius){\n latlng = L.latLng(latlng);\n this.params.geometry = [latlng.lng, latlng.lat];\n this.params.geometryType = 'esriGeometryPoint';\n this.params.spatialRel = 'esriSpatialRelIntersects';\n this.params.units = 'esriSRUnit_Meter';\n this.params.distance = radius;\n this.params.inSr = 4326;\n return this;\n },\n\n where: function(string){\n this.params.where = string.replace(/\"/g, \"\\'\"); // jshint ignore:line\n return this;\n },\n\n between: function(start, end){\n this.params.time = [start.valueOf(), end.valueOf()];\n return this;\n },\n\n simplify: function(map, factor){\n var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());\n this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;\n return this;\n },\n\n orderBy: function(fieldName, order){\n order = order || 'ASC';\n this.params.orderByFields = (this.params.orderByFields) ? this.params.orderByFields + ',' : '';\n this.params.orderByFields += ([fieldName, order]).join(' ');\n return this;\n },\n\n run: function(callback, context){\n this._cleanParams();\n\n // if the service is hosted on arcgis online request geojson directly\n if(EsriLeaflet.Util.isArcgisOnline(this.options.url)){\n this.params.f = 'geojson';\n\n return this.request(function(error, response){\n callback.call(context, error, response, response);\n }, context);\n\n // otherwise convert it in the callback then pass it on\n } else {\n return this.request(function(error, response){\n callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);\n }, context);\n }\n },\n\n count: function(callback, context){\n this._cleanParams();\n this.params.returnCountOnly = true;\n return this.request(function(error, response){\n callback.call(this, error, (response && response.count), response);\n }, context);\n },\n\n ids: function(callback, context){\n this._cleanParams();\n this.params.returnIdsOnly = true;\n return this.request(function(error, response){\n callback.call(this, error, (response && response.objectIds), response);\n }, context);\n },\n\n // only valid for Feature Services running on ArcGIS Server 10.3 or ArcGIS Online\n bounds: function(callback, context){\n this._cleanParams();\n this.params.returnExtentOnly = true;\n return this.request(function(error, response){\n callback.call(context, error, (response && response.extent && EsriLeaflet.Util.extentToBounds(response.extent)), response);\n }, context);\n },\n\n // only valid for image services\n pixelSize: function(point){\n point = L.point(point);\n this.params.pixelSize = [point.x,point.y];\n return this;\n },\n\n // only valid for map services\n layer: function(layer){\n this.path = layer + '/query';\n return this;\n },\n\n _cleanParams: function(){\n delete this.params.returnIdsOnly;\n delete this.params.returnExtentOnly;\n delete this.params.returnCountOnly;\n },\n\n _setGeometry: function(geometry) {\n this.params.inSr = 4326;\n\n // convert bounds to extent and finish\n if ( geometry instanceof L.LatLngBounds ) {\n // set geometry + geometryType\n this.params.geometry = EsriLeaflet.Util.boundsToExtent(geometry);\n this.params.geometryType = 'esriGeometryEnvelope';\n return;\n }\n\n // convert L.Marker > L.LatLng\n if(geometry.getLatLng){\n geometry = geometry.getLatLng();\n }\n\n // convert L.LatLng to a geojson point and continue;\n if (geometry instanceof L.LatLng) {\n geometry = {\n type: 'Point',\n coordinates: [geometry.lng, geometry.lat]\n };\n }\n\n // handle L.GeoJSON, pull out the first geometry\n if ( geometry instanceof L.GeoJSON ) {\n //reassign geometry to the GeoJSON value (we are assuming that only one feature is present)\n geometry = geometry.getLayers()[0].feature.geometry;\n this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);\n this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);\n }\n\n // Handle L.Polyline and L.Polygon\n if (geometry.toGeoJSON) {\n geometry = geometry.toGeoJSON();\n }\n\n // handle GeoJSON feature by pulling out the geometry\n if ( geometry.type === 'Feature' ) {\n // get the geometry of the geojson feature\n geometry = geometry.geometry;\n }\n\n // confirm that our GeoJSON is a point, line or polygon\n if ( geometry.type === 'Point' || geometry.type === 'LineString' || geometry.type === 'Polygon') {\n this.params.geometry = EsriLeaflet.Util.geojsonToArcGIS(geometry);\n this.params.geometryType = EsriLeaflet.Util.geojsonTypeToArcGIS(geometry.type);\n return;\n }\n\n // warn the user if we havn't found a\n /* global console */\n if(console && console.warn) {\n console.warn('invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object');\n }\n\n return;\n }\n});\n\nEsriLeaflet.Tasks.query = function(params){\n return new EsriLeaflet.Tasks.Query(params);\n};","EsriLeaflet.Tasks.Find = EsriLeaflet.Tasks.Task.extend({\n setters: {\n // method name > param name\n 'contains': 'contains',\n 'text': 'searchText',\n 'fields': 'searchFields', // denote an array or single string\n 'spatialReference': 'sr',\n 'sr': 'sr',\n 'layers': 'layers',\n 'returnGeometry': 'returnGeometry',\n 'maxAllowableOffset': 'maxAllowableOffset',\n 'precision': 'geometryPrecision',\n 'dynamicLayers': 'dynamicLayers',\n 'returnZ' : 'returnZ',\n 'returnM' : 'returnM',\n 'gdbVersion' : 'gdbVersion',\n 'token' : 'token'\n },\n\n path: 'find',\n\n params: {\n sr: 4326,\n contains: true,\n returnGeometry: true,\n returnZ: true,\n returnM: false\n },\n\n layerDefs: function (id, where) {\n this.params.layerDefs = (this.params.layerDefs) ? this.params.layerDefs + ';' : '';\n this.params.layerDefs += ([id, where]).join(':');\n return this;\n },\n\n simplify: function(map, factor){\n var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());\n this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;\n return this;\n },\n\n run: function (callback, context) {\n return this.request(function(error, response){\n callback.call(context, error, (response && EsriLeaflet.Util.responseToFeatureCollection(response)), response);\n }, context);\n }\n});\n\nEsriLeaflet.Tasks.find = function (params) {\n return new EsriLeaflet.Tasks.Find(params);\n};","EsriLeaflet.Tasks.Identify = EsriLeaflet.Tasks.Task.extend({\n path: 'identify',\n\n between: function(start, end){\n this.params.time = [start.valueOf(), end.valueOf()];\n return this;\n }\n});\n","EsriLeaflet.Tasks.IdentifyImage = EsriLeaflet.Tasks.Identify.extend({\n setters: {\n 'setMosaicRule': 'mosaicRule',\n 'setRenderingRule': 'renderingRule',\n 'setPixelSize': 'pixelSize',\n 'returnCatalogItems': 'returnCatalogItems',\n 'returnGeometry': 'returnGeometry'\n },\n\n params: {\n returnGeometry: false\n },\n\n at: function(latlng){\n latlng = L.latLng(latlng);\n this.params.geometry = JSON.stringify({\n x: latlng.lng,\n y: latlng.lat,\n spatialReference:{\n wkid: 4326\n }\n });\n this.params.geometryType = 'esriGeometryPoint';\n return this;\n },\n\n getMosaicRule: function() {\n return this.params.mosaicRule;\n },\n\n getRenderingRule: function() {\n return this.params.renderingRule;\n },\n\n getPixelSize: function() {\n return this.params.pixelSize;\n },\n\n run: function (callback, context){\n return this.request(function(error, response){\n callback.call(context, error, (response && this._responseToGeoJSON(response)), response);\n }, this);\n },\n\n // get pixel data and return as geoJSON point\n // populate catalog items (if any)\n // merging in any catalogItemVisibilities as a propery of each feature\n _responseToGeoJSON: function(response) {\n var location = response.location;\n var catalogItems = response.catalogItems;\n var catalogItemVisibilities = response.catalogItemVisibilities;\n var geoJSON = {\n 'pixel': {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': [location.x, location.y]\n },\n 'crs': {\n 'type': 'EPSG',\n 'properties': {\n 'code': location.spatialReference.wkid\n }\n },\n 'properties': {\n 'OBJECTID': response.objectId,\n 'name': response.name,\n 'value': response.value\n },\n 'id': response.objectId\n }\n };\n if (response.properties && response.properties.Values) {\n geoJSON.pixel.properties.values = response.properties.Values;\n }\n if (catalogItems && catalogItems.features) {\n geoJSON.catalogItems = EsriLeaflet.Util.responseToFeatureCollection(catalogItems);\n if (catalogItemVisibilities && catalogItemVisibilities.length === geoJSON.catalogItems.features.length) {\n for (var i = catalogItemVisibilities.length - 1; i >= 0; i--) {\n geoJSON.catalogItems.features[i].properties.catalogItemVisibility = catalogItemVisibilities[i];\n }\n }\n }\n return geoJSON;\n }\n\n});\n\nEsriLeaflet.Tasks.identifyImage = function(params){\n return new EsriLeaflet.Tasks.IdentifyImage(params);\n};","EsriLeaflet.Tasks.IdentifyFeatures = EsriLeaflet.Tasks.Identify.extend({\n setters: {\n 'layers': 'layers',\n 'precision': 'geometryPrecision',\n 'tolerance': 'tolerance',\n 'returnGeometry': 'returnGeometry'\n },\n\n params: {\n sr: 4326,\n layers: 'all',\n tolerance: 3,\n returnGeometry: true\n },\n\n on: function(map){\n var extent = EsriLeaflet.Util.boundsToExtent(map.getBounds());\n var size = map.getSize();\n this.params.imageDisplay = [size.x, size.y, 96];\n this.params.mapExtent = [extent.xmin, extent.ymin, extent.xmax, extent.ymax];\n return this;\n },\n\n at: function(latlng){\n latlng = L.latLng(latlng);\n this.params.geometry = [latlng.lng, latlng.lat];\n this.params.geometryType = 'esriGeometryPoint';\n return this;\n },\n\n layerDef: function (id, where){\n this.params.layerDefs = (this.params.layerDefs) ? this.params.layerDefs + ';' : '';\n this.params.layerDefs += ([id, where]).join(':');\n return this;\n },\n\n simplify: function(map, factor){\n var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());\n this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * (1 - factor);\n return this;\n },\n\n run: function (callback, context){\n return this.request(function(error, response){\n var featureCollection = EsriLeaflet.Util.responseToFeatureCollection(response);\n var count = featureCollection.features.length;\n // tag each feature with the Id of its parent layer\n if(!error && count > 0){\n response.results = response.results.reverse();\n for (var i = 0; i < count; i++) {\n var feature = featureCollection.features[i];\n feature.layerId = response.results[i].layerId;\n }\n }\n callback.call(context, error, (response && featureCollection), response);\n }, context);\n }\n\n});\n\nEsriLeaflet.Tasks.identifyFeatures = function(params){\n return new EsriLeaflet.Tasks.IdentifyFeatures(params);\n};","(function(EsriLeaflet){\n\n var tileProtocol = (window.location.protocol !== 'https:') ? 'http:' : 'https:';\n\n EsriLeaflet.Layers.BasemapLayer = L.TileLayer.extend({\n statics: {\n TILES: {\n Streets: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',\n attributionUrl: 'https://static.arcgis.com/attribution/World_Street_Map',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n attribution: 'Esri'\n }\n },\n Topographic: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}',\n attributionUrl: 'https://static.arcgis.com/attribution/World_Topo_Map',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n attribution: 'Esri'\n }\n },\n Oceans: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}',\n attributionUrl: 'https://static.arcgis.com/attribution/Ocean_Basemap',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'Esri'\n }\n },\n OceansLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services']\n }\n },\n NationalGeographic: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'Esri'\n }\n },\n DarkGray: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'Esri, DeLorme, HERE'\n }\n },\n DarkGrayLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services']\n }\n },\n Gray: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'Esri, NAVTEQ, DeLorme'\n }\n },\n GrayLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services']\n }\n },\n Imagery: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n attribution: 'Esri, DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community'\n }\n },\n ImageryLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services']\n }\n },\n ImageryTransportation: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}',\n //pane: 'esri-label',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services']\n }\n },\n ShadedRelief: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 13,\n subdomains: ['server', 'services'],\n attribution: 'ESRI, NAVTEQ, DeLorme'\n }\n },\n ShadedReliefLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 12,\n subdomains: ['server', 'services']\n }\n },\n Terrain: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: false,\n logoPosition: 'bottomright',\n minZoom: 1,\n maxZoom: 13,\n subdomains: ['server', 'services'],\n attribution: 'Esri, USGS, NOAA'\n }\n },\n TerrainLabels: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}',\n options: {\n hideLogo: true,\n logoPosition: 'bottomright',\n //pane: 'esri-label',\n minZoom: 1,\n maxZoom: 13,\n subdomains: ['server', 'services']\n }\n }\n }\n },\n initialize: function(key, options){\n var config;\n\n // set the config variable with the appropriate config object\n if (typeof key === 'object' && key.urlTemplate && key.options){\n config = key;\n } else if(typeof key === 'string' && EsriLeaflet.BasemapLayer.TILES[key]){\n config = EsriLeaflet.BasemapLayer.TILES[key];\n } else {\n throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of \"Streets\", \"Topographic\", \"Oceans\", \"OceansLabels\", \"NationalGeographic\", \"Gray\", \"GrayLabels\", \"DarkGray\", \"DarkGrayLabels\", \"Imagery\", \"ImageryLabels\", \"ImageryTransportation\", \"ShadedRelief\", \"ShadedReliefLabels\", \"Terrain\" or \"TerrainLabels\"');\n }\n\n // merge passed options into the config options\n var tileOptions = L.Util.extend(config.options, options);\n\n // call the initialize method on L.TileLayer to set everything up\n L.TileLayer.prototype.initialize.call(this, config.urlTemplate, L.Util.setOptions(this, tileOptions));\n\n // if this basemap requires dynamic attribution set it up\n if(config.attributionUrl){\n this._getAttributionData(config.attributionUrl);\n }\n this._logo = new EsriLeaflet.Controls.Logo({\n position: this.options.logoPosition\n });\n },\n onAdd: function(map){\n if(!this.options.hideLogo && !map._hasEsriLogo){\n this._logo.addTo(map);\n map._hasEsriLogo = true;\n }\n\n // if(this.options.pane && EsriLeaflet.Support.pointerEvents){\n // this._initPane();\n // }\n\n L.TileLayer.prototype.onAdd.call(this, map);\n\n map.on('moveend', this._updateMapAttribution, this);\n },\n onRemove: function(map){\n // check to make sure the logo hasn't already been removed\n if(this._logo && this._logo._container){\n map.removeControl(this._logo);\n map._hasEsriLogo = false;\n }\n\n L.TileLayer.prototype.onRemove.call(this, map);\n\n map.off('moveend', this._updateMapAttribution, this);\n },\n getAttribution:function(){\n var attribution = '' + this.options.attribution + ''/* + logo*/;\n return attribution;\n },\n // _initPane: function(){\n // if(!this._map.getPane(this.options.pane)){\n // var pane = this._map.createPane(this.options.pane);\n // pane.style.pointerEvents = 'none';\n // pane.style.zIndex = 5;\n // }\n // },\n _getAttributionData: function(url){\n EsriLeaflet.get(url, {}, function(error, attributions){\n this._attributions = [];\n for (var c = 0; c < attributions.contributors.length; c++) {\n var contributor = attributions.contributors[c];\n for (var i = 0; i < contributor.coverageAreas.length; i++) {\n var coverageArea = contributor.coverageAreas[i];\n var southWest = new L.LatLng(coverageArea.bbox[0], coverageArea.bbox[1]);\n var northEast = new L.LatLng(coverageArea.bbox[2], coverageArea.bbox[3]);\n this._attributions.push({\n attribution: contributor.attribution,\n score: coverageArea.score,\n bounds: new L.LatLngBounds(southWest, northEast),\n minZoom: coverageArea.zoomMin,\n maxZoom: coverageArea.zoomMax\n });\n }\n }\n\n this._attributions.sort(function(a, b){\n return b.score - a.score;\n });\n\n this._updateMapAttribution();\n }, this);\n },\n _updateMapAttribution: function(){\n if(this._map && this._map.attributionControl && this._attributions){\n var newAttributions = '';\n var bounds = this._map.getBounds();\n var zoom = this._map.getZoom();\n\n for (var i = 0; i < this._attributions.length; i++) {\n var attribution = this._attributions[i];\n var text = attribution.attribution;\n if(!newAttributions.match(text) && bounds.intersects(attribution.bounds) && zoom >= attribution.minZoom && zoom <= attribution.maxZoom) {\n newAttributions += (', ' + text);\n }\n }\n newAttributions = newAttributions.substr(2);\n var attributionElement = this._map.attributionControl._container.querySelector('.esri-attributions');\n attributionElement.innerHTML = newAttributions;\n attributionElement.style.maxWidth = (this._map.getSize().x * 0.65) + 'px';\n this.fire('attributionupdated', {\n attribution: newAttributions\n });\n }\n }\n });\n\n EsriLeaflet.BasemapLayer = EsriLeaflet.Layers.BasemapLayer;\n\n EsriLeaflet.Layers.basemapLayer = function(key, options){\n return new EsriLeaflet.Layers.BasemapLayer(key, options);\n };\n\n EsriLeaflet.basemapLayer = function(key, options){\n return new EsriLeaflet.Layers.BasemapLayer(key, options);\n };\n\n})(EsriLeaflet);","EsriLeaflet.Layers.RasterLayer = L.Class.extend({\n includes: L.Mixin.Events,\n\n options: {\n opacity: 1,\n position: 'front',\n f: 'image'\n },\n\n onAdd: function (map) {\n this._map = map;\n\n this._update = L.Util.limitExecByInterval(this._update, this.options.updateInterval, this);\n\n if (map.options.crs && map.options.crs.code) {\n var sr = map.options.crs.code.split(':')[1];\n this.options.bboxSR = sr;\n this.options.imageSR = sr;\n }\n\n map.on('moveend', this._update, this);\n\n // if we had an image loaded and it matches the\n // current bounds show the image otherwise remove it\n if(this._currentImage && this._currentImage._bounds.equals(this._map.getBounds())){\n map.addLayer(this._currentImage);\n } else if(this._currentImage) {\n this._map.removeLayer(this._currentImage);\n this._currentImage = null;\n }\n\n this._update();\n\n if(this._popup){\n this._map.on('click', this._getPopupData, this);\n this._map.on('dblclick', this._resetPopupState, this);\n }\n },\n\n bindPopup: function(fn, popupOptions){\n this._shouldRenderPopup = false;\n this._lastClick = false;\n this._popup = L.popup(popupOptions);\n this._popupFunction = fn;\n if(this._map){\n this._map.on('click', this._getPopupData, this);\n this._map.on('dblclick', this._resetPopupState, this);\n }\n return this;\n },\n\n unbindPopup: function(){\n if(this._map){\n this._map.closePopup(this._popup);\n this._map.off('click', this._getPopupData, this);\n this._map.off('dblclick', this._resetPopupState, this);\n }\n this._popup = false;\n return this;\n },\n\n onRemove: function (map) {\n if (this._currentImage) {\n this._map.removeLayer(this._currentImage);\n }\n\n if(this._popup){\n this._map.off('click', this._getPopupData, this);\n this._map.off('dblclick', this._resetPopupState, this);\n }\n\n this._map.off('moveend', this._update, this);\n this._map = null;\n },\n\n addTo: function(map){\n map.addLayer(this);\n return this;\n },\n\n removeFrom: function(map){\n map.removeLayer(this);\n return this;\n },\n\n bringToFront: function(){\n this.options.position = 'front';\n if(this._currentImage){\n this._currentImage.bringToFront();\n }\n return this;\n },\n\n bringToBack: function(){\n this.options.position = 'back';\n if(this._currentImage){\n this._currentImage.bringToBack();\n }\n return this;\n },\n\n getAttribution: function () {\n return this.options.attribution;\n },\n\n getOpacity: function(){\n return this.options.opacity;\n },\n\n setOpacity: function(opacity){\n this.options.opacity = opacity;\n this._currentImage.setOpacity(opacity);\n return this;\n },\n\n getTimeRange: function(){\n return [this.options.from, this.options.to];\n },\n\n setTimeRange: function(from, to){\n this.options.from = from;\n this.options.to = to;\n this._update();\n return this;\n },\n\n metadata: function(callback, context){\n this._service.metadata(callback, context);\n return this;\n },\n\n authenticate: function(token){\n this._service.authenticate(token);\n return this;\n },\n\n _renderImage: function(url, bounds){\n if(this._map){\n // create a new image overlay and add it to the map\n // to start loading the image\n // opacity is 0 while the image is loading\n var image = new L.ImageOverlay(url, bounds, {\n opacity: 0\n }).addTo(this._map);\n\n // once the image loads\n image.once('load', function(e){\n var newImage = e.target;\n var oldImage = this._currentImage;\n\n // if the bounds of this image matches the bounds that\n // _renderImage was called with and we have a map\n // hide the old image if there is one and set the opacity\n // of the new image otherwise remove the new image\n if(newImage._bounds.equals(bounds)){\n this._currentImage = newImage;\n\n if(this.options.position === 'front'){\n this.bringToFront();\n } else {\n this.bringToBack();\n }\n\n if(this._map && this._currentImage._map){\n this._currentImage.setOpacity(this.options.opacity);\n } else {\n this._currentImage._map.removeLayer(this._currentImage);\n }\n\n if(oldImage && this._map) {\n this._map.removeLayer(oldImage);\n }\n\n if(oldImage && oldImage._map){\n oldImage._map.removeLayer(oldImage);\n }\n } else {\n this._map.removeLayer(newImage);\n }\n\n this.fire('load', {\n bounds: bounds\n });\n\n }, this);\n\n this.fire('loading', {\n bounds: bounds\n });\n }\n },\n\n _update: function () {\n if(!this._map){\n return;\n }\n\n var zoom = this._map.getZoom();\n var bounds = this._map.getBounds();\n\n if(this._animatingZoom){\n return;\n }\n\n if (this._map._panTransition && this._map._panTransition._inProgress) {\n return;\n }\n\n if (zoom > this.options.maxZoom || zoom < this.options.minZoom) {\n return;\n }\n var params = this._buildExportParams();\n\n this._requestExport(params, bounds);\n },\n\n // TODO: refactor these into raster layer\n _renderPopup: function(latlng, error, results, response){\n latlng = L.latLng(latlng);\n if(this._shouldRenderPopup && this._lastClick.equals(latlng)){\n //add the popup to the map where the mouse was clicked at\n var content = this._popupFunction(error, results, response);\n if (content) {\n this._popup.setLatLng(latlng).setContent(content).openOn(this._map);\n }\n }\n },\n\n _resetPopupState: function(e){\n this._shouldRenderPopup = false;\n this._lastClick = e.latlng;\n },\n\n // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js\n // @TODO remove at Leaflet 0.8\n _propagateEvent: function (e) {\n e = L.extend({\n layer: e.target,\n target: this\n }, e);\n this.fire(e.type, e);\n }\n});","EsriLeaflet.Layers.DynamicMapLayer = EsriLeaflet.Layers.RasterLayer.extend({\n\n options: {\n updateInterval: 150,\n layers: false,\n layerDefs: false,\n timeOptions: false,\n format: 'png24',\n transparent: true\n },\n\n initialize: function (url, options) {\n options = options || {};\n options.url = EsriLeaflet.Util.cleanUrl(url);\n this._service = new EsriLeaflet.Services.MapService(options);\n this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);\n if (options.proxy){\n options.f = 'json';\n }\n L.Util.setOptions(this, options);\n },\n\n getLayers: function(){\n return this.options.layers;\n },\n\n setLayers: function(layers){\n this.options.layers = layers;\n this._update();\n return this;\n },\n\n getLayerDefs: function(){\n return this.options.layerDefs;\n },\n\n setLayerDefs: function(layerDefs){\n this.options.layerDefs = layerDefs;\n this._update();\n return this;\n },\n\n getTimeOptions: function(){\n return this.options.timeOptions;\n },\n\n setTimeOptions: function(timeOptions){\n this.options.timeOptions = timeOptions;\n this._update();\n return this;\n },\n\n query: function(){\n return this._service.query();\n },\n\n identify: function(){\n return this._service.identify();\n },\n\n find: function(){\n return this._service.find();\n },\n\n _getPopupData: function(e){\n var callback = L.Util.bind(function(error, featureCollection, response) {\n setTimeout(L.Util.bind(function(){\n this._renderPopup(e.latlng, error, featureCollection, response);\n }, this), 300);\n }, this);\n\n var identifyRequest = this.identify().on(this._map).at(e.latlng);\n\n if(this.options.layers){\n identifyRequest.layers('visible:' + this.options.layers.join(','));\n } else {\n identifyRequest.layers('visible');\n }\n\n identifyRequest.run(callback);\n\n // set the flags to show the popup\n this._shouldRenderPopup = true;\n this._lastClick = e.latlng;\n },\n\n _buildExportParams: function () {\n var bounds = this._map.getBounds();\n var size = this._map.getSize();\n var ne = this._map.options.crs.project(bounds._northEast);\n var sw = this._map.options.crs.project(bounds._southWest);\n\n var params = {\n bbox: [sw.x, sw.y, ne.x, ne.y].join(','),\n size: size.x + ',' + size.y,\n dpi: 96,\n format: this.options.format,\n transparent: this.options.transparent,\n bboxSR: this.options.bboxSR,\n imageSR: this.options.imageSR\n };\n\n if(this.options.layers){\n params.layers = 'show:' + this.options.layers.join(',');\n }\n\n if(this.options.layerDefs){\n params.layerDefs = JSON.stringify(this.options.layerDefs);\n }\n\n if(this.options.timeOptions){\n params.timeOptions = JSON.stringify(this.options.timeOptions);\n }\n\n if(this.options.from && this.options.to){\n params.time = this.options.from.valueOf() + ',' + this.options.to.valueOf();\n }\n\n if(this._service.options.token) {\n params.token = this._service.options.token;\n }\n\n return params;\n },\n\n _requestExport: function (params, bounds) {\n if(this.options.f === 'json'){\n this._service.get('export', params, function(error, response){\n this._renderImage(response.href, bounds);\n }, this);\n } else {\n params.f = 'image';\n this._renderImage(this.options.url + 'export' + L.Util.getParamString(params), bounds);\n }\n }\n});\n\nEsriLeaflet.DynamicMapLayer = EsriLeaflet.Layers.DynamicMapLayer;\n\nEsriLeaflet.Layers.dynamicMapLayer = function(url, options){\n return new EsriLeaflet.Layers.DynamicMapLayer(url, options);\n};\n\nEsriLeaflet.dynamicMapLayer = function(url, options){\n return new EsriLeaflet.Layers.DynamicMapLayer(url, options);\n};","EsriLeaflet.Layers.ImageMapLayer = EsriLeaflet.Layers.RasterLayer.extend({\n\n options: {\n updateInterval: 150,\n format: 'jpgpng'\n },\n\n query: function(){\n return this._service.query();\n },\n\n identify: function(){\n return this._service.identify();\n },\n\n initialize: function (url, options) {\n options = options || {};\n options.url = EsriLeaflet.Util.cleanUrl(url);\n this._service = new EsriLeaflet.Services.ImageService(options);\n this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);\n L.Util.setOptions(this, options);\n },\n\n setPixelType: function (pixelType) {\n this.options.pixelType = pixelType;\n this._update();\n return this;\n },\n\n getPixelType: function () {\n return this.options.pixelType;\n },\n\n setBandIds: function (bandIds) {\n if (L.Util.isArray(bandIds)) {\n this.options.bandIds = bandIds.join(',');\n } else {\n this.options.bandIds = bandIds.toString();\n }\n this._update();\n return this;\n },\n\n getBandIds: function () {\n return this.options.bandIds;\n },\n\n setNoData: function (noData, noDataInterpretation) {\n if (L.Util.isArray(noData)) {\n this.options.noData = noData.join(',');\n } else {\n this.options.noData = noData.toString();\n }\n if (noDataInterpretation) {\n this.options.noDataInterpretation = noDataInterpretation;\n }\n this._update();\n return this;\n },\n\n getNoData: function () {\n return this.options.noData;\n },\n\n getNoDataInterpretation: function () {\n return this.options.noDataInterpretation;\n },\n\n setRenderingRule: function(renderingRule) {\n this.options.renderingRule = renderingRule;\n this._update();\n },\n\n getRenderingRule: function() {\n return this.options.renderingRule;\n },\n\n setMosaicRule: function(mosaicRule) {\n this.options.mosaicRule = mosaicRule;\n this._update();\n },\n\n getMosaicRule: function() {\n return this.options.mosaicRule;\n },\n\n _getPopupData: function(e){\n var callback = L.Util.bind(function(error, results, response) {\n setTimeout(L.Util.bind(function(){\n this._renderPopup(e.latlng, error, results, response);\n }, this), 300);\n }, this);\n\n var identifyRequest = this.identify().at(e.latlng);\n\n // set mosaic rule for identify task if it is set for layer\n if (this.options.mosaicRule) {\n identifyRequest.setMosaicRule(this.options.mosaicRule);\n // @TODO: force return catalog items too?\n }\n\n // @TODO: set rendering rule? Not sure,\n // sometimes you want raw pixel values\n // if (this.options.renderingRule) {\n // identifyRequest.setRenderingRule(this.options.renderingRule);\n // }\n\n identifyRequest.run(callback);\n\n // set the flags to show the popup\n this._shouldRenderPopup = true;\n this._lastClick = e.latlng;\n },\n\n _buildExportParams: function () {\n var bounds = this._map.getBounds();\n var size = this._map.getSize();\n var ne = this._map.options.crs.project(bounds._northEast);\n var sw = this._map.options.crs.project(bounds._southWest);\n\n var params = {\n bbox: [sw.x, sw.y, ne.x, ne.y].join(','),\n size: size.x + ',' + size.y,\n format: this.options.format,\n bboxSR: this.options.bboxSR,\n imageSR: this.options.imageSR\n };\n\n if (this.options.from && this.options.to) {\n params.time = this.options.from.valueOf() + ',' + this.options.to.valueOf();\n }\n\n if (this.options.pixelType) {\n params.pixelType = this.options.pixelType;\n }\n\n if (this.options.interpolation) {\n params.interpolation = this.options.interpolation;\n }\n\n if (this.options.compressionQuality) {\n params.compressionQuality = this.options.compressionQuality;\n }\n\n if (this.options.bandIds) {\n params.bandIds = this.options.bandIds;\n }\n\n if (this.options.noData) {\n params.noData = this.options.noData;\n }\n\n if (this.options.noDataInterpretation) {\n params.noDataInterpretation = this.options.noDataInterpretation;\n }\n\n if (this._service.options.token) {\n params.token = this._service.options.token;\n }\n\n if(this.options.renderingRule) {\n params.renderingRule = JSON.stringify(this.options.renderingRule);\n }\n\n if(this.options.mosaicRule) {\n params.mosaicRule = JSON.stringify(this.options.mosaicRule);\n }\n\n return params;\n },\n\n _requestExport: function (params, bounds) {\n if (this.options.f === 'json') {\n this._service.get('exportImage', params, function(error, response){\n this._renderImage(response.href, bounds);\n }, this);\n } else {\n params.f = 'image';\n this._renderImage(this.options.url + 'exportImage' + L.Util.getParamString(params), bounds);\n }\n }\n});\n\nEsriLeaflet.ImageMapLayer = EsriLeaflet.Layers.ImageMapLayer;\n\nEsriLeaflet.Layers.imageMapLayer = function (url, options) {\n return new EsriLeaflet.Layers.ImageMapLayer(url, options);\n};\n\nEsriLeaflet.imageMapLayer = function (url, options) {\n return new EsriLeaflet.Layers.ImageMapLayer(url, options);\n};","EsriLeaflet.Layers.TiledMapLayer = L.TileLayer.extend({\n initialize: function(url, options){\n options = options || {};\n options.url = EsriLeaflet.Util.cleanUrl(url);\n options = L.Util.setOptions(this, options);\n\n // set the urls\n //this.url = L.esri.Util.cleanUrl(url);\n this.tileUrl = L.esri.Util.cleanUrl(url) + 'tile/{z}/{y}/{x}';\n this._service = new L.esri.Services.MapService(options);\n this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);\n\n //if this is looking at the AGO tiles subdomain insert the subdomain placeholder\n if(this.tileUrl.match('://tiles.arcgisonline.com')){\n this.tileUrl = this.tileUrl.replace('://tiles.arcgisonline.com', '://tiles{s}.arcgisonline.com');\n options.subdomains = ['1', '2', '3', '4'];\n }\n\n if(this.options.token) {\n this.tileUrl += ('?token=' + this.options.token);\n }\n\n // init layer by calling TileLayers initialize method\n L.TileLayer.prototype.initialize.call(this, this.tileUrl, options);\n },\n\n metadata: function(callback, context){\n this._service.metadata(callback, context);\n return this;\n },\n\n identify: function(){\n return this._service.identify();\n },\n\n authenticate: function(token){\n var tokenQs = '?token=' + token;\n this.tileUrl = (this.options.token) ? this.tileUrl.replace(/\\?token=(.+)/g, tokenQs) : this.tileUrl + tokenQs;\n this.options.token = token;\n this._service.authenticate(token);\n return this;\n },\n\n // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js\n // @TODO remove at Leaflet 0.8\n _propagateEvent: function (e) {\n e = L.extend({\n layer: e.target,\n target: this\n }, e);\n this.fire(e.type, e);\n }\n});\n\nL.esri.TiledMapLayer = L.esri.Layers.tiledMapLayer;\n\nL.esri.Layers.tiledMapLayer = function(url, options){\n return new L.esri.Layers.TiledMapLayer(url, options);\n};\n\nL.esri.tiledMapLayer = function(url, options){\n return new L.esri.Layers.TiledMapLayer(url, options);\n};","EsriLeaflet.Layers.FeatureGrid = L.Class.extend({\n\n includes: L.Mixin.Events,\n\n options: {\n cellSize: 512,\n updateInterval: 150\n },\n\n initialize: function (options) {\n options = L.setOptions(this, options);\n },\n\n onAdd: function (map) {\n this._map = map;\n this._update = L.Util.limitExecByInterval(this._update, this.options.updateInterval, this);\n\n // @TODO remove for leaflet 0.8\n this._map.addEventListener(this.getEvents(), this);\n\n this._reset();\n this._update();\n },\n\n onRemove: function(){\n this._map.removeEventListener(this.getEvents(), this);\n this._removeCells();\n },\n\n getEvents: function () {\n var events = {\n viewreset: this._reset,\n moveend: this._update,\n zoomend : this._onZoom\n };\n\n return events;\n },\n\n addTo: function(map){\n map.addLayer(this);\n return this;\n },\n\n removeFrom: function(map){\n map.removeLayer(this);\n return this;\n },\n\n _onZoom : function () {\n var zoom = this._map.getZoom();\n\n if (zoom > this.options.maxZoom ||\n zoom < this.options.minZoom) {\n this.removeFrom(this._map);\n this._map.addEventListener('zoomend', this.getEvents().zoomend, this);\n } else if (!this._map.hasLayer(this)) {\n this._map.removeEventListener('zoomend', this.getEvents().zoomend, this);\n this.addTo(this._map);\n }\n\n },\n\n _reset: function () {\n this._removeCells();\n\n this._cells = {};\n this._activeCells = {};\n this._cellsToLoad = 0;\n this._cellsTotal = 0;\n\n // @TODO enable at Leaflet 0.8\n // this._cellNumBounds = this._getCellNumBounds();\n\n this._resetWrap();\n },\n\n _resetWrap: function () {\n var map = this._map,\n crs = map.options.crs;\n\n if (crs.infinite) { return; }\n\n var cellSize = this._getCellSize();\n\n if (crs.wrapLng) {\n this._wrapLng = [\n Math.floor(map.project([0, crs.wrapLng[0]]).x / cellSize),\n Math.ceil(map.project([0, crs.wrapLng[1]]).x / cellSize)\n ];\n }\n\n if (crs.wrapLat) {\n this._wrapLat = [\n Math.floor(map.project([crs.wrapLat[0], 0]).y / cellSize),\n Math.ceil(map.project([crs.wrapLat[1], 0]).y / cellSize)\n ];\n }\n },\n\n _getCellSize: function () {\n return this.options.cellSize;\n },\n\n _update: function () {\n if (!this._map) { return; }\n\n var bounds = this._map.getPixelBounds(),\n zoom = this._map.getZoom(),\n cellSize = this._getCellSize(),\n cellPadding = [cellSize/2,cellSize/2];\n // cellPadding = [0,0]\n\n if (zoom > this.options.maxZoom ||\n zoom < this.options.minZoom) { return; }\n\n // cell coordinates range for the current view\n var topLeft = bounds.min.subtract(cellPadding).divideBy(cellSize).floor();\n topLeft.x = Math.max(topLeft.x, 0);\n topLeft.y = Math.max(topLeft.y, 0);\n\n var cellBounds = L.bounds(topLeft, bounds.max.add(cellPadding).divideBy(cellSize).floor());\n\n // remove any present cells that are off the specified bounds\n this._removeOtherCells(cellBounds);\n this._addCells(cellBounds);\n },\n\n _addCells: function (bounds) {\n var queue = [],\n center = bounds.getCenter(),\n zoom = this._map.getZoom();\n\n var j, i, coords;\n // create a queue of coordinates to load cells from\n for (j = bounds.min.y; j <= bounds.max.y; j++) {\n for (i = bounds.min.x; i <= bounds.max.x; i++) {\n coords = new L.Point(i, j);\n coords.z = zoom;\n\n // @TODO enable at Leaflet 0.8\n // if (this._isValidCell(coords)) {\n // queue.push(coords);\n // }\n\n queue.push(coords);\n }\n }\n var cellsToLoad = queue.length;\n\n if (cellsToLoad === 0) { return; }\n\n this._cellsToLoad += cellsToLoad;\n this._cellsTotal += cellsToLoad;\n\n // sort cell queue to load cells in order of their distance to center\n queue.sort(function (a, b) {\n return a.distanceTo(center) - b.distanceTo(center);\n });\n\n for (i = 0; i < cellsToLoad; i++) {\n this._addCell(queue[i]);\n }\n },\n\n // @TODO enable at Leaflet 0.8\n // _isValidCell: function (coords) {\n // var crs = this._map.options.crs;\n\n // if (!crs.infinite) {\n // // don't load cell if it's out of bounds and not wrapped\n // var bounds = this._cellNumBounds;\n // if (\n // (!crs.wrapLng && (coords.x < bounds.min.x || coords.x > bounds.max.x)) ||\n // (!crs.wrapLat && (coords.y < bounds.min.y || coords.y > bounds.max.y))\n // ) {\n // return false;\n // }\n // }\n\n // if (!this.options.bounds) {\n // return true;\n // }\n\n // // don't load cell if it doesn't intersect the bounds in options\n // var cellBounds = this._cellCoordsToBounds(coords);\n // return L.latLngBounds(this.options.bounds).intersects(cellBounds);\n // },\n\n // converts cell coordinates to its geographical bounds\n _cellCoordsToBounds: function (coords) {\n var map = this._map,\n cellSize = this.options.cellSize,\n\n nwPoint = coords.multiplyBy(cellSize),\n sePoint = nwPoint.add([cellSize, cellSize]),\n\n // @TODO for Leaflet 0.8\n // nw = map.wrapLatLng(map.unproject(nwPoint, coords.z)),\n // se = map.wrapLatLng(map.unproject(sePoint, coords.z));\n\n nw = map.unproject(nwPoint, coords.z).wrap(),\n se = map.unproject(sePoint, coords.z).wrap();\n\n return new L.LatLngBounds(nw, se);\n },\n\n // converts cell coordinates to key for the cell cache\n _cellCoordsToKey: function (coords) {\n return coords.x + ':' + coords.y;\n },\n\n // converts cell cache key to coordiantes\n _keyToCellCoords: function (key) {\n var kArr = key.split(':'),\n x = parseInt(kArr[0], 10),\n y = parseInt(kArr[1], 10);\n\n return new L.Point(x, y);\n },\n\n // remove any present cells that are off the specified bounds\n _removeOtherCells: function (bounds) {\n for (var key in this._cells) {\n if (!bounds.contains(this._keyToCellCoords(key))) {\n this._removeCell(key);\n }\n }\n },\n\n _removeCell: function (key) {\n var cell = this._activeCells[key];\n if(cell){\n delete this._activeCells[key];\n\n if (this.cellLeave) {\n this.cellLeave(cell.bounds, cell.coords);\n }\n\n this.fire('cellleave', {\n bounds: cell.bounds,\n coords: cell.coords\n });\n }\n },\n\n _removeCells: function(){\n for (var key in this._cells) {\n var bounds = this._cells[key].bounds;\n var coords = this._cells[key].coords;\n\n if (this.cellLeave) {\n this.cellLeave(bounds, coords);\n }\n\n this.fire('cellleave', {\n bounds: bounds,\n coords: coords\n });\n }\n },\n\n _addCell: function (coords) {\n\n // wrap cell coords if necessary (depending on CRS)\n this._wrapCoords(coords);\n\n // generate the cell key\n var key = this._cellCoordsToKey(coords);\n\n // get the cell from the cache\n var cell = this._cells[key];\n // if this cell should be shown as isnt active yet (enter)\n\n if (cell && !this._activeCells[key]) {\n if (this.cellEnter) {\n this.cellEnter(cell.bounds, coords);\n }\n\n this.fire('cellenter', {\n bounds: cell.bounds,\n coords: coords\n });\n\n this._activeCells[key] = cell;\n }\n\n // if we dont have this cell in the cache yet (create)\n if (!cell) {\n cell = {\n coords: coords,\n bounds: this._cellCoordsToBounds(coords)\n };\n\n this._cells[key] = cell;\n this._activeCells[key] = cell;\n\n if(this.createCell){\n this.createCell(cell.bounds, coords);\n }\n\n this.fire('cellcreate', {\n bounds: cell.bounds,\n coords: coords\n });\n }\n },\n\n _wrapCoords: function (coords) {\n coords.x = this._wrapLng ? L.Util.wrapNum(coords.x, this._wrapLng) : coords.x;\n coords.y = this._wrapLat ? L.Util.wrapNum(coords.y, this._wrapLat) : coords.y;\n }\n\n // get the global cell coordinates range for the current zoom\n // @TODO enable at Leaflet 0.8\n // _getCellNumBounds: function () {\n // // @TODO for Leaflet 0.8\n // // var bounds = this._map.getPixelWorldBounds(),\n // // size = this._getCellSize();\n // //\n // // return bounds ? L.bounds(\n // // bounds.min.divideBy(size).floor(),\n // // bounds.max.divideBy(size).ceil().subtract([1, 1])) : null;\n // }\n\n});","(function(EsriLeaflet){\n\n EsriLeaflet.Layers.FeatureManager = EsriLeaflet.Layers.FeatureGrid.extend({\n\n /**\n * Options\n */\n\n options: {\n where: '1=1',\n fields: ['*'],\n from: false,\n to: false,\n timeField: false,\n timeFilterMode: 'server',\n simplifyFactor: 0,\n precision: 6\n },\n\n /**\n * Constructor\n */\n\n initialize: function (url, options) {\n EsriLeaflet.Layers.FeatureGrid.prototype.initialize.call(this, options);\n\n options = options || {};\n options.url = EsriLeaflet.Util.cleanUrl(url);\n options = L.setOptions(this, options);\n\n this._service = new EsriLeaflet.Services.FeatureLayer(options);\n\n //use case insensitive regex to look for common fieldnames used for indexing\n /*global console */\n if (this.options.fields[0] !== '*'){\n var oidCheck = false;\n for (var i = 0; i < this.options.fields.length; i++){\n if (this.options.fields[i].match(/^(OBJECTID|FID|OID|ID)$/i)){\n oidCheck = true;\n }\n }\n if (oidCheck === false && console && console.warn){\n console.warn('no known esriFieldTypeOID field detected in fields Array. Please add an attribute field containing unique IDs to ensure the layer can be drawn correctly.');\n }\n }\n\n // Leaflet 0.8 change to new propagation\n this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', function (e) {\n e = L.extend({\n target: this\n }, e);\n this.fire(e.type, e);\n }, this);\n\n if(this.options.timeField.start && this.options.timeField.end){\n this._startTimeIndex = new BinarySearchIndex();\n this._endTimeIndex = new BinarySearchIndex();\n } else if(this.options.timeField){\n this._timeIndex = new BinarySearchIndex();\n }\n\n this._cache = {};\n this._currentSnapshot = []; // cache of what layers should be active\n this._activeRequests = 0;\n this._pendingRequests = [];\n },\n\n /**\n * Layer Interface\n */\n\n onAdd: function(map){\n return EsriLeaflet.Layers.FeatureGrid.prototype.onAdd.call(this, map);\n },\n\n onRemove: function(map){\n return EsriLeaflet.Layers.FeatureGrid.prototype.onRemove.call(this, map);\n },\n\n getAttribution: function () {\n return this.options.attribution;\n },\n\n /**\n * Feature Managment\n */\n\n createCell: function(bounds, coords){\n this._requestFeatures(bounds, coords);\n },\n\n _requestFeatures: function(bounds, coords, callback){\n this._activeRequests++;\n\n // our first active request fires loading\n if(this._activeRequests === 1){\n this.fire('loading', {\n bounds: bounds\n });\n }\n\n return this._buildQuery(bounds).run(function(error, featureCollection, response){\n if(response && response.exceededTransferLimit){\n this.fire('drawlimitexceeded');\n }\n\n //deincriment the request counter\n this._activeRequests--;\n\n if(!error && featureCollection.features.length){\n // schedule adding features until the next animation frame\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n this._addFeatures(featureCollection.features, coords);\n }, this));\n }\n\n if(callback){\n callback.call(this, error, featureCollection);\n }\n\n // if there are no more active requests fire a load event for this view\n if(this._activeRequests <= 0){\n this.fire('load', {\n bounds: bounds\n });\n }\n }, this);\n },\n\n _cacheKey: function (coords){\n return coords.z + ':' + coords.x + ':' +coords.y;\n },\n\n _addFeatures: function(features, coords){\n var key = this._cacheKey(coords);\n this._cache[key] = this._cache[key] || [];\n\n for (var i = features.length - 1; i >= 0; i--) {\n var id = features[i].id;\n this._currentSnapshot.push(id);\n this._cache[key].push(id);\n }\n\n if(this.options.timeField){\n this._buildTimeIndexes(features);\n }\n\n var zoom = this._map.getZoom();\n\n if (zoom > this.options.maxZoom ||\n zoom < this.options.minZoom) { return; }\n\n this.createLayers(features);\n },\n\n _buildQuery: function(bounds){\n var query = this._service.query().intersects(bounds).where(this.options.where).fields(this.options.fields).precision(this.options.precision);\n\n if(this.options.simplifyFactor){\n query.simplify(this._map, this.options.simplifyFactor);\n }\n\n if(this.options.timeFilterMode === 'server' && this.options.from && this.options.to){\n query.between(this.options.from, this.options.to);\n }\n\n return query;\n },\n\n /**\n * Where Methods\n */\n\n setWhere: function(where, callback, context){\n\n this.options.where = (where && where.length) ? where : '1=1';\n\n var oldSnapshot = [];\n var newShapshot = [];\n var pendingRequests = 0;\n var requestError = null;\n var requestCallback = L.Util.bind(function(error, featureCollection){\n if(error){\n requestError = error;\n }\n\n if(featureCollection){\n for (var i = featureCollection.features.length - 1; i >= 0; i--) {\n newShapshot.push(featureCollection.features[i].id);\n }\n }\n\n pendingRequests--;\n\n if(pendingRequests <= 0){\n this._currentSnapshot = newShapshot;\n // schedule adding features until the next animation frame\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n this.removeLayers(oldSnapshot);\n this.addLayers(newShapshot);\n if(callback) {\n callback.call(context, requestError);\n }\n }, this));\n\n }\n }, this);\n\n for (var i = this._currentSnapshot.length - 1; i >= 0; i--) {\n oldSnapshot.push(this._currentSnapshot[i]);\n }\n\n for(var key in this._activeCells){\n pendingRequests++;\n var coords = this._keyToCellCoords(key);\n var bounds = this._cellCoordsToBounds(coords);\n this._requestFeatures(bounds, key, requestCallback);\n }\n\n return this;\n },\n\n getWhere: function(){\n return this.options.where;\n },\n\n /**\n * Time Range Methods\n */\n\n getTimeRange: function(){\n return [this.options.from, this.options.to];\n },\n\n setTimeRange: function(from, to, callback, context){\n var oldFrom = this.options.from;\n var oldTo = this.options.to;\n var pendingRequests = 0;\n var requestError = null;\n var requestCallback = L.Util.bind(function(error){\n if(error){\n requestError = error;\n }\n this._filterExistingFeatures(oldFrom, oldTo, from, to);\n\n pendingRequests--;\n\n if(callback && pendingRequests <= 0){\n callback.call(context, requestError);\n }\n }, this);\n\n this.options.from = from;\n this.options.to = to;\n\n this._filterExistingFeatures(oldFrom, oldTo, from, to);\n\n if(this.options.timeFilterMode === 'server') {\n for(var key in this._activeCells){\n pendingRequests++;\n var coords = this._keyToCellCoords(key);\n var bounds = this._cellCoordsToBounds(coords);\n this._requestFeatures(bounds, key, requestCallback);\n }\n }\n },\n\n refresh: function(){\n for(var key in this._activeCells){\n var coords = this._keyToCellCoords(key);\n var bounds = this._cellCoordsToBounds(coords);\n this._requestFeatures(bounds, key);\n }\n },\n\n _filterExistingFeatures: function (oldFrom, oldTo, newFrom, newTo) {\n var layersToRemove = (oldFrom && oldTo) ? this._getFeaturesInTimeRange(oldFrom, oldTo) : this._currentSnapshot;\n var layersToAdd = this._getFeaturesInTimeRange(newFrom, newTo);\n\n if(layersToAdd.indexOf){\n for (var i = 0; i < layersToAdd.length; i++) {\n var shouldRemoveLayer = layersToRemove.indexOf(layersToAdd[i]);\n if(shouldRemoveLayer >= 0){\n layersToRemove.splice(shouldRemoveLayer, 1);\n }\n }\n }\n\n // schedule adding features until the next animation frame\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n this.removeLayers(layersToRemove);\n this.addLayers(layersToAdd);\n }, this));\n },\n\n _getFeaturesInTimeRange: function(start, end){\n var ids = [];\n var search;\n\n if(this.options.timeField.start && this.options.timeField.end){\n var startTimes = this._startTimeIndex.between(start, end);\n var endTimes = this._endTimeIndex.between(start, end);\n search = startTimes.concat(endTimes);\n } else {\n search = this._timeIndex.between(start, end);\n }\n\n for (var i = search.length - 1; i >= 0; i--) {\n ids.push(search[i].id);\n }\n\n return ids;\n },\n\n _buildTimeIndexes: function(geojson){\n var i;\n var feature;\n if(this.options.timeField.start && this.options.timeField.end){\n var startTimeEntries = [];\n var endTimeEntries = [];\n for (i = geojson.length - 1; i >= 0; i--) {\n feature = geojson[i];\n startTimeEntries.push( {\n id: feature.id,\n value: new Date(feature.properties[this.options.timeField.start])\n });\n endTimeEntries.push( {\n id: feature.id,\n value: new Date(feature.properties[this.options.timeField.end])\n });\n }\n this._startTimeIndex.bulkAdd(startTimeEntries);\n this._endTimeIndex.bulkAdd(endTimeEntries);\n } else {\n var timeEntries = [];\n for (i = geojson.length - 1; i >= 0; i--) {\n feature = geojson[i];\n timeEntries.push( {\n id: feature.id,\n value: new Date(feature.properties[this.options.timeField])\n });\n }\n\n this._timeIndex.bulkAdd(timeEntries);\n }\n },\n\n _featureWithinTimeRange: function(feature){\n if(!this.options.from || !this.options.to){\n return true;\n }\n\n var from = +this.options.from.valueOf();\n var to = +this.options.to.valueOf();\n\n if(typeof this.options.timeField === 'string'){\n var date = +feature.properties[this.options.timeField];\n return (date >= from) && (date <= to);\n }\n\n if(this.options.timeField.start && this.options.timeField.end){\n var startDate = +feature.properties[this.options.timeField.start];\n var endDate = +feature.properties[this.options.timeField.end];\n return ((startDate >= from) && (startDate <= to)) || ((endDate >= from) && (endDate <= to));\n }\n },\n\n /**\n * Service Methods\n */\n\n authenticate: function(token){\n this._service.authenticate(token);\n return this;\n },\n\n metadata: function(callback, context){\n this._service.metadata(callback, context);\n return this;\n },\n\n query: function(){\n return this._service.query();\n },\n\n addFeature: function(feature, callback, context){\n this._service.addFeature(feature, function(error, response){\n if(!error){\n this.refresh();\n }\n if(callback){\n callback.call(context, error, response);\n }\n }, this);\n return this;\n },\n\n updateFeature: function(feature, callback, context){\n return this._service.updateFeature(feature, function(error, response){\n if(!error){\n this.refresh();\n }\n if(callback){\n callback.call(context, error, response);\n }\n }, this);\n },\n\n deleteFeature: function(id, callback, context){\n return this._service.deleteFeature(id, function(error, response){\n if(!error && response.objectId){\n this.removeLayers([response.objectId], true);\n }\n if(callback){\n callback.call(context, error, response);\n }\n }, this);\n }\n });\n\n /**\n * Temporal Binary Search Index\n */\n\n function BinarySearchIndex(values) {\n this.values = values || [];\n }\n\n BinarySearchIndex.prototype._query = function(query){\n var minIndex = 0;\n var maxIndex = this.values.length - 1;\n var currentIndex;\n var currentElement;\n var resultIndex;\n\n while (minIndex <= maxIndex) {\n resultIndex = currentIndex = (minIndex + maxIndex) / 2 | 0;\n currentElement = this.values[Math.round(currentIndex)];\n if (+currentElement.value < +query) {\n minIndex = currentIndex + 1;\n } else if (+currentElement.value > +query) {\n maxIndex = currentIndex - 1;\n } else {\n return currentIndex;\n }\n }\n\n return ~maxIndex;\n };\n\n BinarySearchIndex.prototype.sort = function(){\n this.values.sort(function(a, b) {\n return +b.value - +a.value;\n }).reverse();\n this.dirty = false;\n };\n\n BinarySearchIndex.prototype.between = function(start, end){\n if(this.dirty){\n this.sort();\n }\n\n var startIndex = this._query(start);\n var endIndex = this._query(end);\n\n if(startIndex === 0 && endIndex === 0){\n return [];\n }\n\n startIndex = Math.abs(startIndex);\n endIndex = (endIndex < 0) ? Math.abs(endIndex): endIndex + 1;\n\n return this.values.slice(startIndex, endIndex);\n };\n\n BinarySearchIndex.prototype.bulkAdd = function(items){\n this.dirty = true;\n this.values = this.values.concat(items);\n };\n\n})(EsriLeaflet);","EsriLeaflet.Layers.FeatureLayer = EsriLeaflet.Layers.FeatureManager.extend({\n\n statics: {\n EVENTS: 'click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose'\n },\n\n options: {\n cacheLayers: true\n },\n\n /**\n * Constructor\n */\n\n initialize: function (url, options) {\n EsriLeaflet.Layers.FeatureManager.prototype.initialize.call(this, url, options);\n\n options = L.setOptions(this, options);\n\n this._layers = {};\n this._leafletIds = {};\n this._key = 'c'+(Math.random() * 1e9).toString(36).replace('.', '_');\n },\n\n /**\n * Layer Interface\n */\n\n onAdd: function(map){\n map.on('zoomstart zoomend', function(e){\n this._zooming = (e.type === 'zoomstart');\n }, this);\n return EsriLeaflet.Layers.FeatureManager.prototype.onAdd.call(this, map);\n },\n\n onRemove: function(map){\n for (var i in this._layers) {\n map.removeLayer(this._layers[i]);\n }\n\n return EsriLeaflet.Layers.FeatureManager.prototype.onRemove.call(this, map);\n },\n\n createNewLayer: function(geojson){\n // @TODO Leaflet 0.8\n //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);\n return L.GeoJSON.geometryToLayer(geojson, this.options.pointToLayer, L.GeoJSON.coordsToLatLng, this.options);\n },\n\n /**\n * Feature Managment Methods\n */\n\n createLayers: function(features){\n for (var i = features.length - 1; i >= 0; i--) {\n\n var geojson = features[i];\n\n var layer = this._layers[geojson.id];\n var newLayer;\n\n if(layer && !this._map.hasLayer(layer)){\n this._map.addLayer(layer);\n }\n\n if (layer && layer.setLatLngs) {\n // @TODO Leaflet 0.8\n //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);\n\n var updateGeo = this.createNewLayer(geojson);\n layer.setLatLngs(updateGeo.getLatLngs());\n }\n\n if(!layer){\n // @TODO Leaflet 0.8\n //newLayer = L.GeoJSON.geometryToLayer(geojson, this.options);\n\n newLayer = this.createNewLayer(geojson);\n newLayer.feature = geojson;\n newLayer.defaultOptions = newLayer.options;\n newLayer._leaflet_id = this._key + '_' + geojson.id;\n\n this._leafletIds[newLayer._leaflet_id] = geojson.id;\n\n // bubble events from layers to this\n // @TODO Leaflet 0.8\n // newLayer.addEventParent(this);\n\n newLayer.on(EsriLeaflet.Layers.FeatureLayer.EVENTS, this._propagateEvent, this);\n\n // bind a popup if we have one\n if(this._popup && newLayer.bindPopup){\n newLayer.bindPopup(this._popup(newLayer.feature, newLayer), this._popupOptions);\n }\n\n if(this.options.onEachFeature){\n this.options.onEachFeature(newLayer.feature, newLayer);\n }\n\n // cache the layer\n this._layers[newLayer.feature.id] = newLayer;\n\n // style the layer\n this.resetStyle(newLayer.feature.id);\n\n this.fire('createfeature', {\n feature: newLayer.feature\n });\n\n // add the layer if it is within the time bounds or our layer is not time enabled\n if(!this.options.timeField || (this.options.timeField && this._featureWithinTimeRange(geojson)) ){\n this._map.addLayer(newLayer);\n }\n }\n }\n },\n\n addLayers: function(ids){\n for (var i = ids.length - 1; i >= 0; i--) {\n var layer = this._layers[ids[i]];\n if(layer){\n this.fire('addfeature', {\n feature: layer.feature\n });\n this._map.addLayer(layer);\n }\n }\n },\n\n removeLayers: function(ids, permanent){\n for (var i = ids.length - 1; i >= 0; i--) {\n var id = ids[i];\n var layer = this._layers[id];\n if(layer){\n this.fire('removefeature', {\n feature: layer.feature,\n permanent: permanent\n });\n this._map.removeLayer(layer);\n }\n if(layer && permanent){\n delete this._layers[id];\n }\n }\n },\n\n cellEnter: function(bounds, coords){\n if(!this._zooming){\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n var cacheKey = this._cacheKey(coords);\n var cellKey = this._cellCoordsToKey(coords);\n var layers = this._cache[cacheKey];\n if(this._activeCells[cellKey] && layers){\n this.addLayers(layers);\n }\n }, this));\n }\n },\n\n cellLeave: function(bounds, coords){\n if(!this._zooming){\n EsriLeaflet.Util.requestAnimationFrame(L.Util.bind(function(){\n var cacheKey = this._cacheKey(coords);\n var cellKey = this._cellCoordsToKey(coords);\n var layers = this._cache[cacheKey];\n var mapBounds = this._map.getBounds();\n if(!this._activeCells[cellKey] && layers){\n var removable = true;\n\n for (var i = 0; i < layers.length; i++) {\n var layer = this._layers[layers[i]];\n if(layer && layer.getBounds && mapBounds.intersects(layer.getBounds())){\n removable = false;\n }\n }\n\n if(removable){\n this.removeLayers(layers, !this.options.cacheLayers);\n }\n\n if(!this.options.cacheLayers && removable){\n delete this._cache[cacheKey];\n delete this._cells[cellKey];\n delete this._activeCells[cellKey];\n }\n }\n }, this));\n }\n },\n\n /**\n * Styling Methods\n */\n\n resetStyle: function (id) {\n var layer = this._layers[id];\n\n if(layer){\n layer.options = layer.defaultOptions;\n this.setFeatureStyle(layer.feature.id, this.options.style);\n }\n\n return this;\n },\n\n setStyle: function (style) {\n this.options.style = style;\n this.eachFeature(function (layer) {\n this.setFeatureStyle(layer.feature.id, style);\n }, this);\n return this;\n },\n\n setFeatureStyle: function (id, style) {\n var layer = this._layers[id];\n\n if (typeof style === 'function') {\n style = style(layer.feature);\n }\n\n /*trap inability to access default style options from MultiLine/MultiPolygon\n please revisit at Leaflet 1.0*/\n else if (!style && !layer.defaultOptions) {\n var dummyPath = new L.Path();\n style = L.Path.prototype.options;\n style.fill = true; //not set by default\n }\n\n if (layer.setStyle) {\n layer.setStyle(style);\n }\n },\n\n /**\n * Popup Methods\n */\n\n bindPopup: function (fn, options) {\n this._popup = fn;\n this._popupOptions = options;\n for (var i in this._layers) {\n var layer = this._layers[i];\n var popupContent = this._popup(layer.feature, layer);\n layer.bindPopup(popupContent, options);\n }\n return this;\n },\n\n unbindPopup: function () {\n this._popup = false;\n for (var i in this._layers) {\n var layer = this._layers[i];\n if (layer.unbindPopup) {\n layer.unbindPopup();\n } else if (layer.getLayers) {\n var groupLayers = layer.getLayers();\n for (var j in groupLayers) {\n var gLayer = groupLayers[j];\n gLayer.unbindPopup();\n }\n }\n }\n return this;\n },\n\n /**\n * Utility Methods\n */\n\n eachFeature: function (fn, context) {\n for (var i in this._layers) {\n fn.call(context, this._layers[i]);\n }\n return this;\n },\n\n getFeature: function (id) {\n return this._layers[id];\n },\n\n // from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js\n // @TODO remove at Leaflet 0.8\n _propagateEvent: function (e) {\n e.layer = this._layers[this._leafletIds[e.target._leaflet_id]];\n e.target = this;\n this.fire(e.type, e);\n }\n});\n\nEsriLeaflet.FeatureLayer = EsriLeaflet.Layers.FeatureLayer;\n\nEsriLeaflet.Layers.featureLayer = function(url, options){\n return new EsriLeaflet.Layers.FeatureLayer(url, options);\n};\n\nEsriLeaflet.featureLayer = function(url, options){\n return new EsriLeaflet.Layers.FeatureLayer(url, options);\n};","EsriLeaflet.Controls.Logo = L.Control.extend({\n options: {\n position: 'bottomright',\n marginTop: 0,\n marginLeft: 0,\n marginBottom: 0,\n marginRight: 0\n },\n onAdd: function () {\n var div = L.DomUtil.create('div', 'esri-leaflet-logo');\n div.style.marginTop = this.options.marginTop;\n div.style.marginLeft = this.options.marginLeft;\n div.style.marginBottom = this.options.marginBottom;\n div.style.marginRight = this.options.marginRight;\n div.innerHTML = '';\n return div;\n }\n});\n\nEsriLeaflet.Controls.logo = function(options){\n return new L.esri.Controls.Logo(options);\n};\n"]}
\ No newline at end of file