diff --git a/dist/esri-leaflet-debug.js b/dist/esri-leaflet-debug.js new file mode 100644 index 000000000..ecf1c227e --- /dev/null +++ b/dist/esri-leaflet-debug.js @@ -0,0 +1,3888 @@ +/* esri-leaflet - v2.0.4 - Tue Oct 18 2016 16:30:39 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.4"; + + var cors = ((window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest())); + var pointerEvents = document.documentElement.style.pointerEvents === ''; + + var Support = { + cors: cors, + pointerEvents: pointerEvents + }; + + var options = { + attributionWidthOffset: 55 + }; + + 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; + var features = response.features || response.results; + var count = features.length; + + 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 if (count) { + /* as a last resort, check for common ID fieldnames in the first feature returned + not foolproof. identifyFeatures can returned a mixed array of features. */ + for (var key in features[0].attributes) { + if (key.match(/^(OBJECTID|FID|OID|ID)$/i)) { + objectIdField = key; + break; + } + } + } + + var featureCollection = { + type: 'FeatureCollection', + features: [] + }; + + if (count) { + 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 calcAttributionWidth (map) { + // either crop at 55px or user defined buffer + return (map.getSize().x - options.attributionWidthOffset) + 'px'; + } + + function setEsriAttribution (map) { + if (map.attributionControl && !map.attributionControl._esriAttributionAdded) { + map.attributionControl.setPrefix('Leaflet | Powered by Esri'); + + var hoverAttributionStyle = document.createElement('style'); + hoverAttributionStyle.type = 'text/css'; + hoverAttributionStyle.innerHTML = '.esri-truncated-attribution:hover {' + + 'white-space: normal;' + + '}'; + + document.getElementsByTagName('head')[0].appendChild(hoverAttributionStyle); + L.DomUtil.addClass(map.attributionControl._container, 'esri-truncated-attribution:hover'); + + // define a new css class in JS to trim attribution into a single line + var attributionStyle = document.createElement('style'); + attributionStyle.type = 'text/css'; + attributionStyle.innerHTML = '.esri-truncated-attribution {' + + 'vertical-align: -3px;' + + 'white-space: nowrap;' + + 'overflow: hidden;' + + 'text-overflow: ellipsis;' + + 'display: inline-block;' + + 'transition: 0s white-space;' + + 'transition-delay: 1s;' + + 'max-width: ' + calcAttributionWidth(map) + ';' + + '}'; + + document.getElementsByTagName('head')[0].appendChild(attributionStyle); + L.DomUtil.addClass(map.attributionControl._container, 'esri-truncated-attribution'); + + // update the width used to truncate when the map itself is resized + map.on('resize', function (e) { + map.attributionControl._container.style.maxWidth = calcAttributionWidth(e.target); + }); + + map.attributionControl._esriAttributionAdded = true; + } + } + + 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]; + + 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 }; + _updateMapAttribution(obj); + }, this)); + } + + function _updateMapAttribution (evt) { + var 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-dynamic-attribution'); + + attributionElement.innerHTML = newAttributions; + attributionElement.style.maxWidth = calcAttributionWidth(map); + + 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, + calcAttributionWidth: calcAttributionWidth, + setEsriAttribution: setEsriAttribution, + _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' || geometry.type === 'MultiPolygon') { + 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 L.LatLng, L.LatLngBounds, L.Marker or a GeoJSON Point, Line, Polygon or MultiPolygon 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', + attribution: '' + + } + }, + 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', + attribution: '' + } + }, + 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', + attribution: '' + } + }, + 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', + attribution: '' + } + }, + 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', + attribution: '' + } + }, + 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", "TerrainLabels" or "USATopo"'); + } + + // 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) { + // include 'Powered by Esri' in map attribution + setEsriAttribution(map); + + if (this.options.pane === 'esri-labels') { + this._initPane(); + } + // some basemaps can supply dynamic attribution + if (this.options.attributionUrl) { + _getAttributionData(this.options.attributionUrl, map); + } + + map.on('moveend', _updateMapAttribution); + + L.TileLayer.prototype.onAdd.call(this, map); + }, + + onRemove: function (map) { + map.off('moveend', _updateMapAttribution); + 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) { + 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) { + // include 'Powered by Esri' in map attribution + setEsriAttribution(map); + + if (map.options.crs === L.CRS.EPSG3857 && !this._lodMap) { + this._lodMap = {}; + this.metadata(function (error, metadata) { + if (!error && metadata.spatialReference) { + var sr = metadata.spatialReference.latestWkid || metadata.spatialReference.wkid; + if (!this.options.attribution && map.attributionControl && metadata.copyrightText) { + this.options.attribution = metadata.copyrightText; + map.attributionControl.addAttribution(this.getAttribution()); + } + 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) { + // include 'Powered by Esri' in map attribution + setEsriAttribution(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); + } + + // add copyright text listed in service metadata + this.metadata(function (err, metadata) { + if (!err && !this.options.attribution && map.attributionControl && metadata.copyrightText) { + this.options.attribution = metadata.copyrightText; + map.attributionControl.addAttribution(this.getAttribution()); + } + }, 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 + if (this.options.token) { + response.href += ('?token=' + this.options.token); + } + 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 (this.options.token) { + response.href += ('?token=' + this.options.token); + } + 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) { + // include 'Powered by Esri' in map attribution + setEsriAttribution(map); + + this.service.metadata(function (err, metadata) { + if (!err) { + var supportedFormats = metadata.supportedQueryFormats; + // check to see whether service can emit GeoJSON natively + if (supportedFormats && supportedFormats.indexOf('geoJSON') !== -1) { + this.service.options.isModern = true; + } + // add copyright text listed in service metadata + if (!this.options.attribution && map.attributionControl && metadata.copyrightText) { + this.options.attribution = metadata.copyrightText; + map.attributionControl.addAttribution(this.getAttribution()); + } + } + }, 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.options = options; + 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXNyaS1sZWFmbGV0LWRlYnVnLmpzIiwic291cmNl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1dGlvbjogJydcblxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgR3JheToge1xuICAgICAgICB1cmxUZW1wbGF0ZTogdGlsZVByb3RvY29sICsgJy8ve3N9LmFyY2dpc29ubGluZS5jb20vQXJjR0lTL3Jlc3Qvc2VydmljZXMvQ2FudmFzL1dvcmxkX0xpZ2h0X0dyYXlfQmFzZS9NYXBTZXJ2ZXIvdGlsZS97en0ve3l9L3t4fScsXG4gICAgICAgIG9wdGlvbnM6IHtcbiAgICAgICAgICBtaW5ab29tOiAxLFxuICAgICAgICAgIG1heFpvb206IDE2LFxuICAgICAgICAgIHN1YmRvbWFpbnM6IFsnc2VydmVyJywgJ3NlcnZpY2VzJ10sXG4gICAgICAgICAgYXR0cmlidXRpb246ICdIRVJFLCBEZUxvcm1lLCBNYXBteUluZGlhLCAmY29weTsgT3BlblN0cmVldE1hcCBjb250cmlidXRvcnMnXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBHcmF5TGFiZWxzOiB7XG4gICAgICAgIHVybFRlbXBsYXRlOiB0aWxlUHJvdG9jb2wgKyAnLy97c30uYXJjZ2lzb25saW5lLmNvbS9BcmNHSVMvcmVzdC9zZXJ2aWNlcy9DYW52YXMvV29ybGRfTGlnaHRfR3JheV9SZWZlcmVuY2UvTWFwU2VydmVyL3RpbGUve3p9L3t5fS97eH0nLFxuICAgICAgICBvcHRpb25zOiB7XG4gICAgICAgICAgbWluWm9vbTogMSxcbiAgICAgICAgICBtYXhab29tOiAxNixcbiAgICAgICAgICBzdWJkb21haW5zOiBbJ3NlcnZlcicsICdzZXJ2aWNlcyddLFxuICAgICAgICAgIHBhbmU6IChwb2ludGVyRXZlbnRzKSA/ICdlc3JpLWxhYmVscycgOiAndGlsZVBhbmUnLFxuICAgICAgICAgIGF0dHJpYnV0aW9uOiAnJ1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgSW1hZ2VyeToge1xuICAgICAgICB1cmxUZW1wbGF0ZTogdGlsZVByb3RvY29s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AgICAgIG1pblpvb206IDEsXG4gICAgICAgICAgbWF4Wm9vbTogMTIsXG4gICAgICAgICAgc3ViZG9tYWluczogWydzZXJ2ZXInLCAnc2VydmljZXMnXSxcbiAgICAgICAgICBwYW5lOiAocG9pbnRlckV2ZW50cykgPyAnZXNyaS1sYWJlbHMnIDogJ3RpbGVQYW5lJyxcbiAgICAgICAgICBhdHRyaWJ1dGlvbjogJydcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIFRlcnJhaW46IHtcbiAgICAgICAgdXJsVGVtcGxhdGU6IHRpbGVQcm90b2NvbCArICcvL3tzfS5hcmNnaXNvbmxpbmUuY29tL0FyY0dJUy9yZXN0L3NlcnZpY2VzL1dvcmxkX1RlcnJhaW5fQmFzZS9NYXBTZXJ2ZXIvdGlsZS97en0ve3l9L3t4fScsXG4gICAgICAgIG9wdGlvbnM6IHtcbiAgICAgICAgICBtaW5ab29tOiAxLFxuICAgICAgICAgIG1heFpvb206IDEzLFxuICAgICAgICAgIHN1YmRvbWFpbnM6IFsnc2VydmVyJywgJ3NlcnZpY2VzJ10sXG4gICAgICAgICAgYXR0cmlidXRpb246ICdVU0dTLCBOT0FBJ1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgVGVycmFpbkxhYmVsczoge1xuICAgICAgICB1cmxUZW1wbGF0ZTogdGlsZVByb3RvY29sICsgJy8ve3N9LmFyY2dpc29ubGluZS5jb20vQXJjR0lTL3Jlc3Qvc2VydmljZXMvUmVmZXJlbmNlL1dvcmxkX1JlZmVyZW5jZV9PdmVybGF5L01hcFNlcnZlci90aWxlL3t6fS97eX0ve3h9JyxcbiAgICAgICAgb3B0aW9uczoge1xuICAgICAgICAgIG1pblpvb206IDEsXG4gICAgICAgICAgbWF4Wm9vbTogMTMsXG4gICAgICAgICAgc3ViZG9tYWluczogWydzZXJ2ZXInLCAnc2VydmljZXMnXSxcbiAgICAgICAgICBwYW5lOiAocG9pbnRlckV2ZW50cykgPyAnZXNyaS1sYWJlbHMn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cm9sLmFkZEF0dHJpYnV0aW9uKHRoaXMuZ2V0QXR0cmlidXRpb24oKSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzciA9PT0gMTAyMTAwIHx8IHNyID09PSAzODU3KSB7XG4gICAgICAgICAgICAvLyBjcmVhdGUgdGhlIHpvb20gbGV2ZWwgZGF0YVxuICAgICAgICAgICAgdmFyIGFyY2dpc0xPRHMgPSBtZXRhZGF0YS50aWxlSW5mby5sb2RzO1xuICAgICAgICAgICAgdmFyIGNvcnJlY3RSZXNvbHV0aW9ucyA9IFRpbGVkTWFwTGF5ZXIuTWVyY2F0b3Jab29tTGV2ZWxzO1xuXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFyY2dpc0xPRHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgdmFyIGFyY2dpc0xPRCA9IGFyY2dpc0xPRHNbaV07XG4gICAgICAgICAgICAgIGZvciAodmFyIGNpIGluIGNvcnJlY3RSZXNvbHV0aW9ucykge1xuICAgICAgICAgICAgICAgIHZhciBjb3JyZWN0UmVzID0gY29ycmVjdFJlc29sdXRpb25zW2NpXTtcblxuICAgICAgICAgICAgICAgIGlmICh0aGlzLl93aXRoaW5QZXJjZW50YWdlKGFyY2dpc0xPRC5yZXNvbHV0aW9uLCBjb3JyZWN0UmVzLCB0aGlzLm9wdGlvbnMuem9vbU9mZnNldEFsbG93YW5jZSkpIHtcbiAgICAgICAgICAgICAgICAgIHRoaXMuX2xvZE1hcFtjaV0gPSBhcmNnaXNMT0QubGV2ZWw7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5maXJlKCdsb2RtYXAnKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgd2FybignTC5lc3JpLlRpbGVkTWFwTGF5ZXIgaXMgdXNpbmcgYSBub24tbW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1RvQmFjaygpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5fbWFwICYmIHRoaXMuX2N1cnJlbnRJbWFnZS5fbWFwKSB7XG4gICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbWFnZS5zZXRPcGFjaXR5KHRoaXMub3B0aW9ucy5vcGFjaXR5KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbWFnZS5fbWFwLnJlbW92ZUxheWVyKHRoaXMuX2N1cnJlbnRJbWFnZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChvbGRJbWFnZSAmJiB0aGlzLl9tYXApIHtcbiAgICAgICAgICAgICAgdGhpcy5fbWFwLnJlbW92ZUxheWVyKG9sZEltYWdlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKG9sZEltYWdlICYmIG9sZEltYWdlLl9tYXApIHtcbiAgICAgICAgICAgICAgb2xkSW1hZ2UuX21hcC5yZW1vdmVMYXllcihvbGRJbWFnZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuX21hcC5yZW1vdmVMYXllcihuZXdJbWFnZSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5maXJlKCdsb2FkJywge1xuICAgICAgICAgIGJvdW5kczogYm91bmRzXG4gICAgICAgIH0pO1xuICAgICAgfSwgdGhpcyk7XG5cbiAgICAgIHRoaXMuZmlyZSgnbG9hZGluZycsIHtcbiAgICAgICAgYm91bmRzOiBib3VuZHNcbiAgICAgIH0pO1xuICAgIH1cbiAgfSxcblxuICBfdXBkYXRlOiBmdW5jdGlvbiAoKSB7XG4gICAgaWYgKCF0aGlzLl9tYXApIHtcbiAgICAgIHJldHVybjtcbiAgICB9XG5cbiAgICB2YXIgem9vbSA9IHRoaXMuX21hcC5nZXRab29tKCk7X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cbiAgICB2YXIgdG9wID0gdGhpcy5fbWFwLmxhdExuZ1RvTGF5ZXJQb2ludChib3VuZHMuX25vcnRoRWFzdCk7XG4gICAgdmFyIGJvdHRvbSA9IHRoaXMuX21hcC5sYXRMbmdUb0xheWVyUG9pbnQoYm91bmRzLl9zb3V0aFdlc3QpO1xuXG4gICAgaWYgKHRvcC55ID4gMCB8fCBib3R0b20ueSA8IHNpemUueSkge1xuICAgICAgc2l6ZS55ID0gYm90dG9tLnkgLSB0b3AueTtcbiAgICB9XG5cbiAgICB2YXIgcGFyYW1zID0ge1xuICAgICAgYmJveDogW3N3LngsIHN3LnksIG5lLngsIG5lLnldLmpvaW4oJywnKSxcbiAgICAgIHNpemU6IHNpemUueCArICcsJyArIHNpemUueSxcbiAgICAgIGRwaTogOTYsXG4gICAgICBmb3JtYXQ6IHRoaXMub3B0aW9ucy5mb3JtYXQsXG4gICAgICB0cmFuc3BhcmVudDogdGhpcy5vcHRpb25zLnRyYW5zcGFyZW50LFxuICAgICAgYmJveFNSOiBzcixcbiAgICAgIGltYWdlU1I6IHNyXG4gICAgfTtcblxuICAgIGlmICh0aGlzLm9wdGlvbnMuZHluYW1pY0xheWVycykge1xuICAgICAgcGFyYW1zLmR5bmFtaWNMYXllcnMgPSB0aGlzLm9wdGlvbnMuZHluYW1pY0xheWVycztcbiAgICB9XG5cbiAgICBpZiAodGhpcy5vcHRpb25zLmxheWVycykge1xuICAgICAgcGFyYW1zLmxheWVycyA9ICdzaG93OicgKyB0aGlzLm9wdGlvbnMubGF5ZXJzLmpvaW4oJywnKTtcbiAgICB9XG5cbiAgICBpZiAodGhpcy5vcHRpb25zLmxheWVyRGVmcykge1xuICAgICAgcGFyYW1zLmxheWVyRGVmcyA9IEpTT04uc3RyaW5naWZ5KHRoaXMub3B0aW9ucy5sYXllckRlZnMpO1xuICAgIH1cblxuICAgIGlmICh0aGlzLm9wdGlvbnMudGltZU9wdGlvbnMpIHtcbiAgICAgIHBhcmFtcy50aW1lT3B0a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FBRyxRQUFRLENBQUMsT0FBTyxDQUFDO0FBQzFDLENBQUEsTUFBTSxJQUFJLENBQUMsZUFBZSxDQUFDLE9BQU8sQ0FBQyxFQUFFLEVBQUUsWUFBWSxDQUFDLENBQUM7QUFDckQsQ0FBQSxLQUFLOztBQUVMLENBQUE7QUFDQSxDQUFBLElBQUksSUFBSSxLQUFLLElBQUksS0FBSyxDQUFDLFFBQVEsSUFBSSxJQUFJLENBQUMsT0FBTyxDQUFDLEtBQUssRUFBRTtBQUN2RCxDQUFBLE1BQU0sSUFBSSxDQUFDLFVBQVUsQ0FBQyxPQUFPLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDbEMsQ0FBQSxLQUFLO0FBQ0wsQ0FBQSxHQUFHO0FBQ0gsQ0FBQSxDQUFDLENBQUMsQ0FBQzs7QUFFSCxDQUFPLFNBQVMsWUFBWSxFQUFFLE9BQU8sRUFBRTtBQUN2QyxDQUFBLEVBQUUsT0FBTyxJQUFJLFlBQVksQ0FBQyxPQUFPLENBQUMsQ0FBQztBQUNuQyxDQUFBLENBQUM7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ== \ No newline at end of file diff --git a/dist/esri-leaflet.js b/dist/esri-leaflet.js new file mode 100644 index 000000000..137b6d0d0 --- /dev/null +++ b/dist/esri-leaflet.js @@ -0,0 +1,6 @@ +/* esri-leaflet - v2.0.4 - Tue Oct 18 2016 16:30:39 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&&tt.cors?u.open("GET",t+"?"+o):l>2e3&&tt.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&&tt.cors)u.send(null);else{if(!(l>2e3&&tt.cors))return l<=2e3&&!tt.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"+it;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,it++,{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;u--){var l=x(s[u],i);a.features.push(l)}return a}function C(t){return t=e.Util.trim(t),"/"!==t[t.length-1]&&(t+="/"),t}function O(t){return/\.arcgis\.com.*?FeatureServer/g.test(t)}function R(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){return t.getSize().x-et.attributionWidthOffset+"px"}function k(t){if(t.attributionControl&&!t.attributionControl._esriAttributionAdded){t.attributionControl.setPrefix('Leaflet | Powered by Esri');var i=document.createElement("style");i.type="text/css",i.innerHTML=".esri-truncated-attribution:hover {white-space: normal;}",document.getElementsByTagName("head")[0].appendChild(i),e.DomUtil.addClass(t.attributionControl._container,"esri-truncated-attribution:hover");var s=document.createElement("style");s.type="text/css",s.innerHTML=".esri-truncated-attribution {vertical-align: -3px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: inline-block;transition: 0s white-space;transition-delay: 1s;max-width: "+P(t)+";}",document.getElementsByTagName("head")[0].appendChild(s),e.DomUtil.addClass(t.attributionControl._container,"esri-truncated-attribution"),t.on("resize",function(e){t.attributionControl._container.style.maxWidth=P(e.target)}),t.attributionControl._esriAttributionAdded=!0}}function A(t,i){a(t,{},e.Util.bind(function(t,s){if(!t){i._esriAttributions=[];for(var r=0;r=l.minZoom&&a<=l.maxZoom&&(r+=", "+h)}r=r.substr(2);var c=i.attributionControl._container.querySelector(".esri-dynamic-attribution");c.innerHTML=r,c.style.maxWidth=P(i),i.fire("attributionupdated",{attribution:r})}}function M(t){return new ot(t)}function q(t){return new at(t)}function E(t){return new ut(t)}function U(t){return new lt(t)}function D(t){return new ht(t)}function z(t){return new ct(t)}function B(t){return new pt(t)}function j(t){return new dt(t)}function N(t){return new mt(t)}function Z(t){return new ft(t)}function W(t,e){return new gt(t,e)}function J(t,e){return new vt(t,e)}function Q(t,e){return new Lt(t,e)}function H(t,e){return new xt(t,e)}function K(t){this.values=[].concat(t||[])}function V(t){return new It(t)}e="default"in e?e.default:e;var X="2.0.4",$=window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest,Y=""===document.documentElement.style.pointerEvents,tt={cors:$,pointerEvents:Y},et={attributionWidthOffset:55},it=0,st=tt.cors?n:a;st.CORS=n,st.JSONP=a;var rt={request:o,get:st,post:r},nt={shallowClone:S,warn:F,cleanUrl:C,isArcgisOnline:O,geojsonTypeToArcGIS:R,responseToFeatureCollection:w,geojsonToArcGIS:L,arcgisToGeoJSON:x,boundsToExtent:I,extentToBounds:T,calcAttributionWidth:P,setEsriAttribution:k,_getAttributionData:A,_updateMapAttribution:G},ot=e.Class.extend({options:{proxy:!1,useCors:$},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=C(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?rt[t](n,i,s,r):rt.get.JSONP(n,i,s,r)}}),at=ot.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||nt.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&&nt.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&&nt.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&&nt.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=nt.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=nt.geojsonToArcGIS(t),this.params.geometryType=nt.geojsonTypeToArcGIS(t.type)),t.toGeoJSON&&(t=t.toGeoJSON()),"Feature"===t.type&&(t=t.geometry),"Point"===t.type||"LineString"===t.type||"Polygon"===t.type||"MultiPolygon"===t.type?(this.params.geometry=nt.geojsonToArcGIS(t),void(this.params.geometryType=nt.geojsonTypeToArcGIS(t.type))):void nt.warn("invalid geometry passed to spatial query. Should be L.LatLng, L.LatLngBounds, L.Marker or a GeoJSON Point, Line, Polygon or MultiPolygon object"))}}),ut=ot.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&&nt.responseToFeatureCollection(s),s)},e)}}),lt=ot.extend({path:"identify",between:function(t,e){return this.params.time=[t.valueOf(),e.valueOf()],this}}),ht=lt.extend({setters:{layers:"layers",precision:"geometryPrecision",tolerance:"tolerance",returnGeometry:"returnGeometry"},params:{sr:4326,layers:"all",tolerance:3,returnGeometry:!0},on:function(t){var e=nt.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=nt.responseToFeatureCollection(s);s.results=s.results.reverse();for(var n=0;n=0;n--)r.catalogItems.features[n].properties.catalogItemVisibility=s[n];return r}}),pt=e.Evented.extend({options:{proxy:!1,useCors:$,timeout:0},initialize:function(t){t=t||{},this._requestQueue=[],this._authenticating=!1,e.Util.setOptions(this,t),this.options.url=C(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?rt[t](o,i,n,r):rt.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=[]}}),dt=pt.extend({identify:function(){return D(this)},find:function(){return E(this)},query:function(){return q(this)}}),mt=pt.extend({query:function(){return q(this)},identify:function(){return z(this)}}),ft=pt.extend({options:{idAttribute:"OBJECTID"},query:function(){return q(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)}}),yt="https:"!==window.location.protocol?"http:":"https:",gt=e.TileLayer.extend({statics:{TILES:{Streets:{urlTemplate:yt+"//{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:yt+"//{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:yt+"//{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:yt+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:Y?"esri-labels":"tilePane"}},NationalGeographic:{urlTemplate:yt+"//{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:yt+"//{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:yt+"//{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:Y?"esri-labels":"tilePane",attribution:""}},Gray:{urlTemplate:yt+"//{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:yt+"//{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:Y?"esri-labels":"tilePane",attribution:""}},Imagery:{urlTemplate:yt+"//{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:yt+"//{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:Y?"esri-labels":"tilePane",attribution:""}},ImageryTransportation:{urlTemplate:yt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:Y?"esri-labels":"tilePane"}},ShadedRelief:{urlTemplate:yt+"//{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:yt+"//{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:Y?"esri-labels":"tilePane",attribution:""}},Terrain:{urlTemplate:yt+"//{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:yt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],pane:Y?"esri-labels":"tilePane",attribution:""}},USATopo:{urlTemplate:yt+"//{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||!gt.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", "TerrainLabels" or "USATopo"');s=gt.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){k(t),"esri-labels"===this.options.pane&&this._initPane(),this.options.attributionUrl&&A(this.options.attributionUrl,t),t.on("moveend",G),e.TileLayer.prototype.onAdd.call(this,t)},onRemove:function(t){t.off("moveend",G),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.options.attribution+"";return t}}),vt=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=C(t.url),t=e.Util.setOptions(this,t),this.tileUrl=t.url+"tile/{z}/{y}/{x}",this.service=j(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){k(t),t.options.crs!==e.CRS.EPSG3857||this._lodMap||(this._lodMap={},this.metadata(function(e,i){if(!e&&i.spatialReference){var s=i.spatialReference.latestWkid||i.spatialReference.wkid;if(!this.options.attribution&&t.attributionControl&&i.copyrightText&&(this.options.attribution=i.copyrightText,t.attributionControl.addAttribution(this.getAttribution())),102100===s||3857===s){for(var r=i.tileInfo.lods,n=vt.MercatorZoomLevels,o=0;othis.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}});K.prototype.query=function(t){var e=this.getIndex(t);return this.values[e]},K.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)},K.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)},K.prototype.insert=function(t){return this.values.splice(this.getIndex(t.value),0,t),this},K.prototype.bulkAdd=function(t,e){return this.values=this.values.concat([].concat(t||[])),e?this.sort():this.dirty=!0,this},K.prototype.sort=function(){return this.values.sort(function(t,e){return+e.value-+t.value}).reverse(),this.dirty=!1,this};var Tt=St.extend({options:{attribution:null,where:"1=1",fields:["*"],from:!1,to:!1,timeField:!1,timeFilterMode:"server",simplifyFactor:0,precision:6},initialize:function(t){if(St.prototype.initialize.call(this,t),t.url=C(t.url),t=e.setOptions(this,t),this.service=Z(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\",\n \"leaflet-virtual-grid\": \"^1.0.3\",\n \"tiny-binary-search\": \"^1.0.2\"\n },\n \"devDependencies\": {\n \"chai\": \"2.3.0\",\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\": \"^8.0.0\",\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 | 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 \"semistandard\": {\n \"globals\": [ \"expect\", \"L\", \"XMLHttpRequest\", \"sinon\", \"xhr\" ]\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","export var options = {\n attributionWidthOffset: 55\n};\n\nexport default options;\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 } 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 { options } from './Options';\n\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 var features = response.features || response.results;\n var count = features.length;\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 if (count) {\n /* as a last resort, check for common ID fieldnames in the first feature returned\n not foolproof. identifyFeatures can returned a mixed array of features. */\n for (var key in features[0].attributes) {\n if (key.match(/^(OBJECTID|FID|OID|ID)$/i)) {\n objectIdField = key;\n break;\n }\n }\n }\n\n var featureCollection = {\n type: 'FeatureCollection',\n features: []\n };\n\n if (count) {\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 calcAttributionWidth (map) {\n // either crop at 55px or user defined buffer\n return (map.getSize().x - options.attributionWidthOffset) + 'px';\n}\n\nexport function setEsriAttribution (map) {\n if (map.attributionControl && !map.attributionControl._esriAttributionAdded) {\n map.attributionControl.setPrefix('Leaflet | Powered by Esri');\n\n var hoverAttributionStyle = document.createElement('style');\n hoverAttributionStyle.type = 'text/css';\n hoverAttributionStyle.innerHTML = '.esri-truncated-attribution:hover {' +\n 'white-space: normal;' +\n '}';\n\n document.getElementsByTagName('head')[0].appendChild(hoverAttributionStyle);\n L.DomUtil.addClass(map.attributionControl._container, 'esri-truncated-attribution:hover');\n\n // define a new css class in JS to trim attribution into a single line\n var attributionStyle = document.createElement('style');\n attributionStyle.type = 'text/css';\n attributionStyle.innerHTML = '.esri-truncated-attribution {' +\n 'vertical-align: -3px;' +\n 'white-space: nowrap;' +\n 'overflow: hidden;' +\n 'text-overflow: ellipsis;' +\n 'display: inline-block;' +\n 'transition: 0s white-space;' +\n 'transition-delay: 1s;' +\n 'max-width: ' + calcAttributionWidth(map) + ';' +\n '}';\n\n document.getElementsByTagName('head')[0].appendChild(attributionStyle);\n L.DomUtil.addClass(map.attributionControl._container, 'esri-truncated-attribution');\n\n // update the width used to truncate when the map itself is resized\n map.on('resize', function (e) {\n map.attributionControl._container.style.maxWidth = calcAttributionWidth(e.target);\n });\n\n map.attributionControl._esriAttributionAdded = true;\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 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 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 _updateMapAttribution(obj);\n }, this));\n}\n\nexport function _updateMapAttribution (evt) {\n var 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\n newAttributions = newAttributions.substr(2);\n var attributionElement = map.attributionControl._container.querySelector('.esri-dynamic-attribution');\n\n attributionElement.innerHTML = newAttributions;\n attributionElement.style.maxWidth = calcAttributionWidth(map);\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 calcAttributionWidth: calcAttributionWidth,\n setEsriAttribution: setEsriAttribution,\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' || geometry.type === 'MultiPolygon') {\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 L.LatLng, L.LatLngBounds, L.Marker or a GeoJSON Point, Line, Polygon or MultiPolygon 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 {\n setEsriAttribution,\n _getAttributionData,\n _updateMapAttribution\n} 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 attribution: ''\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 attribution: ''\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 attribution: ''\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 attribution: ''\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 attribution: ''\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\", \"TerrainLabels\" or \"USATopo\"');\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 // include 'Powered by Esri' in map attribution\n setEsriAttribution(map);\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 _getAttributionData(this.options.attributionUrl, map);\n }\n\n map.on('moveend', _updateMapAttribution);\n\n L.TileLayer.prototype.onAdd.call(this, map);\n },\n\n onRemove: function (map) {\n map.off('moveend', _updateMapAttribution);\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 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, setEsriAttribution } 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 // include 'Powered by Esri' in map attribution\n setEsriAttribution(map);\n\n if (map.options.crs === L.CRS.EPSG3857 && !this._lodMap) {\n this._lodMap = {};\n this.metadata(function (error, metadata) {\n if (!error && metadata.spatialReference) {\n var sr = metadata.spatialReference.latestWkid || metadata.spatialReference.wkid;\n if (!this.options.attribution && map.attributionControl && metadata.copyrightText) {\n this.options.attribution = metadata.copyrightText;\n map.attributionControl.addAttribution(this.getAttribution());\n }\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';\nimport { setEsriAttribution } from '../Util';\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 // include 'Powered by Esri' in map attribution\n setEsriAttribution(map);\n\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 // add copyright text listed in service metadata\n this.metadata(function (err, metadata) {\n if (!err && !this.options.attribution && map.attributionControl && metadata.copyrightText) {\n this.options.attribution = metadata.copyrightText;\n map.attributionControl.addAttribution(this.getAttribution());\n }\n }, this);\n },\n\n onRemove: function (map) {\n if (this._currentImage) {\n this._map.removeLayer(this._currentImage);\n }\n\n if (this._popup) {\n this._map.off('click', this._getPopupData, this);\n this._map.off('dblclick', this._resetPopupState, this);\n }\n\n this._map.off('moveend', this._update, this);\n },\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 if (this.options.token) {\n response.href += ('?token=' + this.options.token);\n }\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 (this.options.token) {\n response.href += ('?token=' + this.options.token);\n }\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, setEsriAttribution } 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 // include 'Powered by Esri' in map attribution\n setEsriAttribution(map);\n\n this.service.metadata(function (err, metadata) {\n if (!err) {\n var supportedFormats = metadata.supportedQueryFormats;\n // check to see whether service can emit GeoJSON natively\n if (supportedFormats && supportedFormats.indexOf('geoJSON') !== -1) {\n this.service.options.isModern = true;\n }\n // add copyright text listed in service metadata\n if (!this.options.attribution && map.attributionControl && metadata.copyrightText) {\n this.options.attribution = metadata.copyrightText;\n map.attributionControl.addAttribution(this.getAttribution());\n }\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","results","count","objectIdFieldName","fields","name","match","featureCollection","feature","cleanUrl","trim","isArcgisOnline","test","geojsonTypeToArcGIS","geoJsonType","arcgisGeometryType","console","apply","arguments","calcAttributionWidth","map","getSize","attributionWidthOffset","setEsriAttribution","attributionControl","_esriAttributionAdded","setPrefix","hoverAttributionStyle","createElement","innerHTML","getElementsByTagName","appendChild","addClass","_container","attributionStyle","on","style","maxWidth","_getAttributionData","bind","attributions","_esriAttributions","c","contributors","contributor","coverageAreas","coverageArea","southWest","bbox","northEast","attribution","score","minZoom","zoomMin","maxZoom","zoomMax","sort","_updateMapAttribution","evt","oldAttributions","newAttributions","getBounds","wrappedBounds","wrap","zoom","getZoom","text","substr","attributionElement","querySelector","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","returnCountOnly","ids","returnIdsOnly","objectIds","returnExtentOnly","pixelSize","layer","LatLngBounds","getLatLng","LatLng","GeoJSON","getLayers","toGeoJSON","sr","layers","dynamicLayers","returnZ","returnM","gdbVersion","layerDefs","tolerance","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","_initPane","onRemove","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","DomEvent","_tileOnLoad","_tileOnError","crossOrigin","alt","once","CRS","EPSG3857","latestWkid","copyrightText","addAttribution","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","err","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":";;;mPGMA,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,EAAYa,WAAkB,CAChC,IACED,EAAWpB,KAAKsB,MAAMd,EAAYe,cAClC,MAAOX,GACPQ,EAAW,KACXH,GACEC,KAAM,IACNC,QAAS,mGAIRF,GAASG,EAASH,QACrBA,EAAQG,EAASH,MACjBG,EAAW,MAGbZ,EAAYG,QAAUG,EAAEC,KAAKC,QAE7BV,EAASR,KAAKS,EAASU,EAAOG,KAIlCZ,EAAYgB,UAAY,WACtBC,KAAKd,WAGAH,EAGT,QA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