diff --git a/dist/esri-leaflet-debug.js b/dist/esri-leaflet-debug.js new file mode 100644 index 000000000..e4edbc51b --- /dev/null +++ b/dist/esri-leaflet-debug.js @@ -0,0 +1,3796 @@ +/* esri-leaflet - v2.0.1 - Sat Jul 16 2016 08:03:57 GMT-0700 (PDT) + * Copyright (c) 2016 Environmental Systems Research Institute, Inc. + * Apache-2.0 */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('leaflet')) : + typeof define === 'function' && define.amd ? define(['exports', 'leaflet'], factory) : + (factory((global.L = global.L || {}, global.L.esri = global.L.esri || {}),global.L)); +}(this, function (exports,L) { 'use strict'; + + L = 'default' in L ? L['default'] : L; + + var version = "2.0.1"; + + var cors = ((window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest())); + var pointerEvents = document.documentElement.style.pointerEvents === ''; + + var Support = { + cors: cors, + pointerEvents: pointerEvents + }; + + var callbacks = 0; + + 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 window.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); + } + }; + + httpRequest.ontimeout = function () { + this.onerror(); + }; + + return httpRequest; + } + + function xmlHttpPost (url, params, callback, context) { + var httpRequest = createRequest(callback, context); + httpRequest.open('POST', url); + + if (typeof context !== 'undefined' && context !== null) { + if (typeof context.options !== 'undefined') { + httpRequest.timeout = context.options.timeout; + } + } + httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + httpRequest.send(serialize(params)); + + return httpRequest; + } + + function xmlHttpGet (url, params, callback, context) { + var httpRequest = createRequest(callback, context); + httpRequest.open('GET', url + '?' + serialize(params), true); + + if (typeof context !== 'undefined' && context !== null) { + if (typeof context.options !== 'undefined') { + httpRequest.timeout = context.options.timeout; + } + } + httpRequest.send(null); + + return httpRequest; + } + + // AJAX handlers for CORS (modern browsers) or JSONP (older browsers) + function request (url, params, callback, context) { + var paramString = serialize(params); + var httpRequest = createRequest(callback, context); + var requestLength = (url + '?' + paramString).length; + + // get around ie10/11 bug which requires that the request be opened before a timeout is applied + if (requestLength <= 2000 && Support.cors) { + httpRequest.open('GET', url + '?' + paramString); + + } else if (requestLength > 2000 && Support.cors) { + httpRequest.open('POST', url); + httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + } + + if (typeof context !== 'undefined' && context !== null) { + if (typeof context.options !== 'undefined') { + httpRequest.timeout = context.options.timeout; + } + } + + // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest + if (requestLength <= 2000 && Support.cors) { + httpRequest.send(null); + + // request is less more then 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest + } else if (requestLength > 2000 && Support.cors) { + 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 && !Support.cors) { + return jsonp(url, params, callback, context); + + // request is longer then 2000 characters and the browser does not support CORS, log a warning + } else { + 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; + } + + function jsonp (url, params, callback, context) { + window._EsriLeafletCallbacks = window._EsriLeafletCallbacks || {}; + var callbackId = 'c' + callbacks; + params.callback = 'window._EsriLeafletCallbacks.' + 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; + } + }; + + var script = L.DomUtil.create('script', null, document.body); + script.type = 'text/javascript'; + script.src = url + '?' + serialize(params); + script.id = callbackId; + + callbacks++; + + return { + id: callbackId, + url: script.src, + abort: function () { + window._EsriLeafletCallbacks._callback[callbackId]({ + code: 0, + message: 'Request aborted.' + }); + } + }; + } + + var get = ((Support.cors) ? xmlHttpGet : jsonp); + get.CORS = xmlHttpGet; + get.JSONP = jsonp; + + // export the Request object to call the different handlers for debugging + var Request = { + request: request, + get: get, + post: xmlHttpPost + }; + + /* + * Copyright 2015 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the Liscense. + */ + + // 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; + var 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 (ua >= 0 && ua <= 1 && ub >= 0 && 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; + } + + // shallow object clone for feature properties and attributes + // from http://jsperf.com/cloning-an-object/2 + function shallowClone$1 (obj) { + var target = {}; + for (var i in obj) { + if (obj.hasOwnProperty(i)) { + target[i] = obj[i]; + } + } + return target; + } + + function arcgisToGeoJSON$1 (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) ? arcgisToGeoJSON$1(arcgis.geometry) : null; + geojson.properties = (arcgis.attributes) ? shallowClone$1(arcgis.attributes) : null; + if (arcgis.attributes) { + geojson.id = arcgis.attributes[idAttribute] || arcgis.attributes.OBJECTID || arcgis.attributes.FID; + } + } + + return geojson; + } + + function geojsonToArcGIS$1 (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 = geojsonToArcGIS$1(geojson.geometry, idAttribute); + } + result.attributes = (geojson.properties) ? shallowClone$1(geojson.properties) : {}; + if (geojson.id) { + result.attributes[idAttribute] = geojson.id; + } + break; + case 'FeatureCollection': + result = []; + for (i = 0; i < geojson.features.length; i++) { + result.push(geojsonToArcGIS$1(geojson.features[i], idAttribute)); + } + break; + case 'GeometryCollection': + result = []; + for (i = 0; i < geojson.geometries.length; i++) { + result.push(geojsonToArcGIS$1(geojson.geometries[i], idAttribute)); + } + break; + } + + return result; + } + + function geojsonToArcGIS (geojson, idAttr) { + return geojsonToArcGIS$1(geojson, idAttr); + } + + function arcgisToGeoJSON (arcgis, idAttr) { + return arcgisToGeoJSON$1(arcgis, idAttr); + } + + // shallow object clone for feature properties and attributes + // from http://jsperf.com/cloning-an-object/2 + function shallowClone (obj) { + var target = {}; + for (var i in obj) { + if (obj.hasOwnProperty(i)) { + target[i] = obj[i]; + } + } + return target; + } + + // convert an extent (ArcGIS) to LatLngBounds (Leaflet) + function extentToBounds (extent) { + var sw = L.latLng(extent.ymin, extent.xmin); + var ne = L.latLng(extent.ymax, extent.xmax); + return L.latLngBounds(sw, ne); + } + + // convert an LatLngBounds (Leaflet) to extent (ArcGIS) + function boundsToExtent (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 + } + }; + } + + function responseToFeatureCollection (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--) { + var feature = arcgisToGeoJSON(features[i], objectIdField); + featureCollection.features.push(feature); + } + } + + return featureCollection; + } + + // trim url whitespace and add a trailing slash if needed + function cleanUrl (url) { + // trim leading and trailing spaces, but not spaces inside the url + url = L.Util.trim(url); + + // add a trailing slash to the url if the user omitted it + if (url[url.length - 1] !== '/') { + url += '/'; + } + + return url; + } + + function isArcgisOnline (url) { + /* hosted feature services can emit geojson natively. */ + return (/\.arcgis\.com.*?FeatureServer/g).test(url); + } + + function geojsonTypeToArcGIS (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; + } + + function warn () { + if (console && console.warn) { + console.warn.apply(console, arguments); + } + } + + function _getAttributionData (url, map) { + jsonp(url, {}, L.Util.bind(function (error, attributions) { + if (error) { return; } + map._esriAttributions = []; + for (var c = 0; c < attributions.contributors.length; c++) { + var contributor = attributions.contributors[c]; + + if (contributor.attribution !== 'Esri') { + for (var i = 0; i < contributor.coverageAreas.length; i++) { + var coverageArea = contributor.coverageAreas[i]; + var southWest = L.latLng(coverageArea.bbox[0], coverageArea.bbox[1]); + var northEast = L.latLng(coverageArea.bbox[2], coverageArea.bbox[3]); + map._esriAttributions.push({ + attribution: contributor.attribution, + score: coverageArea.score, + bounds: L.latLngBounds(southWest, northEast), + minZoom: coverageArea.zoomMin, + maxZoom: coverageArea.zoomMax + }); + } + } + } + + map._esriAttributions.sort(function (a, b) { + return b.score - a.score; + }); + + // pass the same argument as the map's 'moveend' event + var obj = { target: map }; + this._updateMapAttribution(obj); + }, this)); + } + + function _updateMapAttribution (evt) { + map = evt.target; + var oldAttributions = map._esriAttributions; + + if (map && map.attributionControl && oldAttributions) { + var newAttributions = ''; + var bounds = map.getBounds(); + var wrappedBounds = L.latLngBounds( + bounds.getSouthWest().wrap(), + bounds.getNorthEast().wrap() + ); + var zoom = map.getZoom(); + + for (var i = 0; i < oldAttributions.length; i++) { + var attribution = oldAttributions[i]; + var text = attribution.attribution; + + if (!newAttributions.match(text) && attribution.bounds.intersects(wrappedBounds) && zoom >= attribution.minZoom && zoom <= attribution.maxZoom) { + newAttributions += (', ' + text); + } + } + newAttributions = newAttributions.substr(2); + var attributionElement = map.attributionControl._container.querySelector('.esri-attributions'); + + attributionElement.innerHTML = newAttributions; + attributionElement.style.maxWidth = (map.getSize().x * 0.65) + 'px'; + + map.fire('attributionupdated', { + attribution: newAttributions + }); + } + } + + var Util = { + shallowClone: shallowClone, + warn: warn, + cleanUrl: cleanUrl, + isArcgisOnline: isArcgisOnline, + geojsonTypeToArcGIS: geojsonTypeToArcGIS, + responseToFeatureCollection: responseToFeatureCollection, + geojsonToArcGIS: geojsonToArcGIS, + arcgisToGeoJSON: arcgisToGeoJSON, + boundsToExtent: boundsToExtent, + extentToBounds: extentToBounds, + _getAttributionData: _getAttributionData, + _updateMapAttribution: _updateMapAttribution + }; + + var Task = L.Class.extend({ + + options: { + proxy: false, + useCors: 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 = 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); + } + + 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 Request.get.JSONP(url, params, callback, context); + } + + return Request[method](url, params, callback, context); + } + }); + + function task (options) { + return new Task(options); + } + + var Query = Task.extend({ + setters: { + 'offset': 'resultOffset', + 'limit': 'resultRecordCount', + '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) { + // instead of converting double-quotes to single quotes, pass as is, and provide a more informative message if a 400 is encountered + this.params.where = string; + 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(); + + // services hosted on ArcGIS Online also support requesting geojson directly + if (this.options.isModern || Util.isArcgisOnline(this.options.url)) { + this.params.f = 'geojson'; + + return this.request(function (error, response) { + this._trapSQLerrors(error); + callback.call(context, error, response, response); + }, this); + + // otherwise convert it in the callback then pass it on + } else { + return this.request(function (error, response) { + this._trapSQLerrors(error); + callback.call(context, error, (response && Util.responseToFeatureCollection(response)), response); + }, this); + } + }, + + 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 && 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; + }, + + _trapSQLerrors: function (error) { + if (error) { + if (error.code === '400') { + Util.warn('one common syntax error in query requests is encasing string values in double quotes instead of single quotes'); + } + } + }, + + _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 = 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 = Util.geojsonToArcGIS(geometry); + this.params.geometryType = 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 = Util.geojsonToArcGIS(geometry); + this.params.geometryType = Util.geojsonTypeToArcGIS(geometry.type); + return; + } + + // warn the user if we havn't found an appropriate object + Util.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; + } + }); + + function query (options) { + return new Query(options); + } + + var Find = 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 && Util.responseToFeatureCollection(response)), response); + }, context); + } + }); + + function find (options) { + return new Find(options); + } + + var Identify = Task.extend({ + path: 'identify', + + between: function (start, end) { + this.params.time = [start.valueOf(), end.valueOf()]; + return this; + } + }); + + function identify (options) { + return new Identify(options); + } + + var IdentifyFeatures = 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 = 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) { + // immediately invoke with an error + if (error) { + callback.call(context, error, undefined, response); + return; + + // ok no error lets just assume we have features... + } else { + var featureCollection = Util.responseToFeatureCollection(response); + response.results = response.results.reverse(); + for (var i = 0; i < featureCollection.features.length; i++) { + var feature = featureCollection.features[i]; + feature.layerId = response.results[i].layerId; + } + callback.call(context, undefined, featureCollection, response); + } + }); + } + }); + + function identifyFeatures (options) { + return new IdentifyFeatures(options); + } + + var IdentifyImage = 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 = 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; + } + + }); + + function identifyImage (params) { + return new IdentifyImage(params); + } + + var Service = L.Evented.extend({ + + options: { + proxy: false, + useCors: cors, + timeout: 0 + }, + + initialize: function (options) { + options = options || {}; + this._requestQueue = []; + this._authenticating = false; + L.Util.setOptions(this, options); + this.options.url = 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; + }, + + getTimeout: function () { + return this.options.timeout; + }, + + setTimeout: function (timeout) { + this.options.timeout = timeout; + }, + + _request: function (method, path, params, callback, context) { + this.fire('requeststart', { + url: this.options.url + path, + params: params, + method: method + }, true); + + 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 Request.get.JSONP(url, params, wrappedCallback, context); + } else { + return Request[method](url, params, wrappedCallback, context); + } + } + }, + + _createServiceCallback: function (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([method, path, params, callback, context]); + + // fire an event for users to handle and re-authenticate + this.fire('authenticationrequired', { + authenticate: L.Util.bind(this.authenticate, this) + }, true); + + // if the user has access to a callback they can handle the auth error + error.authenticate = L.Util.bind(this.authenticate, this); + } + + 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 + }, true); + } else { + this.fire('requestsuccess', { + url: this.options.url + path, + params: params, + response: response, + method: method + }, true); + } + + this.fire('requestend', { + url: this.options.url + path, + params: params, + method: method + }, true); + }, 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 = []; + } + }); + + function service (options) { + return new Service(options); + } + + var MapService = Service.extend({ + + identify: function () { + return identifyFeatures(this); + }, + + find: function () { + return find(this); + }, + + query: function () { + return query(this); + } + + }); + + function mapService (options) { + return new MapService(options); + } + + var ImageService = Service.extend({ + + query: function () { + return query(this); + }, + + identify: function () { + return identifyImage(this); + } + }); + + function imageService (options) { + return new ImageService(options); + } + + var FeatureLayerService = Service.extend({ + + options: { + idAttribute: 'OBJECTID' + }, + + query: function () { + return query(this); + }, + + addFeature: function (feature, callback, context) { + delete feature.id; + + feature = geojsonToArcGIS(feature); + + return this.post('addFeatures', { + features: [feature] + }, function (error, response) { + var result = (response && response.addResults) ? response.addResults[0] : undefined; + if (callback) { + callback.call(context, error || response.addResults[0].error, result); + } + }, context); + }, + + updateFeature: function (feature, callback, context) { + feature = 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); + }, + + deleteFeatures: function (ids, callback, context) { + return this.post('deleteFeatures', { + objectIds: ids + }, function (error, response) { + // pass back the entire array + var result = (response && response.deleteResults) ? response.deleteResults : undefined; + if (callback) { + callback.call(context, error || response.deleteResults[0].error, result); + } + }, context); + } + }); + + function featureLayerService (options) { + return new FeatureLayerService(options); + } + + var tileProtocol = (window.location.protocol !== 'https:') ? 'http:' : 'https:'; + + var BasemapLayer = L.TileLayer.extend({ + statics: { + TILES: { + Streets: { + urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 19, + subdomains: ['server', 'services'], + attribution: 'USGS, NOAA', + attributionUrl: 'https://static.arcgis.com/attribution/World_Street_Map' + } + }, + Topographic: { + urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 19, + subdomains: ['server', 'services'], + attribution: 'USGS, NOAA', + attributionUrl: 'https://static.arcgis.com/attribution/World_Topo_Map' + } + }, + Oceans: { + urlTemplate: tileProtocol + '//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 16, + subdomains: ['server', 'services'], + attribution: 'USGS, NOAA', + attributionUrl: 'https://static.arcgis.com/attribution/Ocean_Basemap' + } + }, + OceansLabels: { + urlTemplate: tileProtocol + '//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 16, + subdomains: ['server', 'services'], + pane: (pointerEvents) ? 'esri-labels' : 'tilePane' + } + }, + NationalGeographic: { + urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 16, + subdomains: ['server', 'services'], + attribution: 'National Geographic, DeLorme, HERE, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, increment P Corp.' + } + }, + DarkGray: { + urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 16, + subdomains: ['server', 'services'], + attribution: 'HERE, DeLorme, MapmyIndia, © OpenStreetMap contributors' + } + }, + DarkGrayLabels: { + urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 16, + subdomains: ['server', 'services'], + pane: (pointerEvents) ? 'esri-labels' : 'tilePane' + + } + }, + Gray: { + urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 16, + subdomains: ['server', 'services'], + attribution: 'HERE, DeLorme, MapmyIndia, © OpenStreetMap contributors' + } + }, + GrayLabels: { + urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 16, + subdomains: ['server', 'services'], + pane: (pointerEvents) ? 'esri-labels' : 'tilePane' + } + }, + Imagery: { + urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 19, + subdomains: ['server', 'services'], + attribution: '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: { + minZoom: 1, + maxZoom: 19, + subdomains: ['server', 'services'], + pane: (pointerEvents) ? 'esri-labels' : 'tilePane' + } + }, + ImageryTransportation: { + urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 19, + subdomains: ['server', 'services'], + pane: (pointerEvents) ? 'esri-labels' : 'tilePane' + } + }, + ShadedRelief: { + urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 13, + subdomains: ['server', 'services'], + attribution: 'USGS' + } + }, + ShadedReliefLabels: { + urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 12, + subdomains: ['server', 'services'], + pane: (pointerEvents) ? 'esri-labels' : 'tilePane' + } + }, + Terrain: { + urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 13, + subdomains: ['server', 'services'], + attribution: 'USGS, NOAA' + } + }, + TerrainLabels: { + urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 13, + subdomains: ['server', 'services'], + pane: (pointerEvents) ? 'esri-labels' : 'tilePane' + } + }, + USATopo: { + urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}', + options: { + minZoom: 1, + maxZoom: 15, + subdomains: ['server', 'services'], + attribution: 'USGS, National Geographic Society, i-cubed' + } + } + } + }, + + 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' && BasemapLayer.TILES[key]) { + config = 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); + + L.Util.setOptions(this, tileOptions); + + if (this.options.token) { + config.urlTemplate += ('?token=' + this.options.token); + } + + // call the initialize method on L.TileLayer to set everything up + L.TileLayer.prototype.initialize.call(this, config.urlTemplate, tileOptions); + }, + + onAdd: function (map) { + if (map.attributionControl) { + map.attributionControl.addAttribution('© Esri'); + } + + if (this.options.pane === 'esri-labels') { + this._initPane(); + } + // some basemaps can supply dynamic attribution + if (this.options.attributionUrl) { + Util._getAttributionData(this.options.attributionUrl, map); + } + map.on('moveend', Util._updateMapAttribution); + + L.TileLayer.prototype.onAdd.call(this, map); + }, + + onRemove: function (map) { + if (map.attributionControl) { + map.attributionControl.removeAttribution('© Esri'); + } + map.off('moveend', this._updateMapAttribution, this); + L.TileLayer.prototype.onRemove.call(this, map); + }, + + _initPane: function () { + if (!this._map.getPane(this.options.pane)) { + var pane = this._map.createPane(this.options.pane); + pane.style.pointerEvents = 'none'; + pane.style.zIndex = 500; + } + }, + + getAttribution: function () { + if (this.options.attribution) { + // the extra 55 pixels are for the ellipsis and leaflet's own attribution + var maxWidth = (this._map.getSize().x - 55); + var attribution = '' + this.options.attribution + ''; + } + return attribution; + } + }); + + function basemapLayer (key, options) { + return new BasemapLayer(key, options); + } + + var TiledMapLayer = L.TileLayer.extend({ + options: { + zoomOffsetAllowance: 0.1, + errorTileUrl: 'http://downloads2.esri.com/support/TechArticles/blank256.png' + }, + + statics: { + MercatorZoomLevels: { + '0': 156543.03392799999, + '1': 78271.516963999893, + '2': 39135.758482000099, + '3': 19567.879240999901, + '4': 9783.9396204999593, + '5': 4891.9698102499797, + '6': 2445.9849051249898, + '7': 1222.9924525624899, + '8': 611.49622628138002, + '9': 305.74811314055802, + '10': 152.874056570411, + '11': 76.437028285073197, + '12': 38.218514142536598, + '13': 19.109257071268299, + '14': 9.5546285356341496, + '15': 4.7773142679493699, + '16': 2.38865713397468, + '17': 1.1943285668550501, + '18': 0.59716428355981699, + '19': 0.29858214164761698, + '20': 0.14929107082381, + '21': 0.07464553541191, + '22': 0.0373227677059525, + '23': 0.0186613838529763 + } + }, + + initialize: function (options) { + options.url = cleanUrl(options.url); + options = L.Util.setOptions(this, options); + + // set the urls + this.tileUrl = options.url + 'tile/{z}/{y}/{x}'; + this.service = mapService(options); + this.service.addEventParent(this); + + var arcgisonline = new RegExp(/tiles.arcgis(online)?\.com/g); + if (arcgisonline.test(options.url)) { + this.tileUrl = this.tileUrl.replace('://tiles', '://tiles{s}'); + 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); + }, + + getTileUrl: function (tilePoint) { + return L.Util.template(this.tileUrl, L.extend({ + s: this._getSubdomain(tilePoint), + z: (this._lodMap && this._lodMap[tilePoint.z]) ? this._lodMap[tilePoint.z] : tilePoint.z, // try lod map first, then just defualt to zoom level + x: tilePoint.x, + y: tilePoint.y + }, this.options)); + }, + + createTile: function (coords, done) { + var tile = document.createElement('img'); + + L.DomEvent.on(tile, 'load', L.bind(this._tileOnLoad, this, done, tile)); + L.DomEvent.on(tile, 'error', L.bind(this._tileOnError, this, done, tile)); + + if (this.options.crossOrigin) { + tile.crossOrigin = ''; + } + + /* + Alt tag is set to empty string to keep screen readers from reading URL and for compliance reasons + http://www.w3.org/TR/WCAG20-TECHS/H67 + */ + tile.alt = ''; + + // if there is no lod map or an lod map with a proper zoom load the tile + // otherwise wait for the lod map to become available + if (!this._lodMap || (this._lodMap && this._lodMap[coords.z])) { + tile.src = this.getTileUrl(coords); + } else { + this.once('lodmap', function () { + tile.src = this.getTileUrl(coords); + }, this); + } + + return tile; + }, + + onAdd: function (map) { + if (map.options.crs === L.CRS.EPSG3857 && !this._lodMap) { + this._lodMap = {}; + this.metadata(function (error, metadata) { + if (!error) { + var sr = metadata.spatialReference.latestWkid || metadata.spatialReference.wkid; + if (sr === 102100 || sr === 3857) { + // create the zoom level data + var arcgisLODs = metadata.tileInfo.lods; + var correctResolutions = TiledMapLayer.MercatorZoomLevels; + + for (var i = 0; i < arcgisLODs.length; i++) { + var arcgisLOD = arcgisLODs[i]; + for (var ci in correctResolutions) { + var correctRes = correctResolutions[ci]; + + if (this._withinPercentage(arcgisLOD.resolution, correctRes, this.options.zoomOffsetAllowance)) { + this._lodMap[ci] = arcgisLOD.level; + break; + } + } + } + + this.fire('lodmap'); + } else { + warn('L.esri.TiledMapLayer is using a non-mercator spatial reference. Support may be available through Proj4Leaflet http://esri.github.io/esri-leaflet/examples/non-mercator-projection.html'); + } + } + }, this); + } + + L.TileLayer.prototype.onAdd.call(this, map); + }, + + metadata: function (callback, context) { + this.service.metadata(callback, context); + return this; + }, + + identify: function () { + return this.service.identify(); + }, + + find: function () { + return this.service.find(); + }, + + query: function () { + return this.service.query(); + }, + + 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; + }, + + _withinPercentage: function (a, b, percentage) { + var diff = Math.abs((a / b) - 1); + return diff < percentage; + } + }); + + function tiledMapLayer (url, options) { + return new TiledMapLayer(url, options); + } + + var Overlay = L.ImageOverlay.extend({ + onAdd: function (map) { + this._topLeft = map.getPixelBounds().min; + L.ImageOverlay.prototype.onAdd.call(this, map); + }, + _reset: function () { + if (this._map.options.crs === L.CRS.EPSG3857) { + L.ImageOverlay.prototype._reset.call(this); + } else { + L.DomUtil.setPosition(this._image, this._topLeft.subtract(this._map.getPixelOrigin())); + } + } + }); + + var RasterLayer = L.Layer.extend({ + + options: { + opacity: 1, + position: 'front', + f: 'image', + useCors: cors, + attribution: null, + interactive: false, + alt: '' + }, + + onAdd: function (map) { + this._update = L.Util.throttle(this._update, this.options.updateInterval, this); + + 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); + } + }, + + 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); + }, + + 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; + }, + + 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, contentType) { + if (this._map) { + // if no output directory has been specified for a service, MIME data will be returned + if (contentType) { + url = 'data:' + contentType + ';base64,' + url; + } + // 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 Overlay(url, bounds, { + opacity: 0, + crossOrigin: this.options.useCors, + alt: this.options.alt, + pane: this.options.pane || this.getPane(), + interactive: this.options.interactive + }).addTo(this._map); + + // once the image loads + image.once('load', function (e) { + if (this._map) { + 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 with the same bounds + // 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) && newImage._bounds.equals(this._map.getBounds())) { + 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) { + this._currentImage._map.removeLayer(this._currentImage); + return; + } + + var params = this._buildExportParams(); + + this._requestExport(params, bounds); + }, + + _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; + } + }); + + var ImageMapLayer = RasterLayer.extend({ + + options: { + updateInterval: 150, + format: 'jpgpng', + transparent: true, + f: 'json' + }, + + query: function () { + return this.service.query(); + }, + + identify: function () { + return this.service.identify(); + }, + + initialize: function (options) { + options.url = cleanUrl(options.url); + this.service = imageService(options); + this.service.addEventParent(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) { + if (error) { return; } // we really can't do anything here but authenticate or requesterror will fire + 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); + + // ensure that we don't ask ArcGIS Server for a taller image than we have actual map displaying + var top = this._map.latLngToLayerPoint(bounds._northEast); + var bottom = this._map.latLngToLayerPoint(bounds._southWest); + + if (top.y > 0 || bottom.y < size.y) { + size.y = bottom.y - top.y; + } + + var sr = parseInt(this._map.options.crs.code.split(':')[1], 10); + + var params = { + bbox: [sw.x, sw.y, ne.x, ne.y].join(','), + size: size.x + ',' + size.y, + format: this.options.format, + transparent: this.options.transparent, + bboxSR: sr, + imageSR: sr + }; + + 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.request('exportImage', params, function (error, response) { + if (error) { return; } // we really can't do anything here but authenticate or requesterror will fire + this._renderImage(response.href, bounds); + }, this); + } else { + params.f = 'image'; + this._renderImage(this.options.url + 'exportImage' + L.Util.getParamString(params), bounds); + } + } + }); + + function imageMapLayer (url, options) { + return new ImageMapLayer(url, options); + } + + var DynamicMapLayer = RasterLayer.extend({ + + options: { + updateInterval: 150, + layers: false, + layerDefs: false, + timeOptions: false, + format: 'png24', + transparent: true, + f: 'json' + }, + + initialize: function (options) { + options.url = cleanUrl(options.url); + this.service = mapService(options); + this.service.addEventParent(this); + + if ((options.proxy || options.token) && options.f !== 'json') { + options.f = 'json'; + } + L.Util.setOptions(this, options); + }, + + getDynamicLayers: function () { + return this.options.dynamicLayers; + }, + + setDynamicLayers: function (dynamicLayers) { + this.options.dynamicLayers = dynamicLayers; + this._update(); + return this; + }, + + 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) { + if (error) { return; } // we really can't do anything here but authenticate or requesterror will fire + 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.getNorthEast()); + var sw = this._map.options.crs.project(bounds.getSouthWest()); + var sr = parseInt(this._map.options.crs.code.split(':')[1], 10); + + // ensure that we don't ask ArcGIS Server for a taller image than we have actual map displaying + var top = this._map.latLngToLayerPoint(bounds._northEast); + var bottom = this._map.latLngToLayerPoint(bounds._southWest); + + if (top.y > 0 || bottom.y < size.y) { + size.y = bottom.y - top.y; + } + + 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: sr, + imageSR: sr + }; + + if (this.options.dynamicLayers) { + params.dynamicLayers = this.options.dynamicLayers; + } + + 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.request('export', params, function (error, response) { + if (error) { return; } // we really can't do anything here but authenticate or requesterror will fire + if (response.href) { + this._renderImage(response.href, bounds); + } else { + this._renderImage(response.imageData, bounds, response.contentType); + } + }, this); + } else { + params.f = 'image'; + this._renderImage(this.options.url + 'export' + L.Util.getParamString(params), bounds); + } + } + }); + + function dynamicMapLayer (url, options) { + return new DynamicMapLayer(url, options); + } + + var VirtualGrid = L.Layer.extend({ + + options: { + cellSize: 512, + updateInterval: 150 + }, + + initialize: function (options) { + options = L.setOptions(this, options); + this._zooming = false; + }, + + onAdd: function (map) { + this._map = map; + this._update = L.Util.throttle(this._update, this.options.updateInterval, this); + this._reset(); + this._update(); + }, + + onRemove: function () { + this._map.removeEventListener(this.getEvents(), this); + this._removeCells(); + }, + + getEvents: function () { + var events = { + moveend: this._update, + zoomstart: this._zoomstart, + zoomend: this._reset + }; + + return events; + }, + + addTo: function (map) { + map.addLayer(this); + return this; + }, + + removeFrom: function (map) { + map.removeLayer(this); + return this; + }, + + _zoomstart: function () { + this._zooming = true; + }, + + _reset: function () { + this._removeCells(); + + this._cells = {}; + this._activeCells = {}; + this._cellsToLoad = 0; + this._cellsTotal = 0; + this._cellNumBounds = this._getCellNumBounds(); + + this._resetWrap(); + this._zooming = false; + }, + + _resetWrap: function () { + var map = this._map; + var 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(); + var cellSize = this._getCellSize(); + + // cell coordinates range for the current view + var cellBounds = L.bounds( + bounds.min.divideBy(cellSize).floor(), + bounds.max.divideBy(cellSize).floor()); + + this._removeOtherCells(cellBounds); + this._addCells(cellBounds); + + this.fire('cellsupdated'); + }, + + _addCells: function (bounds) { + var queue = []; + var center = bounds.getCenter(); + var 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 = L.point(i, j); + coords.z = zoom; + + if (this._isValidCell(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]); + } + }, + + _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; + var cellSize = this.options.cellSize; + var nwPoint = coords.multiplyBy(cellSize); + var sePoint = nwPoint.add([cellSize, cellSize]); + var nw = map.wrapLatLng(map.unproject(nwPoint, coords.z)); + var se = map.wrapLatLng(map.unproject(sePoint, coords.z)); + + return 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(':'); + var x = parseInt(kArr[0], 10); + var y = parseInt(kArr[1], 10); + + return 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 + _getCellNumBounds: function () { + var bounds = this._map.getPixelWorldBounds(); + var size = this._getCellSize(); + + return bounds ? L.bounds( + bounds.min.divideBy(size).floor(), + bounds.max.divideBy(size).ceil().subtract([1, 1])) : null; + } + }); + + function BinarySearchIndex (values) { + this.values = [].concat(values || []); + } + + BinarySearchIndex.prototype.query = function (value) { + var index = this.getIndex(value); + return this.values[index]; + }; + + BinarySearchIndex.prototype.getIndex = function getIndex (value) { + if (this.dirty) { + this.sort(); + } + + var minIndex = 0; + var maxIndex = this.values.length - 1; + var currentIndex; + var currentElement; + + while (minIndex <= maxIndex) { + currentIndex = (minIndex + maxIndex) / 2 | 0; + currentElement = this.values[Math.round(currentIndex)]; + if (+currentElement.value < +value) { + minIndex = currentIndex + 1; + } else if (+currentElement.value > +value) { + maxIndex = currentIndex - 1; + } else { + return currentIndex; + } + } + + return Math.abs(~maxIndex); + }; + + BinarySearchIndex.prototype.between = function between (start, end) { + var startIndex = this.getIndex(start); + var endIndex = this.getIndex(end); + + if (startIndex === 0 && endIndex === 0) { + return []; + } + + while (this.values[startIndex - 1] && this.values[startIndex - 1].value === start) { + startIndex--; + } + + while (this.values[endIndex + 1] && this.values[endIndex + 1].value === end) { + endIndex++; + } + + if (this.values[endIndex] && this.values[endIndex].value === end && this.values[endIndex + 1]) { + endIndex++; + } + + return this.values.slice(startIndex, endIndex); + }; + + BinarySearchIndex.prototype.insert = function insert (item) { + this.values.splice(this.getIndex(item.value), 0, item); + return this; + }; + + BinarySearchIndex.prototype.bulkAdd = function bulkAdd (items, sort) { + this.values = this.values.concat([].concat(items || [])); + + if (sort) { + this.sort(); + } else { + this.dirty = true; + } + + return this; + }; + + BinarySearchIndex.prototype.sort = function sort () { + this.values.sort(function (a, b) { + return +b.value - +a.value; + }).reverse(); + this.dirty = false; + return this; + }; + + var FeatureManager = VirtualGrid.extend({ + /** + * Options + */ + + options: { + attribution: null, + where: '1=1', + fields: ['*'], + from: false, + to: false, + timeField: false, + timeFilterMode: 'server', + simplifyFactor: 0, + precision: 6 + }, + + /** + * Constructor + */ + + initialize: function (options) { + VirtualGrid.prototype.initialize.call(this, options); + + options.url = cleanUrl(options.url); + options = L.setOptions(this, options); + + this.service = featureLayerService(options); + this.service.addEventParent(this); + + // use case insensitive regex to look for common fieldnames used for indexing + 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) { + 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.'); + } + } + + 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; + }, + + /** + * Layer Interface + */ + + onAdd: function (map) { + // check to see whether service is 10.4 or above (and can emit GeoJSON natively) + this.service.metadata(function (error, metadata) { + var supportedFormats = metadata.supportedQueryFormats; + if (supportedFormats && supportedFormats.indexOf('geoJSON') !== -1) { + this.service.options.isModern = true; + } + }, this); + + map.on('zoomend', this._handleZoomChange, this); + + return VirtualGrid.prototype.onAdd.call(this, map); + }, + + onRemove: function (map) { + map.off('zoomend', this._handleZoomChange, this); + + return VirtualGrid.prototype.onRemove.call(this, map); + }, + + getAttribution: function () { + return this.options.attribution; + }, + + /** + * Feature Management + */ + + 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 + }, true); + } + + return this._buildQuery(bounds).run(function (error, featureCollection, response) { + if (response && response.exceededTransferLimit) { + this.fire('drawlimitexceeded'); + } + + // no error, features + if (!error && featureCollection && featureCollection.features.length) { + // schedule adding features until the next animation frame + L.Util.requestAnimFrame(L.Util.bind(function () { + this._addFeatures(featureCollection.features, coords); + this._postProcessFeatures(bounds); + }, this)); + } + + // no error, no features + if (!error && featureCollection && !featureCollection.features.length) { + this._postProcessFeatures(bounds); + } + + if (error) { + this._postProcessFeatures(bounds); + } + + if (callback) { + callback.call(this, error, featureCollection); + } + }, this); + }, + + _postProcessFeatures: function (bounds) { + // deincriment the request counter now that we have processed features + this._activeRequests--; + + // if there are no more active requests fire a load event for this view + if (this._activeRequests <= 0) { + this.fire('load', { + bounds: bounds + }); + } + }, + + _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); + } + + // need to PR removal of the logic below too... + // https://github.com/patrickarlt/leaflet-virtual-grid/blob/master/src/virtual-grid.js#L100-L102 + + 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 newSnapshot = []; + 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--) { + newSnapshot.push(featureCollection.features[i].id); + } + } + + pendingRequests--; + + if (pendingRequests <= 0) { + this._currentSnapshot = newSnapshot; + // schedule adding features for the next animation frame + L.Util.requestAnimFrame(L.Util.bind(function () { + this.removeLayers(oldSnapshot); + this.addLayers(newSnapshot); + 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); + } + } + + return this; + }, + + refresh: function () { + for (var key in this._activeCells) { + var coords = this._keyToCellCoords(key); + var bounds = this._cellCoordsToBounds(coords); + this._requestFeatures(bounds, key); + } + + if (this.redraw) { + this.once('load', function () { + this.eachFeature(function (layer) { + this._redraw(layer.feature.id); + }, this); + }, this); + } + }, + + _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 + L.Util.requestAnimFrame(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)); + } + }, + + _visibleZoom: function () { + // check to see whether the current zoom level of the map is within the optional limit defined for the FeatureLayer + if (!this._map) { + return false; + } + var zoom = this._map.getZoom(); + if (zoom > this.options.maxZoom || zoom < this.options.minZoom) { + return false; + } else { return true; } + }, + + _handleZoomChange: function () { + if (!this._visibleZoom()) { + this.removeLayers(this._currentSnapshot); + this._currentSnapshot = []; + } else { + /* + for every cell in this._activeCells + 1. Get the cache key for the coords of the cell + 2. If this._cache[key] exists it will be an array of feature IDs. + 3. Call this.addLayers(this._cache[key]) to instruct the feature layer to add the layers back. + */ + for (var i in this._activeCells) { + var coords = this._activeCells[i].coords; + var key = this._cacheKey(coords); + if (this._cache[key]) { + this.addLayers(this._cache[key]); + } + } + } + }, + + /** + * 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(); + }, + + _getMetadata: function (callback) { + if (this._metadata) { + var error; + callback(error, this._metadata); + } else { + this.metadata(L.Util.bind(function (error, response) { + this._metadata = response; + callback(error, this._metadata); + }, this)); + } + }, + + addFeature: function (feature, callback, context) { + this._getMetadata(L.Util.bind(function (error, metadata) { + if (error) { + if (callback) { callback.call(this, error, null); } + return; + } + + this.service.addFeature(feature, L.Util.bind(function (error, response) { + if (!error) { + // assign ID from result to appropriate objectid field from service metadata + feature.properties[metadata.objectIdField] = response.objectId; + + // we also need to update the geojson id for createLayers() to function + feature.id = response.objectId; + this.createLayers([feature]); + } + + if (callback) { + callback.call(context, error, response); + } + }, this)); + }, this)); + }, + + updateFeature: function (feature, callback, context) { + this.service.updateFeature(feature, function (error, response) { + if (!error) { + this.removeLayers([feature.id], true); + this.createLayers([feature]); + } + + if (callback) { + callback.call(context, error, response); + } + }, this); + }, + + deleteFeature: function (id, callback, context) { + this.service.deleteFeature(id, function (error, response) { + if (!error && response.objectId) { + this.removeLayers([response.objectId], true); + } + if (callback) { + callback.call(context, error, response); + } + }, this); + }, + + deleteFeatures: function (ids, callback, context) { + return this.service.deleteFeatures(ids, function (error, response) { + if (!error && response.length > 0) { + for (var i = 0; i < response.length; i++) { + this.removeLayers([response[i].objectId], true); + } + } + if (callback) { + callback.call(context, error, response); + } + }, this); + } + }); + + var FeatureLayer = FeatureManager.extend({ + + options: { + cacheLayers: true + }, + + /** + * Constructor + */ + initialize: function (options) { + FeatureManager.prototype.initialize.call(this, options); + this._originalStyle = this.options.style; + this._layers = {}; + }, + + /** + * Layer Interface + */ + + onRemove: function (map) { + for (var i in this._layers) { + map.removeLayer(this._layers[i]); + // trigger the event when the entire featureLayer is removed from the map + this.fire('removefeature', { + feature: this._layers[i].feature, + permanent: false + }, true); + } + + return FeatureManager.prototype.onRemove.call(this, map); + }, + + createNewLayer: function (geojson) { + var layer = L.GeoJSON.geometryToLayer(geojson, this.options); + layer.defaultOptions = layer.options; + return layer; + }, + + _updateLayer: function (layer, geojson) { + // convert the geojson coordinates into a Leaflet LatLng array/nested arrays + // pass it to setLatLngs to update layer geometries + var latlngs = []; + var coordsToLatLng = this.options.coordsToLatLng || L.GeoJSON.coordsToLatLng; + + // copy new attributes, if present + if (geojson.properties) { + layer.feature.properties = geojson.properties; + } + + switch (geojson.geometry.type) { + case 'Point': + latlngs = L.GeoJSON.coordsToLatLng(geojson.geometry.coordinates); + layer.setLatLng(latlngs); + break; + case 'LineString': + latlngs = L.GeoJSON.coordsToLatLngs(geojson.geometry.coordinates, 0, coordsToLatLng); + layer.setLatLngs(latlngs); + break; + case 'MultiLineString': + latlngs = L.GeoJSON.coordsToLatLngs(geojson.geometry.coordinates, 1, coordsToLatLng); + layer.setLatLngs(latlngs); + break; + case 'Polygon': + latlngs = L.GeoJSON.coordsToLatLngs(geojson.geometry.coordinates, 1, coordsToLatLng); + layer.setLatLngs(latlngs); + break; + case 'MultiPolygon': + latlngs = L.GeoJSON.coordsToLatLngs(geojson.geometry.coordinates, 2, coordsToLatLng); + layer.setLatLngs(latlngs); + break; + } + }, + + /** + * Feature Management 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 (this._visibleZoom() && layer && !this._map.hasLayer(layer)) { + this._map.addLayer(layer); + this.fire('addfeature', { + feature: layer.feature + }, true); + } + + // update geometry if necessary + if (layer && this.options.simplifyFactor > 0 && (layer.setLatLngs || layer.setLatLng)) { + this._updateLayer(layer, geojson); + } + + if (!layer) { + newLayer = this.createNewLayer(geojson); + newLayer.feature = geojson; + + // bubble events from individual layers to the feature layer + newLayer.addEventParent(this); + + if (this.options.onEachFeature) { + this.options.onEachFeature(newLayer.feature, newLayer); + } + + // cache the layer + this._layers[newLayer.feature.id] = newLayer; + + // style the layer + this.setFeatureStyle(newLayer.feature.id, this.options.style); + + this.fire('createfeature', { + feature: newLayer.feature + }, true); + + // add the layer if the current zoom level is inside the range defined for the layer, it is within the current time bounds or our layer is not time enabled + if (this._visibleZoom() && (!this.options.timeField || (this.options.timeField && this._featureWithinTimeRange(geojson)))) { + this.fire('addfeature', { + feature: newLayer.feature + }, true); + 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 + }, true); + 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 + }, true); + this._map.removeLayer(layer); + } + if (layer && permanent) { + delete this._layers[id]; + } + } + }, + + cellEnter: function (bounds, coords) { + if (!this._zooming && this._map) { + L.Util.requestAnimFrame(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) { + L.Util.requestAnimFrame(L.Util.bind(function () { + if (this._map) { + 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 () { + this.options.style = this._originalStyle; + this.eachFeature(function (layer) { + this.resetFeatureStyle(layer.feature.id); + }, this); + return this; + }, + + setStyle: function (style) { + this.options.style = style; + this.eachFeature(function (layer) { + this.setFeatureStyle(layer.feature.id, style); + }, this); + return this; + }, + + resetFeatureStyle: function (id) { + var layer = this._layers[id]; + var style = this._originalStyle || L.Path.prototype.options; + if (layer) { + L.Util.extend(layer.options, layer.defaultOptions); + this.setFeatureStyle(id, style); + } + return this; + }, + + setFeatureStyle: function (id, style) { + var layer = this._layers[id]; + if (typeof style === 'function') { + style = style(layer.feature); + } + if (layer.setStyle) { + layer.setStyle(style); + } + 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]; + }, + + bringToBack: function () { + this.eachFeature(function (layer) { + if (layer.bringToBack) { + layer.bringToBack(); + } + }); + }, + + bringToFront: function () { + this.eachFeature(function (layer) { + if (layer.bringToFront) { + layer.bringToFront(); + } + }); + }, + + redraw: function (id) { + if (id) { + this._redraw(id); + } + return this; + }, + + _redraw: function (id) { + var layer = this._layers[id]; + var geojson = layer.feature; + + // if this looks like a marker + if (layer && layer.setIcon && this.options.pointToLayer) { + // update custom symbology, if necessary + if (this.options.pointToLayer) { + var getIcon = this.options.pointToLayer(geojson, L.latLng(geojson.geometry.coordinates[1], geojson.geometry.coordinates[0])); + var updatedIcon = getIcon.options.icon; + layer.setIcon(updatedIcon); + } + } + + // looks like a vector marker (circleMarker) + if (layer && layer.setStyle && this.options.pointToLayer) { + var getStyle = this.options.pointToLayer(geojson, L.latLng(geojson.geometry.coordinates[1], geojson.geometry.coordinates[0])); + var updatedStyle = getStyle.options; + this.setFeatureStyle(geojson.id, updatedStyle); + } + + // looks like a path (polygon/polyline) + if (layer && layer.setStyle && this.options.style) { + this.resetStyle(geojson.id); + } + } + }); + + function featureLayer (options) { + return new FeatureLayer(options); + } + + exports.VERSION = version; + exports.Support = Support; + exports.Util = Util; + exports.get = get; + exports.post = xmlHttpPost; + exports.request = request; + exports.Task = Task; + exports.task = task; + exports.Query = Query; + exports.query = query; + exports.Find = Find; + exports.find = find; + exports.Identify = Identify; + exports.identify = identify; + exports.IdentifyFeatures = IdentifyFeatures; + exports.identifyFeatures = identifyFeatures; + exports.IdentifyImage = IdentifyImage; + exports.identifyImage = identifyImage; + exports.Service = Service; + exports.service = service; + exports.MapService = MapService; + exports.mapService = mapService; + exports.ImageService = ImageService; + exports.imageService = imageService; + exports.FeatureLayerService = FeatureLayerService; + exports.featureLayerService = featureLayerService; + exports.BasemapLayer = BasemapLayer; + exports.basemapLayer = basemapLayer; + exports.TiledMapLayer = TiledMapLayer; + exports.tiledMapLayer = tiledMapLayer; + exports.RasterLayer = RasterLayer; + exports.ImageMapLayer = ImageMapLayer; + exports.imageMapLayer = imageMapLayer; + exports.DynamicMapLayer = DynamicMapLayer; + exports.dynamicMapLayer = dynamicMapLayer; + exports.FeatureManager = FeatureManager; + exports.FeatureLayer = FeatureLayer; + exports.featureLayer = featureLayer; + +})); +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXNyaS1sZWFmbGV0LWRlYnVnLmpzIiwic291cmNlcyI6WyIuLi9wYWNrYWdlLmpzb24iLCIuLi9zcmMvU3VwcG9ydC5qcyIsIi4uL3NyYy9SZXF1ZXN0LmpzIiwiLi4vbm9kZV9tb2R1bGVzL2FyY2dpcy10by1nZW9qc29uLXV0aWxzL2luZGV4LmpzIiwiLi4vc3JjL1V0aWwuanMiLCIuLi9zcmMvVGFza3MvVGFzay5qcyIsIi4uL3NyYy9UYXNrcy9RdWVyeS5qcyIsIi4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5fS97eH0nLFxuICAgICAgICBvcHRpb25zOiB7XG4gICAgICAgICAgbWluWm9vbTogMSxcbiAgICAgICAgICBtYXhab29tOiAxNixcbiAgICAgICAgICBzdWJkb21haW5zOiBbJ3NlcnZlcicsICdzZXJ2aWNlcyddLFxuICAgICAgICAgIGF0dHJpYnV0aW9uOiAnSEVSRSwgRGVMb3JtZSwgTWFwbXlJbmRpYSwgJmNvcHk7IE9wZW5TdHJlZXRNYXAgY29udHJpYnV0b3JzJ1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgRGFya0dyYXlMYWJlbHM6IHtcbiAgICAgICAgdXJsVGVtcGxhdGU6IHRpbGVQcm90b2NvbCArICcvL3tzfS5hcmNnaXNvbmxpbmUuY29tL0FyY0dJUy9yZXN0L3NlcnZpY2VzL0NhbnZhcy9Xb3JsZF9EYXJrX0dyYXlfUmVmZXJlbmNlL01hcFNlcnZlci90aWxlL3t6fS97eX0ve3h9JyxcbiAgICAgICAgb3B0aW9uczoge1xuICAgICAgICAgIG1pblpvb206IDEsXG4gICAgICAgICAgbWF4Wm9vbTogMTYsXG4gICAgICAgICAgc3ViZG9tYWluczogWydzZXJ2ZXInLCAnc2VydmljZXMnXSxcbiAgICAgICAgICBwYW5lOiAocG9pbnRlckV2ZW50cykgPyAnZXNyaS1sYWJlbHMnIDogJ3RpbGVQYW5lJ1xuXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBHcmF5OiB7XG4gICAgICAgIHVybFRlbXBsYXRlOiB0aWxlUHJvdG9jb2wgKyAnLy97c30uYXJjZ2lzb25saW5lLmNvbS9BcmNHSVMvcmVzdC9zZXJ2aWNlcy9DYW52YXMvV29ybGRfTGlnaHRfR3JheV9CYXNlL01hcFNlcnZlci90aWxlL3t6fS97eX0ve3h9JyxcbiAgICAgICAgb3B0aW9uczoge1xuICAgICAgICAgIG1pblpvb206IDEsXG4gICAgICAgICAgbWF4Wm9vbTogMTYsXG4gICAgICAgICAgc3ViZG9tYWluczogWydzZ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cbiAgICAgICAgb3B0aW9uczoge1xuICAgICAgICAgIG1pblpvb206IDEsXG4gICAgICAgICAgbWF4Wm9vbTogMTMsXG4gICAgICAgICAgc3ViZG9tYWluczogWydzZXJ2ZXInLCAnc2VydmljZXMnXSxcbiAgICAgICAgICBhdHRyaWJ1dGlvbjogJ1VTR1MsIE5PQUEnXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBUZXJyYWluTGFiZWxzOiB7XG4gICAgICAgIHVybFRlbXBsYXRlOiB0aWxlUHJvdG9jb2wgKyAnLy97c30uYXJjZ2lzb25saW5lLmNvbS9BcmNHSVMvcmVzdC9zZXJ2aWNlcy9SZWZlcmVuY2UvV29ybGRfUmVmZXJlbmNlX092ZXJsYXkvTWFwU2VydmVyL3RpbGUve3p9L3t5fS97eH0nLFxuICAgICAgICBvcHRpb25zOiB7XG4gICAgICAgICAgbWluWm9vbTogMSxcbiAgICAgICAgICBtYXhab29tOiAxMyxcbiAgICAgICAgICBzdWJkb21haW5zOiBbJ3NlcnZlcicsICdzZXJ2aWNlcyddLFxuICAgICAgICAgIHBhbmU6IChwb2ludGVyRXZlbnRzKSA/ICdlc3JpLWxhYmVscycgOiAndGlsZVBhbmUnXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBVU0FUb3BvOiB7XG4gICAgICAgIHVybFRlbXBsYXRlOiB0aWxlUHJvdG9jb2wgKyAnLy97c30uYXJjZ2lzb25saW5lLmNvbS9BcmNHSVMvcmVzdC9zZXJ2aWNlcy9VU0FfVG9wb19NYXBzL01hcFNlcnZlci90aWxlL3t6fS97eX0ve3h9JyxcbiAgICAgICAgb3B0aW9uczoge1xuICAgICAgICAgIG1pblpvb206IDEsXG4gICAgICAgICAgbWF4Wm9vbTogMTUsXG4gICAgICAgICAgc3ViZG9tYWluczogWydzZXJ2ZXInLCAnc2VydmljZXMnXSxcbiAgICAgICAgICBhdHRyaWJ1dGlvbjogJ1VTR1MsIE5hdGlvbmFsIEdlb2dyYXBoaWMg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1lcmNhdG9yWm9vbUxldmVscztcblxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhcmNnaXNMT0RzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgIHZhciBhcmNnaXNMT0QgPSBhcmNnaXNMT0RzW2ldO1xuICAgICAgICAgICAgICBmb3IgKHZhciBjaSBpbiBjb3JyZWN0UmVzb2x1dGlvbnMpIHtcbiAgICAgICAgICAgICAgICB2YXIgY29ycmVjdFJlcyA9IGNvcnJlY3RSZXNvbHV0aW9uc1tjaV07XG5cbiAgICAgICAgICAgICAgICBpZiAodGhpcy5fd2l0aGluUGVyY2VudGFnZShhcmNnaXNMT0QucmVzb2x1dGlvbiwgY29ycmVjdFJlcywgdGhpcy5vcHRpb25zLnpvb21PZmZzZXRBbGxvd2FuY2UpKSB7XG4gICAgICAgICAgICAgICAgICB0aGlzLl9sb2RNYXBbY2ldID0gYXJjZ2lzTE9ELmxldmVsO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMuZmlyZSgnbG9kbWFwJyk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHdhcm4oJ0wuZXNyaS5UaWxlZE1hcExheWVyIGlzIHVzaW5nIGEgbm9uLW1lcmNhdG9yIHNwYXRpYWwgcmVmZXJlbmNlLiBTdXBwb3J0IG1heSBiZSBhdmFpbGFibGUgdGhyb3VnaCBQcm9qNExlYWZsZXQgaHR0cDovL2VzcmkuZ2l0aHViLmlvL2VzcmktbGVhZmxldC9leGFtcGxlcy9ub24tbWVyY2F0b3ItcHJvamVjdGlvbi5odG1sJyk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9LCB0aGlzKTtcbiAgICB9XG5cbiAgICBMLlRpbGVMYXllci5wcm90b3R5cGUub25BZGQuY2FsbCh0aGlzLCBtYXApO1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MuYnJpbmdUb0Zyb250KCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB0aGlzLmJyaW5nVG9CYWNrKCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICh0aGlzLl9tYXAgJiYgdGhpcy5fY3VycmVudEltYWdlLl9tYXApIHtcbiAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEltYWdlLnNldE9wYWNpdHkodGhpcy5vcHRpb25zLm9wYWNpdHkpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEltYWdlLl9tYXAucmVtb3ZlTGF5ZXIodGhpcy5fY3VycmVudEltYWdlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKG9sZEltYWdlICYmIHRoaXMuX21hcCkge1xuICAgICAgICAgICAgICB0aGlzLl9tYXAucmVtb3ZlTGF5ZXIob2xkSW1hZ2UpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAob2xkSW1hZ2UgJiYgb2xkSW1hZ2UuX21hcCkge1xuICAgICAgICAgICAgICBvbGRJbWFnZS5fbWFwLnJlbW92ZUxheWVyKG9sZEltYWdlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5fbWFwLnJlbW92ZUxheWVyKG5ld0ltYWdlKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmZpcmUoJ2xvYWQnLCB7XG4gICAgICAgICAgYm91bmRzOiBib3VuZHNcbiAgICAgICAgfSk7XG4gICAgICB9LCB0aGlzKTtcblxuICAgICAgdGhpcy5maXJlKCdsb2FkaW5nJywge1xuICAgICAgICBib3VuZHM6IGJvdW5kc1xuICAgICAgfSk7XG4gICAgfVxuICB9LFxuXG4gIF91cGRhdGU6IGZ1bmN0aW9uICgpIHtcbiAgICBpZiAoIXRoaXMuX21hcCkge1xuICAgICAg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aGlzLl9hY3RpdmVDZWxsc1tjZWxsS2V5XSAmJiBsYXllcnMpIHtcbiAgICAgICAgICAgIHZhciByZW1vdmFibGUgPSB0cnVlO1xuXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxheWVycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICB2YXIgbGF5ZXIgPSB0aGlzLl9sYXllcnNbbGF5ZXJzW2ldXTtcbiAgICAgICAgICAgICAgaWYgKGxheWVyICYmIGxheWVyLmdldEJvdW5kcyAmJiBtYXBCb3VuZHMuaW50ZXJzZWN0cyhsYXllci5nZXRCb3VuZHMoKSkpIHtcbiAgICAgICAgICAgICAgICByZW1vdmFibGUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAocmVtb3ZhYmxlKSB7XG4gICAgICAgICAgICAgIHRoaXMucmVtb3ZlTGF5ZXJzKGxheWVycywgIXRoaXMub3B0aW9ucy5jYWNoZUxheWVycyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICghdGhpcy5vcHRpb25zLmNhY2hlTGF5ZXJzICYmIHJlbW92YWJsZSkge1xuICAgICAgICAgICAgICBkZWxldGUgdGhpcy5fY2FjaGVbY2FjaGVLZXldO1xuICAgICAgICAgICAgICBkZWxldGUgdGhpcy5fY2VsbHNbY2VsbEtleV07XG4gICAgICAgICAgICAgIGRlbGV0ZSB0aGlzLl9hY3RpdmVDZWxsc1tjZWxsS2V5XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0sIHRoaXMpKTtcbiAgICB9XG4gIH0sXG5cbiAgLyoqXG4gICAqIFN0eWxpbmcgTWV0aG9kc1xuICAgKi9cblxuICByZXNldFN0eWxlOiBmdW5jdGlvbiAoKSB7XG4gICAgdGhpcy5vcHRpb25zLnN0eWxlID0gdGhpcy5fb3JpZ2luYWxTdHlsZTtcbiAgICB0a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 16 2016 08:03:57 GMT-0700 (PDT) + * Copyright (c) 2016 Environmental Systems Research Institute, Inc. + * Apache-2.0 */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("leaflet")):"function"==typeof define&&define.amd?define(["exports","leaflet"],e):e((t.L=t.L||{},t.L.esri=t.L.esri||{}),t.L)}(this,function(t,e){"use strict";function i(t){var e="";t.f=t.f||"json";for(var i in t)if(t.hasOwnProperty(i)){var s,r=t[i],n=Object.prototype.toString.call(r);e.length&&(e+="&"),s="[object Array]"===n?"[object Object]"===Object.prototype.toString.call(r[0])?JSON.stringify(r):r.join(","):"[object Object]"===n?JSON.stringify(r):"[object Date]"===n?r.valueOf():r,e+=encodeURIComponent(i)+"="+encodeURIComponent(s)}return e}function s(t,i){var s=new window.XMLHttpRequest;return s.onerror=function(r){s.onreadystatechange=e.Util.falseFn,t.call(i,{error:{code:500,message:"XMLHttpRequest error"}},null)},s.onreadystatechange=function(){var r,n;if(4===s.readyState){try{r=JSON.parse(s.responseText)}catch(t){r=null,n={code:500,message:"Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error."}}!n&&r.error&&(n=r.error,r=null),s.onerror=e.Util.falseFn,t.call(i,n,r)}},s.ontimeout=function(){this.onerror()},s}function r(t,e,r,n){var o=s(r,n);return o.open("POST",t),"undefined"!=typeof n&&null!==n&&"undefined"!=typeof n.options&&(o.timeout=n.options.timeout),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.send(i(e)),o}function n(t,e,r,n){var o=s(r,n);return o.open("GET",t+"?"+i(e),!0),"undefined"!=typeof n&&null!==n&&"undefined"!=typeof n.options&&(o.timeout=n.options.timeout),o.send(null),o}function o(t,e,r,n){var o=i(e),u=s(r,n),l=(t+"?"+o).length;if(l<=2e3&&$.cors?u.open("GET",t+"?"+o):l>2e3&&$.cors&&(u.open("POST",t),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded")),"undefined"!=typeof n&&null!==n&&"undefined"!=typeof n.options&&(u.timeout=n.options.timeout),l<=2e3&&$.cors)u.send(null);else{if(!(l>2e3&&$.cors))return l<=2e3&&!$.cors?a(t,e,r,n):void F("a request to "+t+" 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");u.send(o)}return u}function a(t,s,r,n){window._EsriLeafletCallbacks=window._EsriLeafletCallbacks||{};var o="c"+Y;s.callback="window._EsriLeafletCallbacks."+o,window._EsriLeafletCallbacks[o]=function(t){if(window._EsriLeafletCallbacks[o]!==!0){var e,i=Object.prototype.toString.call(t);"[object Object]"!==i&&"[object Array]"!==i&&(e={error:{code:500,message:"Expected array or object as JSONP response"}},t=null),!e&&t.error&&(e=t,t=null),r.call(n,e,t),window._EsriLeafletCallbacks[o]=!0}};var a=e.DomUtil.create("script",null,document.body);return a.type="text/javascript",a.src=t+"?"+i(s),a.id=o,Y++,{id:o,url:a.src,abort:function(){window._EsriLeafletCallbacks._callback[o]({code:0,message:"Request aborted."})}}}function u(t,e){for(var i=0;i=0}function c(t,e,i,s){var r=(s[0]-i[0])*(t[1]-i[1])-(s[1]-i[1])*(t[0]-i[0]),n=(e[0]-t[0])*(t[1]-i[1])-(e[1]-t[1])*(t[0]-i[0]),o=(s[1]-i[1])*(e[0]-t[0])-(s[0]-i[0])*(e[1]-t[1]);if(0!==o){var a=r/o,u=n/o;if(a>=0&&a<=1&&u>=0&&u<=1)return!0}return!1}function p(t,e){for(var i=0;i=0;e--)if(i=r[e][0],m(i,s)){r[e].push(s),d=!0;break}d||c.push(s)}for(;c.length;){s=c.pop();var f=!1;for(e=r.length-1;e>=0;e--)if(i=r[e][0],p(i,s)){r[e].push(s),f=!0;break}f||r.push([s.reverse()])}return 1===r.length?{type:"Polygon",coordinates:r[0]}:{type:"MultiPolygon",coordinates:r}}function y(t){var e=[],i=t.slice(0),s=l(i.shift().slice(0));if(s.length>=4){h(s)||s.reverse(),e.push(s);for(var r=0;r=4&&(h(n)&&n.reverse(),e.push(n))}}return e}function g(t){for(var e=[],i=0;i=0;r--){var n=s[r].slice(0);e.push(n)}return e}function v(t){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function _(t,e){var i={};return"number"==typeof t.x&&"number"==typeof t.y&&(i.type="Point",i.coordinates=[t.x,t.y]),t.points&&(i.type="MultiPoint",i.coordinates=t.points.slice(0)),t.paths&&(1===t.paths.length?(i.type="LineString",i.coordinates=t.paths[0].slice(0)):(i.type="MultiLineString",i.coordinates=t.paths.slice(0))),t.rings&&(i=f(t.rings.slice(0))),(t.geometry||t.attributes)&&(i.type="Feature",i.geometry=t.geometry?_(t.geometry):null,i.properties=t.attributes?v(t.attributes):null,t.attributes&&(i.id=t.attributes[e]||t.attributes.OBJECTID||t.attributes.FID)),i}function b(t,e){e=e||"OBJECTID";var i,s={wkid:4326},r={};switch(t.type){case"Point":r.x=t.coordinates[0],r.y=t.coordinates[1],r.spatialReference=s;break;case"MultiPoint":r.points=t.coordinates.slice(0),r.spatialReference=s;break;case"LineString":r.paths=[t.coordinates.slice(0)],r.spatialReference=s;break;case"MultiLineString":r.paths=t.coordinates.slice(0),r.spatialReference=s;break;case"Polygon":r.rings=y(t.coordinates.slice(0)),r.spatialReference=s;break;case"MultiPolygon":r.rings=g(t.coordinates.slice(0)),r.spatialReference=s;break;case"Feature":t.geometry&&(r.geometry=b(t.geometry,e)),r.attributes=t.properties?v(t.properties):{},t.id&&(r.attributes[e]=t.id);break;case"FeatureCollection":for(r=[],i=0;i=0;o--){var a=S(n[o],i);r.features.push(a)}return r}function O(t){return t=e.Util.trim(t),"/"!==t[t.length-1]&&(t+="/"),t}function R(t){return/\.arcgis\.com.*?FeatureServer/g.test(t)}function C(t){var e;switch(t){case"Point":e="esriGeometryPoint";break;case"MultiPoint":e="esriGeometryMultipoint";break;case"LineString":e="esriGeometryPolyline";break;case"MultiLineString":e="esriGeometryPolyline";break;case"Polygon":e="esriGeometryPolygon";break;case"MultiPolygon":e="esriGeometryPolygon"}return e}function F(){console&&console.warn&&console.warn.apply(console,arguments)}function P(t,i){a(t,{},e.Util.bind(function(t,s){if(!t){i._esriAttributions=[];for(var r=0;r=u.minZoom&&o<=u.maxZoom&&(s+=", "+l)}s=s.substr(2);var h=map.attributionControl._container.querySelector(".esri-attributions");h.innerHTML=s,h.style.maxWidth=.65*map.getSize().x+"px",map.fire("attributionupdated",{attribution:s})}}function G(t){return new st(t)}function M(t){return new rt(t)}function q(t){return new nt(t)}function A(t){return new ot(t)}function E(t){return new at(t)}function U(t){return new ut(t)}function z(t){return new lt(t)}function D(t){return new ht(t)}function B(t){return new ct(t)}function j(t){return new pt(t)}function N(t,e){return new mt(t,e)}function Z(t,e){return new ft(t,e)}function W(t,e){return new vt(t,e)}function J(t,e){return new _t(t,e)}function Q(t){this.values=[].concat(t||[])}function H(t){return new St(t)}e="default"in e?e.default:e;var K="2.0.1",V=window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest,X=""===document.documentElement.style.pointerEvents,$={cors:V,pointerEvents:X},Y=0,tt=$.cors?n:a;tt.CORS=n,tt.JSONP=a;var et={request:o,get:tt,post:r},it={shallowClone:x,warn:F,cleanUrl:O,isArcgisOnline:R,geojsonTypeToArcGIS:C,responseToFeatureCollection:w,geojsonToArcGIS:L,arcgisToGeoJSON:S,boundsToExtent:I,extentToBounds:T,_getAttributionData:P,_updateMapAttribution:k},st=e.Class.extend({options:{proxy:!1,useCors:V},generateSetter:function(t,i){return e.Util.bind(function(e){return this.params[t]=e,this},i)},initialize:function(t){if(t.request&&t.options?(this._service=t,e.Util.setOptions(this,t.options)):(e.Util.setOptions(this,t),this.options.url=O(t.url)),this.params=e.Util.extend({},this.params||{}),this.setters)for(var i in this.setters){var s=this.setters[i];this[i]=this.generateSetter(s,this)}},token:function(t){return this._service?this._service.authenticate(t):this.params.token=t,this},request:function(t,e){return this._service?this._service.request(this.path,this.params,t,e):this._request("request",this.path,this.params,t,e)},_request:function(t,e,i,s,r){var n=this.options.proxy?this.options.proxy+"?"+this.options.url+e:this.options.url+e;return"get"!==t&&"request"!==t||this.options.useCors?et[t](n,i,s,r):et.get.JSONP(n,i,s,r)}}),rt=st.extend({setters:{offset:"resultOffset",limit:"resultRecordCount",fields:"outFields",precision:"geometryPrecision",featureIds:"objectIds",returnGeometry:"returnGeometry",token:"token"},path:"query",params:{returnGeometry:!0,where:"1=1",outSr:4326,outFields:"*"},within:function(t){return this._setGeometry(t),this.params.spatialRel="esriSpatialRelContains",this},intersects:function(t){return this._setGeometry(t),this.params.spatialRel="esriSpatialRelIntersects",this},contains:function(t){return this._setGeometry(t),this.params.spatialRel="esriSpatialRelWithin",this},crosses:function(t){return this._setGeometry(t),this.params.spatialRel="esriSpatialRelCrosses",this},touches:function(t){return this._setGeometry(t),this.params.spatialRel="esriSpatialRelTouches",this},overlaps:function(t){return this._setGeometry(t),this.params.spatialRel="esriSpatialRelOverlaps",this},nearby:function(t,i){return t=e.latLng(t),this.params.geometry=[t.lng,t.lat],this.params.geometryType="esriGeometryPoint",this.params.spatialRel="esriSpatialRelIntersects",this.params.units="esriSRUnit_Meter",this.params.distance=i,this.params.inSr=4326,this},where:function(t){return this.params.where=t,this},between:function(t,e){return this.params.time=[t.valueOf(),e.valueOf()],this},simplify:function(t,e){var i=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=i/t.getSize().y*e,this},orderBy:function(t,e){return e=e||"ASC",this.params.orderByFields=this.params.orderByFields?this.params.orderByFields+",":"",this.params.orderByFields+=[t,e].join(" "),this},run:function(t,e){return this._cleanParams(),this.options.isModern||it.isArcgisOnline(this.options.url)?(this.params.f="geojson",this.request(function(i,s){this._trapSQLerrors(i),t.call(e,i,s,s)},this)):this.request(function(i,s){this._trapSQLerrors(i),t.call(e,i,s&&it.responseToFeatureCollection(s),s)},this)},count:function(t,e){return this._cleanParams(),this.params.returnCountOnly=!0,this.request(function(e,i){t.call(this,e,i&&i.count,i)},e)},ids:function(t,e){return this._cleanParams(),this.params.returnIdsOnly=!0,this.request(function(e,i){t.call(this,e,i&&i.objectIds,i)},e)},bounds:function(t,e){return this._cleanParams(),this.params.returnExtentOnly=!0,this.request(function(i,s){t.call(e,i,s&&s.extent&&it.extentToBounds(s.extent),s)},e)},pixelSize:function(t){return t=e.point(t),this.params.pixelSize=[t.x,t.y],this},layer:function(t){return this.path=t+"/query",this},_trapSQLerrors:function(t){t&&"400"===t.code&&it.warn("one common syntax error in query requests is encasing string values in double quotes instead of single quotes")},_cleanParams:function(){delete this.params.returnIdsOnly,delete this.params.returnExtentOnly,delete this.params.returnCountOnly},_setGeometry:function(t){return this.params.inSr=4326,t instanceof e.LatLngBounds?(this.params.geometry=it.boundsToExtent(t),void(this.params.geometryType="esriGeometryEnvelope")):(t.getLatLng&&(t=t.getLatLng()),t instanceof e.LatLng&&(t={type:"Point",coordinates:[t.lng,t.lat]}),t instanceof e.GeoJSON&&(t=t.getLayers()[0].feature.geometry,this.params.geometry=it.geojsonToArcGIS(t),this.params.geometryType=it.geojsonTypeToArcGIS(t.type)),t.toGeoJSON&&(t=t.toGeoJSON()),"Feature"===t.type&&(t=t.geometry),"Point"===t.type||"LineString"===t.type||"Polygon"===t.type?(this.params.geometry=it.geojsonToArcGIS(t),void(this.params.geometryType=it.geojsonTypeToArcGIS(t.type))):void it.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"))}}),nt=st.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(t,e){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[t,e].join(":"),this},simplify:function(t,e){var i=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=i/t.getSize().y*e,this},run:function(t,e){return this.request(function(i,s){t.call(e,i,s&&it.responseToFeatureCollection(s),s)},e)}}),ot=st.extend({path:"identify",between:function(t,e){return this.params.time=[t.valueOf(),e.valueOf()],this}}),at=ot.extend({setters:{layers:"layers",precision:"geometryPrecision",tolerance:"tolerance",returnGeometry:"returnGeometry"},params:{sr:4326,layers:"all",tolerance:3,returnGeometry:!0},on:function(t){var e=it.boundsToExtent(t.getBounds()),i=t.getSize();return this.params.imageDisplay=[i.x,i.y,96],this.params.mapExtent=[e.xmin,e.ymin,e.xmax,e.ymax],this},at:function(t){return t=e.latLng(t),this.params.geometry=[t.lng,t.lat],this.params.geometryType="esriGeometryPoint",this},layerDef:function(t,e){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[t,e].join(":"),this},simplify:function(t,e){var i=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=i/t.getSize().y*(1-e),this},run:function(t,e){return this.request(function(i,s){if(i)return void t.call(e,i,void 0,s);var r=it.responseToFeatureCollection(s);s.results=s.results.reverse();for(var n=0;n=0;n--)r.catalogItems.features[n].properties.catalogItemVisibility=s[n];return r}}),lt=e.Evented.extend({options:{proxy:!1,useCors:V,timeout:0},initialize:function(t){t=t||{},this._requestQueue=[],this._authenticating=!1,e.Util.setOptions(this,t),this.options.url=O(this.options.url)},get:function(t,e,i,s){return this._request("get",t,e,i,s)},post:function(t,e,i,s){return this._request("post",t,e,i,s)},request:function(t,e,i,s){return this._request("request",t,e,i,s)},metadata:function(t,e){return this._request("get","",{},t,e)},authenticate:function(t){return this._authenticating=!1,this.options.token=t,this._runQueue(),this},getTimeout:function(){return this.options.timeout},setTimeout:function(t){this.options.timeout=t},_request:function(t,e,i,s,r){this.fire("requeststart",{url:this.options.url+e,params:i,method:t},!0);var n=this._createServiceCallback(t,e,i,s,r);if(this.options.token&&(i.token=this.options.token),this._authenticating)return void this._requestQueue.push([t,e,i,s,r]);var o=this.options.proxy?this.options.proxy+"?"+this.options.url+e:this.options.url+e;return"get"!==t&&"request"!==t||this.options.useCors?et[t](o,i,n,r):et.get.JSONP(o,i,n,r)},_createServiceCallback:function(t,i,s,r,n){return e.Util.bind(function(o,a){!o||499!==o.code&&498!==o.code||(this._authenticating=!0,this._requestQueue.push([t,i,s,r,n]),this.fire("authenticationrequired",{authenticate:e.Util.bind(this.authenticate,this)},!0),o.authenticate=e.Util.bind(this.authenticate,this)),r.call(n,o,a),o?this.fire("requesterror",{url:this.options.url+i,params:s,message:o.message,code:o.code,method:t},!0):this.fire("requestsuccess",{url:this.options.url+i,params:s,response:a,method:t},!0),this.fire("requestend",{url:this.options.url+i,params:s,method:t},!0)},this)},_runQueue:function(){for(var t=this._requestQueue.length-1;t>=0;t--){var e=this._requestQueue[t],i=e.shift();this[i].apply(this,e)}this._requestQueue=[]}}),ht=lt.extend({identify:function(){return E(this)},find:function(){return q(this)},query:function(){return M(this)}}),ct=lt.extend({query:function(){return M(this)},identify:function(){return U(this)}}),pt=lt.extend({options:{idAttribute:"OBJECTID"},query:function(){return M(this)},addFeature:function(t,e,i){return delete t.id,t=L(t),this.post("addFeatures",{features:[t]},function(t,s){var r=s&&s.addResults?s.addResults[0]:void 0;e&&e.call(i,t||s.addResults[0].error,r)},i)},updateFeature:function(t,e,i){return t=L(t,this.options.idAttribute),this.post("updateFeatures",{features:[t]},function(t,s){var r=s&&s.updateResults?s.updateResults[0]:void 0;e&&e.call(i,t||s.updateResults[0].error,r)},i)},deleteFeature:function(t,e,i){return this.post("deleteFeatures",{objectIds:t},function(t,s){var r=s&&s.deleteResults?s.deleteResults[0]:void 0;e&&e.call(i,t||s.deleteResults[0].error,r)},i)},deleteFeatures:function(t,e,i){return this.post("deleteFeatures",{objectIds:t},function(t,s){var r=s&&s.deleteResults?s.deleteResults:void 0;e&&e.call(i,t||s.deleteResults[0].error,r)},i)}}),dt="https:"!==window.location.protocol?"http:":"https:",mt=e.TileLayer.extend({statics:{TILES:{Streets:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/World_Street_Map"}},Topographic:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/World_Topo_Map"}},Oceans:{urlTemplate:dt+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/Ocean_Basemap"}},OceansLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:X?"esri-labels":"tilePane"}},NationalGeographic:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"National Geographic, DeLorme, HERE, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, increment P Corp."}},DarkGray:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"HERE, DeLorme, MapmyIndia, © OpenStreetMap contributors"}},DarkGrayLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:X?"esri-labels":"tilePane"}},Gray:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"HERE, DeLorme, MapmyIndia, © OpenStreetMap contributors"}},GrayLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:X?"esri-labels":"tilePane"}},Imagery:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community"}},ImageryLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:X?"esri-labels":"tilePane"}},ImageryTransportation:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:X?"esri-labels":"tilePane"}},ShadedRelief:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"USGS"}},ShadedReliefLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:12,subdomains:["server","services"],pane:X?"esri-labels":"tilePane"}},Terrain:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"USGS, NOAA"}},TerrainLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],pane:X?"esri-labels":"tilePane"}},USATopo:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:15,subdomains:["server","services"],attribution:"USGS, National Geographic Society, i-cubed"}}}},initialize:function(t,i){var s;if("object"==typeof t&&t.urlTemplate&&t.options)s=t;else{if("string"!=typeof t||!mt.TILES[t])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"');s=mt.TILES[t]}var r=e.Util.extend(s.options,i);e.Util.setOptions(this,r),this.options.token&&(s.urlTemplate+="?token="+this.options.token),e.TileLayer.prototype.initialize.call(this,s.urlTemplate,r)},onAdd:function(t){t.attributionControl&&t.attributionControl.addAttribution('© Esri'),"esri-labels"===this.options.pane&&this._initPane(),this.options.attributionUrl&&it._getAttributionData(this.options.attributionUrl,t),t.on("moveend",it._updateMapAttribution),e.TileLayer.prototype.onAdd.call(this,t)},onRemove:function(t){t.attributionControl&&t.attributionControl.removeAttribution('© Esri'),t.off("moveend",this._updateMapAttribution,this),e.TileLayer.prototype.onRemove.call(this,t)},_initPane:function(){if(!this._map.getPane(this.options.pane)){var t=this._map.createPane(this.options.pane);t.style.pointerEvents="none",t.style.zIndex=500}},getAttribution:function(){if(this.options.attribution)var t=this._map.getSize().x-55,e=''+this.options.attribution+"";return e}}),ft=e.TileLayer.extend({options:{zoomOffsetAllowance:.1,errorTileUrl:"http://downloads2.esri.com/support/TechArticles/blank256.png"},statics:{MercatorZoomLevels:{0:156543.033928,1:78271.5169639999,2:39135.7584820001,3:19567.8792409999,4:9783.93962049996,5:4891.96981024998,6:2445.98490512499,7:1222.99245256249,8:611.49622628138,9:305.748113140558,10:152.874056570411,11:76.4370282850732,12:38.2185141425366,13:19.1092570712683,14:9.55462853563415,15:4.77731426794937,16:2.38865713397468,17:1.19432856685505,18:.597164283559817,19:.298582141647617,20:.14929107082381,21:.07464553541191,22:.0373227677059525,23:.0186613838529763}},initialize:function(t){t.url=O(t.url),t=e.Util.setOptions(this,t),this.tileUrl=t.url+"tile/{z}/{y}/{x}",this.service=D(t),this.service.addEventParent(this);var i=new RegExp(/tiles.arcgis(online)?\.com/g);i.test(t.url)&&(this.tileUrl=this.tileUrl.replace("://tiles","://tiles{s}"),t.subdomains=["1","2","3","4"]),this.options.token&&(this.tileUrl+="?token="+this.options.token),e.TileLayer.prototype.initialize.call(this,this.tileUrl,t)},getTileUrl:function(t){return e.Util.template(this.tileUrl,e.extend({s:this._getSubdomain(t),z:this._lodMap&&this._lodMap[t.z]?this._lodMap[t.z]:t.z,x:t.x,y:t.y},this.options))},createTile:function(t,i){var s=document.createElement("img");return e.DomEvent.on(s,"load",e.bind(this._tileOnLoad,this,i,s)),e.DomEvent.on(s,"error",e.bind(this._tileOnError,this,i,s)),this.options.crossOrigin&&(s.crossOrigin=""),s.alt="",!this._lodMap||this._lodMap&&this._lodMap[t.z]?s.src=this.getTileUrl(t):this.once("lodmap",function(){s.src=this.getTileUrl(t)},this),s},onAdd:function(t){t.options.crs!==e.CRS.EPSG3857||this._lodMap||(this._lodMap={},this.metadata(function(t,e){if(!t){var i=e.spatialReference.latestWkid||e.spatialReference.wkid;if(102100===i||3857===i){for(var s=e.tileInfo.lods,r=ft.MercatorZoomLevels,n=0;nthis.options.maxZoom||t0||n.y0||o.ys.max.x)||!i.wrapLat&&(t.ys.max.y))return!1}if(!this.options.bounds)return!0;var r=this._cellCoordsToBounds(t);return e.latLngBounds(this.options.bounds).intersects(r)},_cellCoordsToBounds:function(t){var i=this._map,s=this.options.cellSize,r=t.multiplyBy(s),n=r.add([s,s]),o=i.wrapLatLng(i.unproject(r,t.z)),a=i.wrapLatLng(i.unproject(n,t.z));return e.latLngBounds(o,a)},_cellCoordsToKey:function(t){return t.x+":"+t.y},_keyToCellCoords:function(t){var i=t.split(":"),s=parseInt(i[0],10),r=parseInt(i[1],10);return e.point(s,r)},_removeOtherCells:function(t){for(var e in this._cells)t.contains(this._keyToCellCoords(e))||this._removeCell(e)},_removeCell:function(t){var e=this._activeCells[t];e&&(delete this._activeCells[t],this.cellLeave&&this.cellLeave(e.bounds,e.coords),this.fire("cellleave",{bounds:e.bounds,coords:e.coords}))},_removeCells:function(){for(var t in this._cells){var e=this._cells[t].bounds,i=this._cells[t].coords;this.cellLeave&&this.cellLeave(e,i),this.fire("cellleave",{bounds:e,coords:i})}},_addCell:function(t){this._wrapCoords(t);var e=this._cellCoordsToKey(t),i=this._cells[e];i&&!this._activeCells[e]&&(this.cellEnter&&this.cellEnter(i.bounds,t),this.fire("cellenter",{bounds:i.bounds,coords:t}),this._activeCells[e]=i),i||(i={coords:t,bounds:this._cellCoordsToBounds(t)},this._cells[e]=i,this._activeCells[e]=i,this.createCell&&this.createCell(i.bounds,t),this.fire("cellcreate",{bounds:i.bounds,coords:t}))},_wrapCoords:function(t){t.x=this._wrapLng?e.Util.wrapNum(t.x,this._wrapLng):t.x,t.y=this._wrapLat?e.Util.wrapNum(t.y,this._wrapLat):t.y},_getCellNumBounds:function(){var t=this._map.getPixelWorldBounds(),i=this._getCellSize();return t?e.bounds(t.min.divideBy(i).floor(),t.max.divideBy(i).ceil().subtract([1,1])):null}});Q.prototype.query=function(t){var e=this.getIndex(t);return this.values[e]},Q.prototype.getIndex=function(t){this.dirty&&this.sort();for(var e,i,s=0,r=this.values.length-1;s<=r;)if(e=(s+r)/2|0,i=this.values[Math.round(e)],+i.value<+t)s=e+1;else{if(!(+i.value>+t))return e;r=e-1}return Math.abs(~r)},Q.prototype.between=function(t,e){var i=this.getIndex(t),s=this.getIndex(e);if(0===i&&0===s)return[];for(;this.values[i-1]&&this.values[i-1].value===t;)i--;for(;this.values[s+1]&&this.values[s+1].value===e;)s++;return this.values[s]&&this.values[s].value===e&&this.values[s+1]&&s++,this.values.slice(i,s)},Q.prototype.insert=function(t){return this.values.splice(this.getIndex(t.value),0,t),this},Q.prototype.bulkAdd=function(t,e){return this.values=this.values.concat([].concat(t||[])),e?this.sort():this.dirty=!0,this},Q.prototype.sort=function(){return this.values.sort(function(t,e){return+e.value-+t.value}).reverse(),this.dirty=!1,this};var Lt=bt.extend({options:{attribution:null,where:"1=1",fields:["*"],from:!1,to:!1,timeField:!1,timeFilterMode:"server",simplifyFactor:0,precision:6},initialize:function(t){if(bt.prototype.initialize.call(this,t),t.url=O(t.url),t=e.setOptions(this,t),this.service=j(t),this.service.addEventParent(this),"*"!==this.options.fields[0]){for(var i=!1,s=0;s=0;s--){var r=t[s].id;this._currentSnapshot.push(r),this._cache[i].push(r)}this.options.timeField&&this._buildTimeIndexes(t),this.createLayers(t)},_buildQuery:function(t){var e=this.service.query().intersects(t).where(this.options.where).fields(this.options.fields).precision(this.options.precision);return this.options.simplifyFactor&&e.simplify(this._map,this.options.simplifyFactor),"server"===this.options.timeFilterMode&&this.options.from&&this.options.to&&e.between(this.options.from,this.options.to),e},setWhere:function(t,i,s){this.options.where=t&&t.length?t:"1=1";for(var r=[],n=[],o=0,a=null,u=e.Util.bind(function(t,u){if(t&&(a=t),u)for(var l=u.features.length-1;l>=0;l--)n.push(u.features[l].id);o--,o<=0&&(this._currentSnapshot=n,e.Util.requestAnimFrame(e.Util.bind(function(){this.removeLayers(r),this.addLayers(n),i&&i.call(s,a)},this)))},this),l=this._currentSnapshot.length-1;l>=0;l--)r.push(this._currentSnapshot[l]);for(var h in this._activeCells){o++;var c=this._keyToCellCoords(h),p=this._cellCoordsToBounds(c);this._requestFeatures(p,h,u)}return this},getWhere:function(){return this.options.where},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(t,i,s,r){var n=this.options.from,o=this.options.to,a=0,u=null,l=e.Util.bind(function(e){e&&(u=e),this._filterExistingFeatures(n,o,t,i),a--,s&&a<=0&&s.call(r,u)},this);if(this.options.from=t,this.options.to=i,this._filterExistingFeatures(n,o,t,i),"server"===this.options.timeFilterMode)for(var h in this._activeCells){a++;var c=this._keyToCellCoords(h),p=this._cellCoordsToBounds(c);this._requestFeatures(p,h,l)}return this},refresh:function(){for(var t in this._activeCells){var e=this._keyToCellCoords(t),i=this._cellCoordsToBounds(e);this._requestFeatures(i,t)}this.redraw&&this.once("load",function(){this.eachFeature(function(t){this._redraw(t.feature.id)},this)},this)},_filterExistingFeatures:function(t,i,s,r){var n=t&&i?this._getFeaturesInTimeRange(t,i):this._currentSnapshot,o=this._getFeaturesInTimeRange(s,r);if(o.indexOf)for(var a=0;a=0&&n.splice(u,1)}e.Util.requestAnimFrame(e.Util.bind(function(){this.removeLayers(n),this.addLayers(o)},this))},_getFeaturesInTimeRange:function(t,e){var i,s=[];if(this.options.timeField.start&&this.options.timeField.end){var r=this._startTimeIndex.between(t,e),n=this._endTimeIndex.between(t,e);i=r.concat(n)}else i=this._timeIndex.between(t,e);for(var o=i.length-1;o>=0;o--)s.push(i[o].id);return s},_buildTimeIndexes:function(t){var e,i;if(this.options.timeField.start&&this.options.timeField.end){var s=[],r=[];for(e=t.length-1;e>=0;e--)i=t[e],s.push({id:i.id,value:new Date(i.properties[this.options.timeField.start])}),r.push({id:i.id,value:new Date(i.properties[this.options.timeField.end])});this._startTimeIndex.bulkAdd(s),this._endTimeIndex.bulkAdd(r)}else{var n=[];for(e=t.length-1;e>=0;e--)i=t[e],n.push({id:i.id,value:new Date(i.properties[this.options.timeField])});this._timeIndex.bulkAdd(n)}},_featureWithinTimeRange:function(t){if(!this.options.from||!this.options.to)return!0;var e=+this.options.from.valueOf(),i=+this.options.to.valueOf();if("string"==typeof this.options.timeField){var s=+t.properties[this.options.timeField];return s>=e&&s<=i}if(this.options.timeField.start&&this.options.timeField.end){var r=+t.properties[this.options.timeField.start],n=+t.properties[this.options.timeField.end];return r>=e&&r<=i||n>=e&&n<=i}},_visibleZoom:function(){if(!this._map)return!1;var t=this._map.getZoom();return!(t>this.options.maxZoom||t0)for(var r=0;r=0;e--){var i,s=t[e],r=this._layers[s.id];this._visibleZoom()&&r&&!this._map.hasLayer(r)&&(this._map.addLayer(r),this.fire("addfeature",{feature:r.feature},!0)),r&&this.options.simplifyFactor>0&&(r.setLatLngs||r.setLatLng)&&this._updateLayer(r,s),r||(i=this.createNewLayer(s),i.feature=s,i.addEventParent(this),this.options.onEachFeature&&this.options.onEachFeature(i.feature,i),this._layers[i.feature.id]=i,this.setFeatureStyle(i.feature.id,this.options.style),this.fire("createfeature",{feature:i.feature},!0),this._visibleZoom()&&(!this.options.timeField||this.options.timeField&&this._featureWithinTimeRange(s))&&(this.fire("addfeature",{feature:i.feature},!0),this._map.addLayer(i)))}},addLayers:function(t){for(var e=t.length-1;e>=0;e--){var i=this._layers[t[e]];i&&(this.fire("addfeature",{feature:i.feature},!0),this._map.addLayer(i))}},removeLayers:function(t,e){for(var i=t.length-1;i>=0;i--){var s=t[i],r=this._layers[s];r&&(this.fire("removefeature",{feature:r.feature,permanent:e},!0),this._map.removeLayer(r)),r&&e&&delete this._layers[s]}},cellEnter:function(t,i){!this._zooming&&this._map&&e.Util.requestAnimFrame(e.Util.bind(function(){var t=this._cacheKey(i),e=this._cellCoordsToKey(i),s=this._cache[t];this._activeCells[e]&&s&&this.addLayers(s)},this))},cellLeave:function(t,i){this._zooming||e.Util.requestAnimFrame(e.Util.bind(function(){if(this._map){var t=this._cacheKey(i),e=this._cellCoordsToKey(i),s=this._cache[t],r=this._map.getBounds();if(!this._activeCells[e]&&s){for(var n=!0,o=0;o (http://patrickarlt.com)\",\n \"browser\": \"dist/esri-leaflet-debug.js\",\n \"bugs\": {\n \"url\": \"https://github.com/esri/esri-leaflet/issues\"\n },\n \"contributors\": [\n \"Patrick Arlt (http://patrickarlt.com)\",\n \"John Gravois (http://johngravois.com)\"\n ],\n \"dependencies\": {\n \"arcgis-to-geojson-utils\": \"^1.0.1\",\n \"leaflet\": \"^1.0.0-rc.1\",\n \"leaflet-virtual-grid\": \"^1.0.3\",\n \"tiny-binary-search\": \"^1.0.2\"\n },\n \"devDependencies\": {\n \"chai\": \"2.3.0\",\n \"eslint\": \"^1.10.2\",\n \"gh-release\": \"^2.0.0\",\n \"highlight.js\": \"^8.0.0\",\n \"http-server\": \"^0.8.5\",\n \"isparta\": \"^3.0.3\",\n \"istanbul\": \"^0.4.2\",\n \"karma\": \"^0.12.16\",\n \"karma-chai-sinon\": \"^0.1.3\",\n \"karma-coverage\": \"^0.5.3\",\n \"karma-mocha\": \"^0.1.0\",\n \"karma-mocha-reporter\": \"^0.2.5\",\n \"karma-phantomjs-launcher\": \"^0.2.0\",\n \"karma-sourcemap-loader\": \"^0.3.5\",\n \"load-grunt-tasks\": \"^0.4.0\",\n \"mkdirp\": \"^0.5.1\",\n \"mocha\": \"^2.3.4\",\n \"phantomjs\": \"^1.9.17\",\n \"rollup\": \"^0.25.4\",\n \"rollup-plugin-json\": \"^2.0.0\",\n \"rollup-plugin-node-resolve\": \"^1.4.0\",\n \"rollup-plugin-uglify\": \"^0.3.1\",\n \"semistandard\": \"^7.0.5\",\n \"sinon\": \"^1.11.1\",\n \"sinon-chai\": \"2.7.0\",\n \"snazzy\": \"^2.0.1\",\n \"uglify-js\": \"^2.6.1\",\n \"watch\": \"^0.17.1\"\n },\n \"homepage\": \"http://esri.github.io/esri-leaflet\",\n \"jsnext:main\": \"src/EsriLeaflet.js\",\n \"jspm\": {\n \"registry\": \"npm\",\n \"format\": \"es6\",\n \"main\": \"src/EsriLeaflet.js\"\n },\n \"keywords\": [\n \"arcgis\",\n \"esri\",\n \"esri leaflet\",\n \"gis\",\n \"leaflet plugin\",\n \"mapping\"\n ],\n \"license\": \"Apache-2.0\",\n \"main\": \"dist/esri-leaflet-debug.js\",\n \"readmeFilename\": \"README.md\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git@github.com:Esri/esri-leaflet.git\"\n },\n \"scripts\": {\n \"build\": \"rollup -c profiles/debug.js & rollup -c profiles/production.js\",\n \"lint\": \"semistandard src/**/*.js | snazzy\",\n \"prebuild\": \"mkdirp dist\",\n \"prepublish\": \"npm run build\",\n \"pretest\": \"npm run build\",\n \"release\": \"./scripts/release.sh\",\n \"start\": \"watch 'npm run build' src & http-server -p 5000 -c-1 -o\",\n \"test\": \"npm run lint && karma start\"\n }\n}\n","export var cors = ((window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest()));\nexport var pointerEvents = document.documentElement.style.pointerEvents === '';\n\nexport var Support = {\n cors: cors,\n pointerEvents: pointerEvents\n};\n\nexport default Support;\n","import L from 'leaflet';\nimport Support from './Support';\nimport { warn } from './Util';\n\nvar callbacks = 0;\n\nfunction 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\nfunction createRequest (callback, context) {\n var httpRequest = new window.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 httpRequest.ontimeout = function () {\n this.onerror();\n };\n\n return httpRequest;\n}\n\nfunction xmlHttpPost (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n httpRequest.open('POST', url);\n\n if (typeof context !== 'undefined' && context !== null) {\n if (typeof context.options !== 'undefined') {\n httpRequest.timeout = context.options.timeout;\n }\n }\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.send(serialize(params));\n\n return httpRequest;\n}\n\nfunction xmlHttpGet (url, params, callback, context) {\n var httpRequest = createRequest(callback, context);\n httpRequest.open('GET', url + '?' + serialize(params), true);\n\n if (typeof context !== 'undefined' && context !== null) {\n if (typeof context.options !== 'undefined') {\n httpRequest.timeout = context.options.timeout;\n }\n }\n httpRequest.send(null);\n\n return httpRequest;\n}\n\n// AJAX handlers for CORS (modern browsers) or JSONP (older browsers)\nexport function request (url, params, callback, context) {\n var paramString = serialize(params);\n var httpRequest = createRequest(callback, context);\n var requestLength = (url + '?' + paramString).length;\n\n // get around ie10/11 bug which requires that the request be opened before a timeout is applied\n if (requestLength <= 2000 && Support.cors) {\n httpRequest.open('GET', url + '?' + paramString);\n\n } else if (requestLength > 2000 && Support.cors) {\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n }\n\n if (typeof context !== 'undefined' && context !== null) {\n if (typeof context.options !== 'undefined') {\n httpRequest.timeout = context.options.timeout;\n }\n }\n\n // request is less then 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest\n if (requestLength <= 2000 && Support.cors) {\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 && Support.cors) {\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 && !Support.cors) {\n return 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 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 return httpRequest;\n}\n\nexport function jsonp (url, params, callback, context) {\n window._EsriLeafletCallbacks = window._EsriLeafletCallbacks || {};\n var callbackId = 'c' + callbacks;\n params.callback = 'window._EsriLeafletCallbacks.' + 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 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 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\nvar get = ((Support.cors) ? xmlHttpGet : jsonp);\nget.CORS = xmlHttpGet;\nget.JSONP = jsonp;\n\n// choose the correct AJAX handler depending on CORS support\nexport { get };\n\n// always use XMLHttpRequest for posts\nexport { xmlHttpPost as post };\n\n// export the Request object to call the different handlers for debugging\nexport var Request = {\n request: request,\n get: get,\n post: xmlHttpPost\n};\n\nexport default Request;\n","/*\n * Copyright 2015 Esri\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the Liscense.\n */\n\n// checks if 2 x,y points are equal\nfunction 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\nfunction 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\nfunction ringIsClockwise (ringToTest) {\n var total = 0;\n var 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\nfunction 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 (ua >= 0 && ua <= 1 && ub >= 0 && 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\nfunction 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\nfunction 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\nfunction 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\nfunction 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\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\nfunction 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\nfunction 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// shallow object clone for feature properties and attributes\n// from http://jsperf.com/cloning-an-object/2\nfunction shallowClone (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\nexport function arcgisToGeoJSON (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) ? arcgisToGeoJSON(arcgis.geometry) : null;\n geojson.properties = (arcgis.attributes) ? shallowClone(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\nexport function geojsonToArcGIS (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 = geojsonToArcGIS(geojson.geometry, idAttribute);\n }\n result.attributes = (geojson.properties) ? shallowClone(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(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(geojsonToArcGIS(geojson.geometries[i], idAttribute));\n }\n break;\n }\n\n return result;\n}\n","import L from 'leaflet';\nimport { jsonp } from './Request';\nimport {\n geojsonToArcGIS as g2a,\n arcgisToGeoJSON as a2g\n} from 'arcgis-to-geojson-utils';\n\nexport function geojsonToArcGIS (geojson, idAttr) {\n return g2a(geojson, idAttr);\n}\n\nexport function arcgisToGeoJSON (arcgis, idAttr) {\n return a2g(arcgis, idAttr);\n}\n\n// shallow object clone for feature properties and attributes\n// from http://jsperf.com/cloning-an-object/2\nexport function shallowClone (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// convert an extent (ArcGIS) to LatLngBounds (Leaflet)\nexport function extentToBounds (extent) {\n var sw = L.latLng(extent.ymin, extent.xmin);\n var ne = L.latLng(extent.ymax, extent.xmax);\n return L.latLngBounds(sw, ne);\n}\n\n// convert an LatLngBounds (Leaflet) to extent (ArcGIS)\nexport function boundsToExtent (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\nexport function responseToFeatureCollection (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 var feature = arcgisToGeoJSON(features[i], objectIdField);\n featureCollection.features.push(feature);\n }\n }\n\n return featureCollection;\n}\n\n // trim url whitespace and add a trailing slash if needed\nexport function cleanUrl (url) {\n // trim leading and trailing spaces, but not spaces inside the url\n url = L.Util.trim(url);\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\nexport function isArcgisOnline (url) {\n /* hosted feature services can emit geojson natively. */\n return (/\\.arcgis\\.com.*?FeatureServer/g).test(url);\n}\n\nexport function geojsonTypeToArcGIS (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\n return arcgisGeometryType;\n}\n\nexport function warn () {\n if (console && console.warn) {\n console.warn.apply(console, arguments);\n }\n}\n\nexport function _getAttributionData (url, map) {\n jsonp(url, {}, L.Util.bind(function (error, attributions) {\n if (error) { return; }\n map._esriAttributions = [];\n for (var c = 0; c < attributions.contributors.length; c++) {\n var contributor = attributions.contributors[c];\n\n if (contributor.attribution !== 'Esri') {\n for (var i = 0; i < contributor.coverageAreas.length; i++) {\n var coverageArea = contributor.coverageAreas[i];\n var southWest = L.latLng(coverageArea.bbox[0], coverageArea.bbox[1]);\n var northEast = L.latLng(coverageArea.bbox[2], coverageArea.bbox[3]);\n map._esriAttributions.push({\n attribution: contributor.attribution,\n score: coverageArea.score,\n bounds: L.latLngBounds(southWest, northEast),\n minZoom: coverageArea.zoomMin,\n maxZoom: coverageArea.zoomMax\n });\n }\n }\n }\n\n map._esriAttributions.sort(function (a, b) {\n return b.score - a.score;\n });\n\n // pass the same argument as the map's 'moveend' event\n var obj = { target: map };\n this._updateMapAttribution(obj);\n }, this));\n}\n\nexport function _updateMapAttribution (evt) {\n map = evt.target;\n var oldAttributions = map._esriAttributions;\n\n if (map && map.attributionControl && oldAttributions) {\n var newAttributions = '';\n var bounds = map.getBounds();\n var wrappedBounds = L.latLngBounds(\n bounds.getSouthWest().wrap(),\n bounds.getNorthEast().wrap()\n );\n var zoom = map.getZoom();\n\n for (var i = 0; i < oldAttributions.length; i++) {\n var attribution = oldAttributions[i];\n var text = attribution.attribution;\n\n if (!newAttributions.match(text) && attribution.bounds.intersects(wrappedBounds) && zoom >= attribution.minZoom && zoom <= attribution.maxZoom) {\n newAttributions += (', ' + text);\n }\n }\n newAttributions = newAttributions.substr(2);\n var attributionElement = map.attributionControl._container.querySelector('.esri-attributions');\n\n attributionElement.innerHTML = newAttributions;\n attributionElement.style.maxWidth = (map.getSize().x * 0.65) + 'px';\n\n map.fire('attributionupdated', {\n attribution: newAttributions\n });\n }\n}\n\nexport var Util = {\n shallowClone: shallowClone,\n warn: warn,\n cleanUrl: cleanUrl,\n isArcgisOnline: isArcgisOnline,\n geojsonTypeToArcGIS: geojsonTypeToArcGIS,\n responseToFeatureCollection: responseToFeatureCollection,\n geojsonToArcGIS: geojsonToArcGIS,\n arcgisToGeoJSON: arcgisToGeoJSON,\n boundsToExtent: boundsToExtent,\n extentToBounds: extentToBounds,\n _getAttributionData: _getAttributionData,\n _updateMapAttribution: _updateMapAttribution\n};\n\nexport default Util;\n","import L from 'leaflet';\nimport {cors} from '../Support';\nimport {cleanUrl} from '../Util';\nimport Request from '../Request';\n\nexport var Task = L.Class.extend({\n\n options: {\n proxy: false,\n useCors: 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 = 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 }\n\n return this._request('request', this.path, this.params, callback, context);\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\n if ((method === 'get' || method === 'request') && !this.options.useCors) {\n return Request.get.JSONP(url, params, callback, context);\n }\n\n return Request[method](url, params, callback, context);\n }\n});\n\nexport function task (options) {\n return new Task(options);\n}\n\nexport default task;\n","import L from 'leaflet';\nimport { Task } from './Task';\nimport Util from '../Util';\n\nexport var Query = Task.extend({\n setters: {\n 'offset': 'resultOffset',\n 'limit': 'resultRecordCount',\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 // instead of converting double-quotes to single quotes, pass as is, and provide a more informative message if a 400 is encountered\n this.params.where = string;\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 // services hosted on ArcGIS Online also support requesting geojson directly\n if (this.options.isModern || Util.isArcgisOnline(this.options.url)) {\n this.params.f = 'geojson';\n\n return this.request(function (error, response) {\n this._trapSQLerrors(error);\n callback.call(context, error, response, response);\n }, this);\n\n // otherwise convert it in the callback then pass it on\n } else {\n return this.request(function (error, response) {\n this._trapSQLerrors(error);\n callback.call(context, error, (response && Util.responseToFeatureCollection(response)), response);\n }, this);\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 && 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 _trapSQLerrors: function (error) {\n if (error) {\n if (error.code === '400') {\n Util.warn('one common syntax error in query requests is encasing string values in double quotes instead of single quotes');\n }\n }\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 = 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 = Util.geojsonToArcGIS(geometry);\n this.params.geometryType = 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 = Util.geojsonToArcGIS(geometry);\n this.params.geometryType = Util.geojsonTypeToArcGIS(geometry.type);\n return;\n }\n\n // warn the user if we havn't found an appropriate object\n Util.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 return;\n }\n});\n\nexport function query (options) {\n return new Query(options);\n}\n\nexport default query;\n","import { Task } from './Task';\nimport Util from '../Util';\n\nexport var Find = 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 && Util.responseToFeatureCollection(response)), response);\n }, context);\n }\n});\n\nexport function find (options) {\n return new Find(options);\n}\n\nexport default find;\n","import { Task } from './Task';\n\nexport var Identify = 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\nexport function identify (options) {\n return new Identify(options);\n}\n\nexport default identify;\n","import L from 'leaflet';\nimport { Identify } from './Identify';\nimport Util from '../Util';\n\nexport var IdentifyFeatures = 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 = 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 // immediately invoke with an error\n if (error) {\n callback.call(context, error, undefined, response);\n return;\n\n // ok no error lets just assume we have features...\n } else {\n var featureCollection = Util.responseToFeatureCollection(response);\n response.results = response.results.reverse();\n for (var i = 0; i < featureCollection.features.length; i++) {\n var feature = featureCollection.features[i];\n feature.layerId = response.results[i].layerId;\n }\n callback.call(context, undefined, featureCollection, response);\n }\n });\n }\n});\n\nexport function identifyFeatures (options) {\n return new IdentifyFeatures(options);\n}\n\nexport default identifyFeatures;\n","import L from 'leaflet';\nimport { Identify } from './Identify';\nimport Util from '../Util';\n\nexport var IdentifyImage = 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\n if (response.properties && response.properties.Values) {\n geoJSON.pixel.properties.values = response.properties.Values;\n }\n\n if (catalogItems && catalogItems.features) {\n geoJSON.catalogItems = 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\nexport function identifyImage (params) {\n return new IdentifyImage(params);\n}\n\nexport default identifyImage;\n","import L from 'leaflet';\nimport {cors} from '../Support';\nimport {cleanUrl} from '../Util';\nimport Request from '../Request';\n\nexport var Service = L.Evented.extend({\n\n options: {\n proxy: false,\n useCors: cors,\n timeout: 0\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 = 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 getTimeout: function () {\n return this.options.timeout;\n },\n\n setTimeout: function (timeout) {\n this.options.timeout = timeout;\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 }, true);\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 Request.get.JSONP(url, params, wrappedCallback, context);\n } else {\n return Request[method](url, params, wrappedCallback, context);\n }\n }\n },\n\n _createServiceCallback: function (method, path, params, callback, context) {\n return L.Util.bind(function (error, response) {\n if (error && (error.code === 499 || error.code === 498)) {\n this._authenticating = true;\n\n this._requestQueue.push([method, path, params, callback, context]);\n\n // fire an event for users to handle and re-authenticate\n this.fire('authenticationrequired', {\n authenticate: L.Util.bind(this.authenticate, this)\n }, true);\n\n // if the user has access to a callback they can handle the auth error\n error.authenticate = L.Util.bind(this.authenticate, this);\n }\n\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 }, true);\n } else {\n this.fire('requestsuccess', {\n url: this.options.url + path,\n params: params,\n response: response,\n method: method\n }, true);\n }\n\n this.fire('requestend', {\n url: this.options.url + path,\n params: params,\n method: method\n }, true);\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\nexport function service (options) {\n return new Service(options);\n}\n\nexport default service;\n","import { Service } from './Service';\nimport identifyFeatures from '../Tasks/IdentifyFeatures';\nimport query from '../Tasks/Query';\nimport find from '../Tasks/Find';\n\nexport var MapService = Service.extend({\n\n identify: function () {\n return identifyFeatures(this);\n },\n\n find: function () {\n return find(this);\n },\n\n query: function () {\n return query(this);\n }\n\n});\n\nexport function mapService (options) {\n return new MapService(options);\n}\n\nexport default mapService;\n","import { Service } from './Service';\nimport identifyImage from '../Tasks/IdentifyImage';\nimport query from '../Tasks/Query';\n\nexport var ImageService = Service.extend({\n\n query: function () {\n return query(this);\n },\n\n identify: function () {\n return identifyImage(this);\n }\n});\n\nexport function imageService (options) {\n return new ImageService(options);\n}\n\nexport default imageService;\n","import { Service } from './Service';\nimport query from '../Tasks/Query';\nimport { geojsonToArcGIS } from '../Util';\n\nexport var FeatureLayerService = Service.extend({\n\n options: {\n idAttribute: 'OBJECTID'\n },\n\n query: function () {\n return query(this);\n },\n\n addFeature: function (feature, callback, context) {\n delete feature.id;\n\n feature = 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(context, error || response.addResults[0].error, result);\n }\n }, context);\n },\n\n updateFeature: function (feature, callback, context) {\n feature = 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 deleteFeatures: function (ids, callback, context) {\n return this.post('deleteFeatures', {\n objectIds: ids\n }, function (error, response) {\n // pass back the entire array\n var result = (response && response.deleteResults) ? response.deleteResults : undefined;\n if (callback) {\n callback.call(context, error || response.deleteResults[0].error, result);\n }\n }, context);\n }\n});\n\nexport function featureLayerService (options) {\n return new FeatureLayerService(options);\n}\n\nexport default featureLayerService;\n","import L from 'leaflet';\nimport { pointerEvents } from '../Support';\nimport { Util } from '../Util';\n\nvar tileProtocol = (window.location.protocol !== 'https:') ? 'http:' : 'https:';\n\nexport var 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 options: {\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n attribution: 'USGS, NOAA',\n attributionUrl: 'https://static.arcgis.com/attribution/World_Street_Map'\n }\n },\n Topographic: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}',\n options: {\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n attribution: 'USGS, NOAA',\n attributionUrl: 'https://static.arcgis.com/attribution/World_Topo_Map'\n }\n },\n Oceans: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}',\n options: {\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'USGS, NOAA',\n attributionUrl: 'https://static.arcgis.com/attribution/Ocean_Basemap'\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 minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n pane: (pointerEvents) ? 'esri-labels' : 'tilePane'\n }\n },\n NationalGeographic: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}',\n options: {\n minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'National Geographic, DeLorme, HERE, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, increment P Corp.'\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 minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'HERE, DeLorme, MapmyIndia, © OpenStreetMap contributors'\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 minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n pane: (pointerEvents) ? 'esri-labels' : 'tilePane'\n\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 minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n attribution: 'HERE, DeLorme, MapmyIndia, © OpenStreetMap contributors'\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 minZoom: 1,\n maxZoom: 16,\n subdomains: ['server', 'services'],\n pane: (pointerEvents) ? 'esri-labels' : 'tilePane'\n }\n },\n Imagery: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',\n options: {\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n attribution: '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 minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n pane: (pointerEvents) ? 'esri-labels' : 'tilePane'\n }\n },\n ImageryTransportation: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}',\n options: {\n minZoom: 1,\n maxZoom: 19,\n subdomains: ['server', 'services'],\n pane: (pointerEvents) ? 'esri-labels' : 'tilePane'\n }\n },\n ShadedRelief: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}',\n options: {\n minZoom: 1,\n maxZoom: 13,\n subdomains: ['server', 'services'],\n attribution: 'USGS'\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 minZoom: 1,\n maxZoom: 12,\n subdomains: ['server', 'services'],\n pane: (pointerEvents) ? 'esri-labels' : 'tilePane'\n }\n },\n Terrain: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}',\n options: {\n minZoom: 1,\n maxZoom: 13,\n subdomains: ['server', 'services'],\n attribution: '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 minZoom: 1,\n maxZoom: 13,\n subdomains: ['server', 'services'],\n pane: (pointerEvents) ? 'esri-labels' : 'tilePane'\n }\n },\n USATopo: {\n urlTemplate: tileProtocol + '//{s}.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}',\n options: {\n minZoom: 1,\n maxZoom: 15,\n subdomains: ['server', 'services'],\n attribution: 'USGS, National Geographic Society, i-cubed'\n }\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' && BasemapLayer.TILES[key]) {\n config = 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 L.Util.setOptions(this, tileOptions);\n\n if (this.options.token) {\n config.urlTemplate += ('?token=' + this.options.token);\n }\n\n // call the initialize method on L.TileLayer to set everything up\n L.TileLayer.prototype.initialize.call(this, config.urlTemplate, tileOptions);\n },\n\n onAdd: function (map) {\n if (map.attributionControl) {\n map.attributionControl.addAttribution('© Esri');\n }\n\n if (this.options.pane === 'esri-labels') {\n this._initPane();\n }\n // some basemaps can supply dynamic attribution\n if (this.options.attributionUrl) {\n Util._getAttributionData(this.options.attributionUrl, map);\n }\n map.on('moveend', Util._updateMapAttribution);\n\n L.TileLayer.prototype.onAdd.call(this, map);\n },\n\n onRemove: function (map) {\n if (map.attributionControl) {\n map.attributionControl.removeAttribution('© Esri');\n }\n map.off('moveend', this._updateMapAttribution, this);\n L.TileLayer.prototype.onRemove.call(this, map);\n },\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 = 500;\n }\n },\n\n getAttribution: function () {\n if (this.options.attribution) {\n // the extra 55 pixels are for the ellipsis and leaflet's own attribution\n var maxWidth = (this._map.getSize().x - 55);\n var attribution = '' + this.options.attribution + '';\n }\n return attribution;\n }\n});\n\nexport function basemapLayer (key, options) {\n return new BasemapLayer(key, options);\n}\n\nexport default basemapLayer;\n","import L from 'leaflet';\nimport {warn, cleanUrl} from '../Util';\nimport mapService from '../Services/MapService';\n\nexport var TiledMapLayer = L.TileLayer.extend({\n options: {\n zoomOffsetAllowance: 0.1,\n errorTileUrl: 'http://downloads2.esri.com/support/TechArticles/blank256.png'\n },\n\n statics: {\n MercatorZoomLevels: {\n '0': 156543.03392799999,\n '1': 78271.516963999893,\n '2': 39135.758482000099,\n '3': 19567.879240999901,\n '4': 9783.9396204999593,\n '5': 4891.9698102499797,\n '6': 2445.9849051249898,\n '7': 1222.9924525624899,\n '8': 611.49622628138002,\n '9': 305.74811314055802,\n '10': 152.874056570411,\n '11': 76.437028285073197,\n '12': 38.218514142536598,\n '13': 19.109257071268299,\n '14': 9.5546285356341496,\n '15': 4.7773142679493699,\n '16': 2.38865713397468,\n '17': 1.1943285668550501,\n '18': 0.59716428355981699,\n '19': 0.29858214164761698,\n '20': 0.14929107082381,\n '21': 0.07464553541191,\n '22': 0.0373227677059525,\n '23': 0.0186613838529763\n }\n },\n\n initialize: function (options) {\n options.url = cleanUrl(options.url);\n options = L.Util.setOptions(this, options);\n\n // set the urls\n this.tileUrl = options.url + 'tile/{z}/{y}/{x}';\n this.service = mapService(options);\n this.service.addEventParent(this);\n\n var arcgisonline = new RegExp(/tiles.arcgis(online)?\\.com/g);\n if (arcgisonline.test(options.url)) {\n this.tileUrl = this.tileUrl.replace('://tiles', '://tiles{s}');\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 getTileUrl: function (tilePoint) {\n return L.Util.template(this.tileUrl, L.extend({\n s: this._getSubdomain(tilePoint),\n z: (this._lodMap && this._lodMap[tilePoint.z]) ? this._lodMap[tilePoint.z] : tilePoint.z, // try lod map first, then just defualt to zoom level\n x: tilePoint.x,\n y: tilePoint.y\n }, this.options));\n },\n\n createTile: function (coords, done) {\n var tile = document.createElement('img');\n\n L.DomEvent.on(tile, 'load', L.bind(this._tileOnLoad, this, done, tile));\n L.DomEvent.on(tile, 'error', L.bind(this._tileOnError, this, done, tile));\n\n if (this.options.crossOrigin) {\n tile.crossOrigin = '';\n }\n\n /*\n Alt tag is set to empty string to keep screen readers from reading URL and for compliance reasons\n http://www.w3.org/TR/WCAG20-TECHS/H67\n */\n tile.alt = '';\n\n // if there is no lod map or an lod map with a proper zoom load the tile\n // otherwise wait for the lod map to become available\n if (!this._lodMap || (this._lodMap && this._lodMap[coords.z])) {\n tile.src = this.getTileUrl(coords);\n } else {\n this.once('lodmap', function () {\n tile.src = this.getTileUrl(coords);\n }, this);\n }\n\n return tile;\n },\n\n onAdd: function (map) {\n if (map.options.crs === L.CRS.EPSG3857 && !this._lodMap) {\n this._lodMap = {};\n this.metadata(function (error, metadata) {\n if (!error) {\n var sr = metadata.spatialReference.latestWkid || metadata.spatialReference.wkid;\n if (sr === 102100 || sr === 3857) {\n // create the zoom level data\n var arcgisLODs = metadata.tileInfo.lods;\n var correctResolutions = TiledMapLayer.MercatorZoomLevels;\n\n for (var i = 0; i < arcgisLODs.length; i++) {\n var arcgisLOD = arcgisLODs[i];\n for (var ci in correctResolutions) {\n var correctRes = correctResolutions[ci];\n\n if (this._withinPercentage(arcgisLOD.resolution, correctRes, this.options.zoomOffsetAllowance)) {\n this._lodMap[ci] = arcgisLOD.level;\n break;\n }\n }\n }\n\n this.fire('lodmap');\n } else {\n warn('L.esri.TiledMapLayer is using a non-mercator spatial reference. Support may be available through Proj4Leaflet http://esri.github.io/esri-leaflet/examples/non-mercator-projection.html');\n }\n }\n }, this);\n }\n\n L.TileLayer.prototype.onAdd.call(this, map);\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 find: function () {\n return this.service.find();\n },\n\n query: function () {\n return this.service.query();\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 _withinPercentage: function (a, b, percentage) {\n var diff = Math.abs((a / b) - 1);\n return diff < percentage;\n }\n});\n\nexport function tiledMapLayer (url, options) {\n return new TiledMapLayer(url, options);\n}\n\nexport default tiledMapLayer;\n","import L from 'leaflet';\nimport {cors} from '../Support';\n\nvar Overlay = L.ImageOverlay.extend({\n onAdd: function (map) {\n this._topLeft = map.getPixelBounds().min;\n L.ImageOverlay.prototype.onAdd.call(this, map);\n },\n _reset: function () {\n if (this._map.options.crs === L.CRS.EPSG3857) {\n L.ImageOverlay.prototype._reset.call(this);\n } else {\n L.DomUtil.setPosition(this._image, this._topLeft.subtract(this._map.getPixelOrigin()));\n }\n }\n});\n\nexport var RasterLayer = L.Layer.extend({\n\n options: {\n opacity: 1,\n position: 'front',\n f: 'image',\n useCors: cors,\n attribution: null,\n interactive: false,\n alt: ''\n },\n\n onAdd: function (map) {\n this._update = L.Util.throttle(this._update, this.options.updateInterval, this);\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 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 },\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 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, contentType) {\n if (this._map) {\n // if no output directory has been specified for a service, MIME data will be returned\n if (contentType) {\n url = 'data:' + contentType + ';base64,' + url;\n }\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 Overlay(url, bounds, {\n opacity: 0,\n crossOrigin: this.options.useCors,\n alt: this.options.alt,\n pane: this.options.pane || this.getPane(),\n interactive: this.options.interactive\n }).addTo(this._map);\n\n // once the image loads\n image.once('load', function (e) {\n if (this._map) {\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 with the same bounds\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) && newImage._bounds.equals(this._map.getBounds())) {\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\n this.fire('load', {\n bounds: bounds\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 this._currentImage._map.removeLayer(this._currentImage);\n return;\n }\n\n var params = this._buildExportParams();\n\n this._requestExport(params, bounds);\n },\n\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","import L from 'leaflet';\nimport { RasterLayer } from './RasterLayer';\nimport { cleanUrl } from '../Util';\nimport imageService from '../Services/ImageService';\n\nexport var ImageMapLayer = RasterLayer.extend({\n\n options: {\n updateInterval: 150,\n format: 'jpgpng',\n transparent: true,\n f: 'json'\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 (options) {\n options.url = cleanUrl(options.url);\n this.service = imageService(options);\n this.service.addEventParent(this);\n\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 if (error) { return; } // we really can't do anything here but authenticate or requesterror will fire\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 // ensure that we don't ask ArcGIS Server for a taller image than we have actual map displaying\n var top = this._map.latLngToLayerPoint(bounds._northEast);\n var bottom = this._map.latLngToLayerPoint(bounds._southWest);\n\n if (top.y > 0 || bottom.y < size.y) {\n size.y = bottom.y - top.y;\n }\n\n var sr = parseInt(this._map.options.crs.code.split(':')[1], 10);\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 transparent: this.options.transparent,\n bboxSR: sr,\n imageSR: sr\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.request('exportImage', params, function (error, response) {\n if (error) { return; } // we really can't do anything here but authenticate or requesterror will fire\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\nexport function imageMapLayer (url, options) {\n return new ImageMapLayer(url, options);\n}\n\nexport default imageMapLayer;\n","import L from 'leaflet';\nimport { RasterLayer } from './RasterLayer';\nimport { cleanUrl } from '../Util';\nimport mapService from '../Services/MapService';\n\nexport var DynamicMapLayer = RasterLayer.extend({\n\n options: {\n updateInterval: 150,\n layers: false,\n layerDefs: false,\n timeOptions: false,\n format: 'png24',\n transparent: true,\n f: 'json'\n },\n\n initialize: function (options) {\n options.url = cleanUrl(options.url);\n this.service = mapService(options);\n this.service.addEventParent(this);\n\n if ((options.proxy || options.token) && options.f !== 'json') {\n options.f = 'json';\n }\n L.Util.setOptions(this, options);\n },\n\n getDynamicLayers: function () {\n return this.options.dynamicLayers;\n },\n\n setDynamicLayers: function (dynamicLayers) {\n this.options.dynamicLayers = dynamicLayers;\n this._update();\n return this;\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 if (error) { return; } // we really can't do anything here but authenticate or requesterror will fire\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.getNorthEast());\n var sw = this._map.options.crs.project(bounds.getSouthWest());\n var sr = parseInt(this._map.options.crs.code.split(':')[1], 10);\n\n // ensure that we don't ask ArcGIS Server for a taller image than we have actual map displaying\n var top = this._map.latLngToLayerPoint(bounds._northEast);\n var bottom = this._map.latLngToLayerPoint(bounds._southWest);\n\n if (top.y > 0 || bottom.y < size.y) {\n size.y = bottom.y - top.y;\n }\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: sr,\n imageSR: sr\n };\n\n if (this.options.dynamicLayers) {\n params.dynamicLayers = this.options.dynamicLayers;\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.request('export', params, function (error, response) {\n if (error) { return; } // we really can't do anything here but authenticate or requesterror will fire\n if (response.href) {\n this._renderImage(response.href, bounds);\n } else {\n this._renderImage(response.imageData, bounds, response.contentType);\n }\n }, this);\n } else {\n params.f = 'image';\n this._renderImage(this.options.url + 'export' + L.Util.getParamString(params), bounds);\n }\n }\n});\n\nexport function dynamicMapLayer (url, options) {\n return new DynamicMapLayer(url, options);\n}\n\nexport default dynamicMapLayer;\n","import L from 'leaflet';\n\nvar VirtualGrid = L.Layer.extend({\n\n options: {\n cellSize: 512,\n updateInterval: 150\n },\n\n initialize: function (options) {\n options = L.setOptions(this, options);\n this._zooming = false;\n },\n\n onAdd: function (map) {\n this._map = map;\n this._update = L.Util.throttle(this._update, this.options.updateInterval, this);\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 moveend: this._update,\n zoomstart: this._zoomstart,\n zoomend: this._reset\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 _zoomstart: function () {\n this._zooming = true;\n },\n\n _reset: function () {\n this._removeCells();\n\n this._cells = {};\n this._activeCells = {};\n this._cellsToLoad = 0;\n this._cellsTotal = 0;\n this._cellNumBounds = this._getCellNumBounds();\n\n this._resetWrap();\n this._zooming = false;\n },\n\n _resetWrap: function () {\n var map = this._map;\n var 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) {\n return;\n }\n\n var bounds = this._map.getPixelBounds();\n var cellSize = this._getCellSize();\n\n // cell coordinates range for the current view\n var cellBounds = L.bounds(\n bounds.min.divideBy(cellSize).floor(),\n bounds.max.divideBy(cellSize).floor());\n\n this._removeOtherCells(cellBounds);\n this._addCells(cellBounds);\n\n this.fire('cellsupdated');\n },\n\n _addCells: function (bounds) {\n var queue = [];\n var center = bounds.getCenter();\n var 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 = L.point(i, j);\n coords.z = zoom;\n\n if (this._isValidCell(coords)) {\n queue.push(coords);\n }\n }\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 _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 var cellSize = this.options.cellSize;\n var nwPoint = coords.multiplyBy(cellSize);\n var sePoint = nwPoint.add([cellSize, cellSize]);\n var nw = map.wrapLatLng(map.unproject(nwPoint, coords.z));\n var se = map.wrapLatLng(map.unproject(sePoint, coords.z));\n\n return 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 var x = parseInt(kArr[0], 10);\n var y = parseInt(kArr[1], 10);\n\n return 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\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 // 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 _getCellNumBounds: function () {\n var bounds = this._map.getPixelWorldBounds();\n var 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\nexport default VirtualGrid;\n","function BinarySearchIndex (values) {\n this.values = [].concat(values || []);\n}\n\nBinarySearchIndex.prototype.query = function (value) {\n var index = this.getIndex(value);\n return this.values[index];\n};\n\nBinarySearchIndex.prototype.getIndex = function getIndex (value) {\n if (this.dirty) {\n this.sort();\n }\n\n var minIndex = 0;\n var maxIndex = this.values.length - 1;\n var currentIndex;\n var currentElement;\n\n while (minIndex <= maxIndex) {\n currentIndex = (minIndex + maxIndex) / 2 | 0;\n currentElement = this.values[Math.round(currentIndex)];\n if (+currentElement.value < +value) {\n minIndex = currentIndex + 1;\n } else if (+currentElement.value > +value) {\n maxIndex = currentIndex - 1;\n } else {\n return currentIndex;\n }\n }\n\n return Math.abs(~maxIndex);\n};\n\nBinarySearchIndex.prototype.between = function between (start, end) {\n var startIndex = this.getIndex(start);\n var endIndex = this.getIndex(end);\n\n if (startIndex === 0 && endIndex === 0) {\n return [];\n }\n\n while (this.values[startIndex - 1] && this.values[startIndex - 1].value === start) {\n startIndex--;\n }\n\n while (this.values[endIndex + 1] && this.values[endIndex + 1].value === end) {\n endIndex++;\n }\n\n if (this.values[endIndex] && this.values[endIndex].value === end && this.values[endIndex + 1]) {\n endIndex++;\n }\n\n return this.values.slice(startIndex, endIndex);\n};\n\nBinarySearchIndex.prototype.insert = function insert (item) {\n this.values.splice(this.getIndex(item.value), 0, item);\n return this;\n};\n\nBinarySearchIndex.prototype.bulkAdd = function bulkAdd (items, sort) {\n this.values = this.values.concat([].concat(items || []));\n\n if (sort) {\n this.sort();\n } else {\n this.dirty = true;\n }\n\n return this;\n};\n\nBinarySearchIndex.prototype.sort = function sort () {\n this.values.sort(function (a, b) {\n return +b.value - +a.value;\n }).reverse();\n this.dirty = false;\n return this;\n};\n\nexport default BinarySearchIndex;\n","import L from 'leaflet';\nimport featureLayerService from '../../Services/FeatureLayerService';\nimport { cleanUrl, warn } from '../../Util';\nimport VirtualGrid from 'leaflet-virtual-grid';\nimport BinarySearchIndex from 'tiny-binary-search';\n\nexport var FeatureManager = VirtualGrid.extend({\n /**\n * Options\n */\n\n options: {\n attribution: null,\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 (options) {\n VirtualGrid.prototype.initialize.call(this, options);\n\n options.url = cleanUrl(options.url);\n options = L.setOptions(this, options);\n\n this.service = featureLayerService(options);\n this.service.addEventParent(this);\n\n // use case insensitive regex to look for common fieldnames used for indexing\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) {\n 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 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 },\n\n /**\n * Layer Interface\n */\n\n onAdd: function (map) {\n // check to see whether service is 10.4 or above (and can emit GeoJSON natively)\n this.service.metadata(function (error, metadata) {\n var supportedFormats = metadata.supportedQueryFormats;\n if (supportedFormats && supportedFormats.indexOf('geoJSON') !== -1) {\n this.service.options.isModern = true;\n }\n }, this);\n\n map.on('zoomend', this._handleZoomChange, this);\n\n return VirtualGrid.prototype.onAdd.call(this, map);\n },\n\n onRemove: function (map) {\n map.off('zoomend', this._handleZoomChange, this);\n\n return VirtualGrid.prototype.onRemove.call(this, map);\n },\n\n getAttribution: function () {\n return this.options.attribution;\n },\n\n /**\n * Feature Management\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 }, true);\n }\n\n return this._buildQuery(bounds).run(function (error, featureCollection, response) {\n if (response && response.exceededTransferLimit) {\n this.fire('drawlimitexceeded');\n }\n\n // no error, features\n if (!error && featureCollection && featureCollection.features.length) {\n // schedule adding features until the next animation frame\n L.Util.requestAnimFrame(L.Util.bind(function () {\n this._addFeatures(featureCollection.features, coords);\n this._postProcessFeatures(bounds);\n }, this));\n }\n\n // no error, no features\n if (!error && featureCollection && !featureCollection.features.length) {\n this._postProcessFeatures(bounds);\n }\n\n if (error) {\n this._postProcessFeatures(bounds);\n }\n\n if (callback) {\n callback.call(this, error, featureCollection);\n }\n }, this);\n },\n\n _postProcessFeatures: function (bounds) {\n // deincriment the request counter now that we have processed features\n this._activeRequests--;\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 },\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 // need to PR removal of the logic below too...\n // https://github.com/patrickarlt/leaflet-virtual-grid/blob/master/src/virtual-grid.js#L100-L102\n\n this.createLayers(features);\n },\n\n _buildQuery: function (bounds) {\n var query = this.service.query()\n .intersects(bounds)\n .where(this.options.where)\n .fields(this.options.fields)\n .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 this.options.where = (where && where.length) ? where : '1=1';\n\n var oldSnapshot = [];\n var newSnapshot = [];\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 newSnapshot.push(featureCollection.features[i].id);\n }\n }\n\n pendingRequests--;\n\n if (pendingRequests <= 0) {\n this._currentSnapshot = newSnapshot;\n // schedule adding features for the next animation frame\n L.Util.requestAnimFrame(L.Util.bind(function () {\n this.removeLayers(oldSnapshot);\n this.addLayers(newSnapshot);\n if (callback) {\n callback.call(context, requestError);\n }\n }, this));\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 return this;\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 if (this.redraw) {\n this.once('load', function () {\n this.eachFeature(function (layer) {\n this._redraw(layer.feature.id);\n }, this);\n }, this);\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 L.Util.requestAnimFrame(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 _visibleZoom: function () {\n // check to see whether the current zoom level of the map is within the optional limit defined for the FeatureLayer\n if (!this._map) {\n return false;\n }\n var zoom = this._map.getZoom();\n if (zoom > this.options.maxZoom || zoom < this.options.minZoom) {\n return false;\n } else { return true; }\n },\n\n _handleZoomChange: function () {\n if (!this._visibleZoom()) {\n this.removeLayers(this._currentSnapshot);\n this._currentSnapshot = [];\n } else {\n /*\n for every cell in this._activeCells\n 1. Get the cache key for the coords of the cell\n 2. If this._cache[key] exists it will be an array of feature IDs.\n 3. Call this.addLayers(this._cache[key]) to instruct the feature layer to add the layers back.\n */\n for (var i in this._activeCells) {\n var coords = this._activeCells[i].coords;\n var key = this._cacheKey(coords);\n if (this._cache[key]) {\n this.addLayers(this._cache[key]);\n }\n }\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 _getMetadata: function (callback) {\n if (this._metadata) {\n var error;\n callback(error, this._metadata);\n } else {\n this.metadata(L.Util.bind(function (error, response) {\n this._metadata = response;\n callback(error, this._metadata);\n }, this));\n }\n },\n\n addFeature: function (feature, callback, context) {\n this._getMetadata(L.Util.bind(function (error, metadata) {\n if (error) {\n if (callback) { callback.call(this, error, null); }\n return;\n }\n\n this.service.addFeature(feature, L.Util.bind(function (error, response) {\n if (!error) {\n // assign ID from result to appropriate objectid field from service metadata\n feature.properties[metadata.objectIdField] = response.objectId;\n\n // we also need to update the geojson id for createLayers() to function\n feature.id = response.objectId;\n this.createLayers([feature]);\n }\n\n if (callback) {\n callback.call(context, error, response);\n }\n }, this));\n }, this));\n },\n\n updateFeature: function (feature, callback, context) {\n this.service.updateFeature(feature, function (error, response) {\n if (!error) {\n this.removeLayers([feature.id], true);\n this.createLayers([feature]);\n }\n\n if (callback) {\n callback.call(context, error, response);\n }\n }, this);\n },\n\n deleteFeature: function (id, callback, context) {\n 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 deleteFeatures: function (ids, callback, context) {\n return this.service.deleteFeatures(ids, function (error, response) {\n if (!error && response.length > 0) {\n for (var i = 0; i < response.length; i++) {\n this.removeLayers([response[i].objectId], true);\n }\n }\n if (callback) {\n callback.call(context, error, response);\n }\n }, this);\n }\n});\n","import L from 'leaflet';\nimport { FeatureManager } from './FeatureManager';\n\nexport var FeatureLayer = FeatureManager.extend({\n\n options: {\n cacheLayers: true\n },\n\n /**\n * Constructor\n */\n initialize: function (options) {\n FeatureManager.prototype.initialize.call(this, options);\n this._originalStyle = this.options.style;\n this._layers = {};\n },\n\n /**\n * Layer Interface\n */\n\n onRemove: function (map) {\n for (var i in this._layers) {\n map.removeLayer(this._layers[i]);\n // trigger the event when the entire featureLayer is removed from the map\n this.fire('removefeature', {\n feature: this._layers[i].feature,\n permanent: false\n }, true);\n }\n\n return FeatureManager.prototype.onRemove.call(this, map);\n },\n\n createNewLayer: function (geojson) {\n var layer = L.GeoJSON.geometryToLayer(geojson, this.options);\n layer.defaultOptions = layer.options;\n return layer;\n },\n\n _updateLayer: function (layer, geojson) {\n // convert the geojson coordinates into a Leaflet LatLng array/nested arrays\n // pass it to setLatLngs to update layer geometries\n var latlngs = [];\n var coordsToLatLng = this.options.coordsToLatLng || L.GeoJSON.coordsToLatLng;\n\n // copy new attributes, if present\n if (geojson.properties) {\n layer.feature.properties = geojson.properties;\n }\n\n switch (geojson.geometry.type) {\n case 'Point':\n latlngs = L.GeoJSON.coordsToLatLng(geojson.geometry.coordinates);\n layer.setLatLng(latlngs);\n break;\n case 'LineString':\n latlngs = L.GeoJSON.coordsToLatLngs(geojson.geometry.coordinates, 0, coordsToLatLng);\n layer.setLatLngs(latlngs);\n break;\n case 'MultiLineString':\n latlngs = L.GeoJSON.coordsToLatLngs(geojson.geometry.coordinates, 1, coordsToLatLng);\n layer.setLatLngs(latlngs);\n break;\n case 'Polygon':\n latlngs = L.GeoJSON.coordsToLatLngs(geojson.geometry.coordinates, 1, coordsToLatLng);\n layer.setLatLngs(latlngs);\n break;\n case 'MultiPolygon':\n latlngs = L.GeoJSON.coordsToLatLngs(geojson.geometry.coordinates, 2, coordsToLatLng);\n layer.setLatLngs(latlngs);\n break;\n }\n },\n\n /**\n * Feature Management Methods\n */\n\n createLayers: function (features) {\n for (var i = features.length - 1; i >= 0; i--) {\n var geojson = features[i];\n\n var layer = this._layers[geojson.id];\n var newLayer;\n\n if (this._visibleZoom() && layer && !this._map.hasLayer(layer)) {\n this._map.addLayer(layer);\n this.fire('addfeature', {\n feature: layer.feature\n }, true);\n }\n\n // update geometry if necessary\n if (layer && this.options.simplifyFactor > 0 && (layer.setLatLngs || layer.setLatLng)) {\n this._updateLayer(layer, geojson);\n }\n\n if (!layer) {\n newLayer = this.createNewLayer(geojson);\n newLayer.feature = geojson;\n\n // bubble events from individual layers to the feature layer\n newLayer.addEventParent(this);\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.setFeatureStyle(newLayer.feature.id, this.options.style);\n\n this.fire('createfeature', {\n feature: newLayer.feature\n }, true);\n\n // add the layer if the current zoom level is inside the range defined for the layer, it is within the current time bounds or our layer is not time enabled\n if (this._visibleZoom() && (!this.options.timeField || (this.options.timeField && this._featureWithinTimeRange(geojson)))) {\n this.fire('addfeature', {\n feature: newLayer.feature\n }, true);\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 }, true);\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 }, true);\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 && this._map) {\n L.Util.requestAnimFrame(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 L.Util.requestAnimFrame(L.Util.bind(function () {\n if (this._map) {\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 }\n }, this));\n }\n },\n\n /**\n * Styling Methods\n */\n\n resetStyle: function () {\n this.options.style = this._originalStyle;\n this.eachFeature(function (layer) {\n this.resetFeatureStyle(layer.feature.id);\n }, this);\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 resetFeatureStyle: function (id) {\n var layer = this._layers[id];\n var style = this._originalStyle || L.Path.prototype.options;\n if (layer) {\n L.Util.extend(layer.options, layer.defaultOptions);\n this.setFeatureStyle(id, style);\n }\n return this;\n },\n\n setFeatureStyle: function (id, style) {\n var layer = this._layers[id];\n if (typeof style === 'function') {\n style = style(layer.feature);\n }\n if (layer.setStyle) {\n layer.setStyle(style);\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 bringToBack: function () {\n this.eachFeature(function (layer) {\n if (layer.bringToBack) {\n layer.bringToBack();\n }\n });\n },\n\n bringToFront: function () {\n this.eachFeature(function (layer) {\n if (layer.bringToFront) {\n layer.bringToFront();\n }\n });\n },\n\n redraw: function (id) {\n if (id) {\n this._redraw(id);\n }\n return this;\n },\n\n _redraw: function (id) {\n var layer = this._layers[id];\n var geojson = layer.feature;\n\n // if this looks like a marker\n if (layer && layer.setIcon && this.options.pointToLayer) {\n // update custom symbology, if necessary\n if (this.options.pointToLayer) {\n var getIcon = this.options.pointToLayer(geojson, L.latLng(geojson.geometry.coordinates[1], geojson.geometry.coordinates[0]));\n var updatedIcon = getIcon.options.icon;\n layer.setIcon(updatedIcon);\n }\n }\n\n // looks like a vector marker (circleMarker)\n if (layer && layer.setStyle && this.options.pointToLayer) {\n var getStyle = this.options.pointToLayer(geojson, L.latLng(geojson.geometry.coordinates[1], geojson.geometry.coordinates[0]));\n var updatedStyle = getStyle.options;\n this.setFeatureStyle(geojson.id, updatedStyle);\n }\n\n // looks like a path (polygon/polyline)\n if (layer && layer.setStyle && this.options.style) {\n this.resetStyle(geojson.id);\n }\n }\n});\n\nexport function featureLayer (options) {\n return new FeatureLayer(options);\n}\n\nexport default featureLayer;\n"],"names":["serialize","params","data","f","key","hasOwnProperty","value","param","type","Object","prototype","toString","call","length","JSON","stringify","join","valueOf","encodeURIComponent","createRequest","callback","context","httpRequest","window","XMLHttpRequest","onerror","e","onreadystatechange","L","Util","falseFn","error","code","message","response","readyState","parse","responseText","ontimeout","this","xmlHttpPost","url","open","options","timeout","setRequestHeader","send","xmlHttpGet","request","paramString","requestLength","Support","cors","jsonp","warn","_EsriLeafletCallbacks","callbackId","callbacks","responseType","script","DomUtil","create","document","body","src","id","abort","_callback","pointsEqual","a","b","i","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","orientRings","poly","output","shift","flattenMultiPolygonRings","shallowClone","obj","target","arcgisToGeoJSON","arcgis","idAttribute","geojson","y","points","paths","geometry","attributes","properties","OBJECTID","FID","geojsonToArcGIS","spatialReference","wkid","result","features","geometries","idAttr","g2a","a2g","extentToBounds","extent","sw","latLng","ymin","xmin","ne","ymax","xmax","latLngBounds","boundsToExtent","bounds","getSouthWest","lng","lat","getNorthEast","responseToFeatureCollection","objectIdField","objectIdFieldName","fields","name","featureCollection","results","feature","cleanUrl","trim","isArcgisOnline","test","geojsonTypeToArcGIS","geoJsonType","arcgisGeometryType","console","apply","arguments","_getAttributionData","map","bind","attributions","_esriAttributions","c","contributors","contributor","attribution","coverageAreas","coverageArea","southWest","bbox","northEast","score","minZoom","zoomMin","maxZoom","zoomMax","sort","_updateMapAttribution","evt","oldAttributions","attributionControl","newAttributions","getBounds","wrappedBounds","wrap","zoom","getZoom","text","match","substr","attributionElement","_container","querySelector","innerHTML","style","maxWidth","getSize","fire","task","Task","query","Query","find","Find","identify","Identify","identifyFeatures","IdentifyFeatures","identifyImage","IdentifyImage","service","Service","mapService","MapService","imageService","ImageService","featureLayerService","FeatureLayerService","basemapLayer","BasemapLayer","tiledMapLayer","TiledMapLayer","imageMapLayer","ImageMapLayer","dynamicMapLayer","DynamicMapLayer","BinarySearchIndex","values","concat","featureLayer","FeatureLayer","pointerEvents","documentElement","get","CORS","JSONP","Request","post","Class","extend","proxy","useCors","generateSetter","initialize","endpoint","_service","setOptions","setters","setter","token","authenticate","path","_request","method","offset","limit","precision","featureIds","returnGeometry","where","outSr","outFields","within","_setGeometry","spatialRel","crosses","touches","overlaps","nearby","latlng","radius","geometryType","units","distance","inSr","string","between","start","end","time","simplify","factor","mapWidth","Math","abs","getWest","getEast","maxAllowableOffset","orderBy","fieldName","order","orderByFields","run","_cleanParams","isModern","_trapSQLerrors","count","returnCountOnly","ids","returnIdsOnly","objectIds","returnExtentOnly","pixelSize","layer","LatLngBounds","getLatLng","LatLng","GeoJSON","getLayers","toGeoJSON","sr","layers","dynamicLayers","returnZ","returnM","gdbVersion","layerDefs","tolerance","on","size","imageDisplay","mapExtent","at","layerDef","undefined","layerId","setMosaicRule","setRenderingRule","setPixelSize","returnCatalogItems","getMosaicRule","mosaicRule","getRenderingRule","renderingRule","getPixelSize","_responseToGeoJSON","location","catalogItems","catalogItemVisibilities","geoJSON","pixel","crs","objectId","Values","catalogItemVisibility","Evented","_requestQueue","_authenticating","metadata","_runQueue","getTimeout","setTimeout","wrappedCallback","_createServiceCallback","addFeature","addResults","updateFeature","updateResults","deleteFeature","deleteResults","deleteFeatures","tileProtocol","protocol","TileLayer","statics","TILES","Streets","urlTemplate","subdomains","attributionUrl","Topographic","Oceans","OceansLabels","pane","NationalGeographic","DarkGray","DarkGrayLabels","Gray","GrayLabels","Imagery","ImageryLabels","ImageryTransportation","ShadedRelief","ShadedReliefLabels","Terrain","TerrainLabels","USATopo","config","Error","tileOptions","onAdd","addAttribution","_initPane","onRemove","removeAttribution","off","_map","getPane","createPane","zIndex","getAttribution","zoomOffsetAllowance","errorTileUrl","MercatorZoomLevels","0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","tileUrl","addEventParent","arcgisonline","RegExp","replace","getTileUrl","tilePoint","template","s","_getSubdomain","z","_lodMap","createTile","coords","done","tile","createElement","DomEvent","_tileOnLoad","_tileOnError","crossOrigin","alt","once","CRS","EPSG3857","latestWkid","arcgisLODs","tileInfo","lods","correctResolutions","arcgisLOD","ci","correctRes","_withinPercentage","resolution","level","tokenQs","percentage","diff","Overlay","ImageOverlay","_topLeft","getPixelBounds","min","_reset","setPosition","_image","subtract","getPixelOrigin","RasterLayer","Layer","opacity","position","interactive","_update","throttle","updateInterval","_currentImage","_bounds","equals","addLayer","removeLayer","_popup","_getPopupData","_resetPopupState","bindPopup","fn","popupOptions","_shouldRenderPopup","_lastClick","popup","_popupFunction","unbindPopup","closePopup","bringToFront","bringToBack","getOpacity","setOpacity","getTimeRange","from","to","setTimeRange","_renderImage","contentType","image","addTo","newImage","oldImage","_animatingZoom","_panTransition","_inProgress","_buildExportParams","_requestExport","_renderPopup","content","setLatLng","setContent","openOn","format","transparent","setPixelType","pixelType","getPixelType","setBandIds","bandIds","isArray","getBandIds","setNoData","noData","noDataInterpretation","getNoData","getNoDataInterpretation","identifyRequest","project","_northEast","_southWest","top","latLngToLayerPoint","bottom","parseInt","split","bboxSR","imageSR","interpolation","compressionQuality","href","getParamString","timeOptions","getDynamicLayers","setDynamicLayers","setLayers","getLayerDefs","setLayerDefs","getTimeOptions","setTimeOptions","dpi","imageData","VirtualGrid","cellSize","_zooming","removeEventListener","getEvents","_removeCells","events","moveend","zoomstart","_zoomstart","zoomend","removeFrom","_cells","_activeCells","_cellsToLoad","_cellsTotal","_cellNumBounds","_getCellNumBounds","_resetWrap","infinite","_getCellSize","wrapLng","_wrapLng","floor","ceil","wrapLat","_wrapLat","cellBounds","divideBy","max","_removeOtherCells","_addCells","queue","center","getCenter","_isValidCell","cellsToLoad","distanceTo","_addCell","_cellCoordsToBounds","nwPoint","multiplyBy","sePoint","add","nw","wrapLatLng","unproject","se","_cellCoordsToKey","_keyToCellCoords","kArr","_removeCell","cell","cellLeave","_wrapCoords","cellEnter","createCell","wrapNum","getPixelWorldBounds","index","getIndex","dirty","currentIndex","currentElement","minIndex","maxIndex","round","startIndex","endIndex","insert","item","splice","bulkAdd","items","FeatureManager","timeField","timeFilterMode","simplifyFactor","oidCheck","_startTimeIndex","_endTimeIndex","_timeIndex","_cache","_currentSnapshot","_activeRequests","supportedFormats","supportedQueryFormats","indexOf","_handleZoomChange","_requestFeatures","_buildQuery","exceededTransferLimit","requestAnimFrame","_addFeatures","_postProcessFeatures","_cacheKey","_buildTimeIndexes","createLayers","setWhere","oldSnapshot","newSnapshot","pendingRequests","requestError","requestCallback","removeLayers","addLayers","getWhere","oldFrom","oldTo","_filterExistingFeatures","refresh","redraw","eachFeature","_redraw","newFrom","newTo","layersToRemove","_getFeaturesInTimeRange","layersToAdd","shouldRemoveLayer","search","startTimes","endTimes","startTimeEntries","endTimeEntries","Date","timeEntries","_featureWithinTimeRange","date","startDate","endDate","_visibleZoom","_getMetadata","_metadata","cacheLayers","_originalStyle","_layers","permanent","createNewLayer","geometryToLayer","defaultOptions","_updateLayer","latlngs","coordsToLatLng","coordsToLatLngs","setLatLngs","newLayer","hasLayer","onEachFeature","setFeatureStyle","cacheKey","cellKey","mapBounds","removable","resetStyle","resetFeatureStyle","setStyle","Path","getFeature","setIcon","pointToLayer","getIcon","updatedIcon","icon","getStyle","updatedStyle"],"mappings":";;;mPEMA,SAASA,GAAWC,GAClB,GAAIC,GAAO,EAEXD,GAAOE,EAAIF,EAAOE,GAAK,MAEvB,KAAK,GAAIC,KAAOH,GACd,GAAIA,EAAOI,eAAeD,GAAM,CAC9B,GAEIE,GAFAC,EAAQN,EAAOG,GACfI,EAAOC,OAAOC,UAAUC,SAASC,KAAKL,EAGtCL,GAAKW,SACPX,GAAQ,KAIRI,EADW,mBAATE,EACoD,oBAA7CC,OAAOC,UAAUC,SAASC,KAAKL,EAAM,IAA6BO,KAAKC,UAAUR,GAASA,EAAMS,KAAK,KAC5F,oBAATR,EACDM,KAAKC,UAAUR,GACL,kBAATC,EACDD,EAAMU,UAENV,EAGVL,GAAQgB,mBAAmBd,GAAO,IAAMc,mBAAmBZ,GAI/D,MAAOJ,GAGT,QAASiB,GAAeC,EAAUC,GAChC,GAAIC,GAAc,GAAIC,QAAOC,cA2C7B,OAzCAF,GAAYG,QAAU,SAAUC,GAC9BJ,EAAYK,mBAAqBC,EAAEC,KAAKC,QAExCV,EAASR,KAAKS,GACZU,OACEC,KAAM,IACNC,QAAS,yBAEV,OAGLX,EAAYK,mBAAqB,WAC/B,GAAIO,GACAH,CAEJ,IAA+B,IAA3BT,EA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