From 0d15cefe07846af6d74b3b42f1addacc3ac2696c Mon Sep 17 00:00:00 2001 From: john gravois Date: Wed, 16 Nov 2016 12:09:44 -0800 Subject: [PATCH] build 2.0.5 --- dist/esri-leaflet-debug.js | 3914 ++++++++++++++++++++++++++++++++++++ dist/esri-leaflet.js | 6 + dist/esri-leaflet.js.map | 1 + 3 files changed, 3921 insertions(+) create mode 100644 dist/esri-leaflet-debug.js create mode 100644 dist/esri-leaflet.js create mode 100644 dist/esri-leaflet.js.map diff --git a/dist/esri-leaflet-debug.js b/dist/esri-leaflet-debug.js new file mode 100644 index 000000000..c9ec17908 --- /dev/null +++ b/dist/esri-leaflet-debug.js @@ -0,0 +1,3914 @@ +/* esri-leaflet - v2.0.5 - Wed Nov 16 2016 12:09:44 GMT-0800 (PST) + * 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.5"; + + 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) { + // ensure cookies are passed through in cross-site Access-Control requests + httpRequest.withCredentials = true; + 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.withCredentials = true; + 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) { + // "NaN" coordinates from ArcGIS Server indicate a null geometry + if (extent.xmin !== 'NaN' && extent.ymin !== 'NaN' && extent.xmax !== 'NaN' && extent.ymax !== 'NaN') { + var sw = L.latLng(extent.ymin, extent.xmin); + var ne = L.latLng(extent.ymax, extent.xmax); + return L.latLngBounds(sw, ne); + } else { + return null; + } + } + + // 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 support geojson as an output format + utility.arcgis.com services are proxied from a variety of ArcGIS Server vintages, and may not */ + return (/^(?!.*utility\.arcgis\.com).*\.arcgis\.com.*FeatureServer/i).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) { + if (response && response.extent && Util.extentToBounds(response.extent)) { + callback.call(context, error, Util.extentToBounds(response.extent), response); + } else { + error = { + message: 'Invalid Bounds' + }; + callback.call(context, error, null, 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 (!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 (map.options.crs === L.CRS.EPSG3857 && sr === 102100 || sr === 3857) { + this._lodMap = {}; + // 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 { + if (!proj4) { + 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 = typeof this.options.layerDefs === 'string' ? this.options.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; + } + + if (this.options.proxy) { + params.proxy = this.options.proxy; + } + + 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 (this.options.proxy) { + response.href = this.options.proxy + '?' + response.href; + } + 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXNyaS1sZWFmbGV0LWRlYnVnLmpzIiwic291cmNlcyI6WyIuLi9wYWNrYWdlLmpzb24iLCIuLi9zcmMvU3VwcG9ydC5qcyIsIi4uL3NyYy9PcHRpb25zLmpzIiwiLi4vc3JjL1JlcXVlc3QuanMiLCIuLi9ub2RlX21vZHVsZXMvYXJjZ2lzLXRvLWdlb2pzb24tdXRpbHMvaW5kZXguanMiLCIuLi9zcmMvVXRpbC5qcyIsIi4uL3NyYy9UYXNrcy9UYXNrLmpzIiwiLi4vc3JjL1Rhc2tzL1F1ZXJ5LmpzIiwiLi4vc3JjL1Rhc2tzL0ZpbmQuanMiLCIuLi9zcmMvVGFza3MvSWRlbnRpZnkuanMiLCIuLi9zcmMvVGFza3MvSWRlbnRpZnlGZWF0dXJlcy5qcyIsIi4uL3NyYy9UYXNrcy9JZGVudGl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G4gICAgICAgICAgbWluWm9vbTogMSxcbiAgICAgICAgICBtYXhab29tOiAxOSxcbiAgICAgICAgICBzdWJkb21haW5zOiBbJ3NlcnZlcicsICdzZXJ2aWNlcyddLFxuICAgICAgICAgIHBhbmU6IChwb2ludGVyRXZlbnRzKSA/ICdlc3JpLWxhYmVscycgOiAndGlsZVBhbmUnXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBTaGFkZWRSZWxpZWY6IHtcbiAgICAgICAgdXJsVGVtcGxhdGU6IHRpbGVQcm90b2NvbCArICcvL3tzfS5hcmNnaXNvbmxpbmUuY29tL0FyY0dJUy9yZXN0L3NlcnZpY2VzL1dvcmxkX1NoYWRlZF9SZWxpZWYvTWFwU2VydmVyL3RpbGUve3p9L3t5fS97eH0nLFxuICAgICAgICBvcHRpb25zOiB7XG4gICAgICAgICAgbWluWm9vbTogMSxcbiAgICAgICAgICBtYXhab29tOiAxMyxcbiAgICAgICAgICBzdWJkb21haW5zOiBbJ3NlcnZlcicsICdzZXJ2aWNlcyddLFxuICAgICAgICAgIGF0dHJpYnV0aW9uOiAnVVNHUydcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIFNoYWRlZFJlbGllZkxhYmVsczoge1xuICAgICAgICB1cmxUZW1wbGF0ZTogdGlsZVByb3RvY29sICsgJy8ve3N9LmFyY2dpc29ubGluZS5jb20vQXJjR0lTL3Jlc3Qvc2VydmljZXMvUmVmZXJlbmNlL1dvcmxkX0JvdW5kYXJpZXNfYW5kX1BsYWNlc19BbHRlcm5hdGUvTWFwU2VydmVyL3RpbGUve3p9L3t5fS97eH0nLFxuICAgICAgICBvcHRpb25zOiB7XG4gICAgICAgICAgbWluWm9vbTogMSxcbiAgICAgICAgICBtYXhab29tOiAxMixcbiAgICAgICAgICBzdWJkb21haW5zOiBbJ3NlcnZlcicsICdzZXJ2aWNlcyddLFxuICAgICAgICAgIHBhbmU6IChwb2ludGVyRXZlbnRzKSA/ICdlc3JpLWxhYmVscycgOiAndGlsZVBhbmUnLFxuICAgICAgICAgIGF0dHJpYnV0aW9uOiAnJ1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgVGVycmFpbjoge1xuICAgICAgICB1cmxUZW1wbGF0ZTogdGlsZVByb3RvY29sICsgJy8ve3N9LmFyY2dpc29ubGluZS5jb20vQXJjR0lTL3Jlc3Qvc2VydmljZXMvV29ybGRfVGVycmFpbl9CYXNlL01hcFNlcnZlci90aWxlL3t6fS97eX0ve3h9JyxcbiAgICAgICAgb3B0aW9uczoge1xuICAgICAgICAgIG1pblpvb206IDEsXG4gICAgICAgICAgbWF4Wm9vbTogMTMsXG4gICAgICAgICAgc3ViZG9tYWluczogWydzZXJ2ZXInLCAnc2VydmljZXMnXSxcbiAgICAgICAgICBhdHRyaWJ1dGlvbjogJ1VTR1MsIE5PQUEnXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBUZXJyYWluTGFiZWxzOiB7XG4gICAgICAgIHVybFRlbXBsYXRlOiB0aWxlUHJvdG9jb2wgKyAnLy97c30uYXJjZ2lzb25saW5lLmNvbS9BcmNHSVMvcmVzdC9zZXJ2aWNlcy9SZWZlcmVuY2UvV29ybGRfUmVmZXJlbmNlX092ZXJsYXkvTWFwU2VydmVyL3RpbGUve3p9L3t5fS97eH0nLFxuICAgICAgICBvcHRpb25zOiB7XG4gICAgICAgICAgbWluWm9vbTogMSxcbiAgICAgICAgICBtYXhab29tOiAxMyxcbiAgICAgICAgICBzdWJkb21haW5zOiBbJ3NlcnZlcicsICdzZXJ2aWNlcyddLFxuICAgICAgICAgIHBhbmU6IChwb2ludGVyRXZlbnRzKSA/ICdlc3JpLWxhYmVscycgOiAndGlsZVBhbmUnLFxuICAgICAgICAgIGF0dHJpYnV0aW9uOiAnJ1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgVVNBVG9wbzoge1xuICAgICAgICB1cmxUZW1wbGF0ZTogdGlsZVByb3RvY29sICsgJy8ve3N9LmFyY2dpc29ubGluZS5jb20vQ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ludChib3VuZHMuX25vcnRoRWFzdCk7XG4gICAgdmFyIGJvdHRvbSA9IHRoaXMuX21hcC5sYXRMbmdUb0xheWVyUG9pbnQoYm91bmRzLl9zb3V0aFdlc3QpO1xuXG4gICAgaWYgKHRvcC55ID4gMCB8fCBib3R0b20ueSA8IHNpemUueSkge1xuICAgICAgc2l6ZS55ID0gYm90dG9tLnkgLSB0b3AueTtcbiAgICB9XG5cbiAgICB2YXIgcGFyYW1zID0ge1xuICAgICAgYmJveDogW3N3LngsIHN3LnksIG5lLngsIG5lLnldLmpvaW4oJywnKSxcbiAgICAgIHNpemU6IHNpemUueCArICcsJyArIHNpemUueSxcbiAgICAgIGRwaTogOTYsXG4gICAgICBmb3JtYXQ6IHRoaXMub3B0aW9ucy5mb3JtYXQsXG4gICAgICB0cmFuc3BhcmVudDogdGhpcy5vcHRpb25zLnRyYW5zcGFyZW50LFxuICAgICAgYmJveFNSOiBzcixcbiAgICAgIGltYWdlU1I6IHNyXG4gICAgfTtcblxuICAgIGlmICh0aGlzLm9wdGlvbnMuZHluYW1pY0xheWVycykge1xuICAgICAgcGFyYW1zLmR5bmFtaWNMYXllcnMgPSB0aGlzLm9wdGlvbnMuZHluYW1pY0xheWVycztcbiAgICB9XG5cbiAgICBpZiAodGhpcy5vcHRpb25zLmxheWVycykge1xuICAgICAgcGFyYW1zLmxheWVycyA9ICdzaG93OicgKyB0aGlzLm9wdGlvbnMubGF5ZXJzLmpvaW4oJywnKTtcbiAgICB9XG5cbiAgICBpZiAodGhpcy5vcHRpb25zLmxheWVyRGVmcykge1xuICAgICAgcGFyYW1zLmxheWVyRGVmcyA9IHR5cGVvZiB0aGlzLm9wdGlvbnMubGF5ZXJEZWZzID09PSAnc3RyaW5nJyA/IHRoaXMub3B0aW9ucy5sYXllckRlZnMgOiBKU09OLnN0cmluZ2lmeSh0aGlzLm9wdGlvbnMubGF5ZXJEZWZzKTtcbiAgICB9XG5cbiAgICBpZiAodGhpcy5vcHRpb25zLnRpbWVPc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FHO0FBQ0gsQ0FBQSxDQUFDLENBQUMsQ0FBQzs7QUFFSCxDQUFPLFNBQVMsWUFBWSxFQUFFLE9BQU8sRUFBRTtBQUN2QyxDQUFBLEVBQUUsT0FBTyxJQUFJLFlBQVksQ0FBQyxPQUFPLENBQUMsQ0FBQztBQUNuQyxDQUFBLENBQUM7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ== \ No newline at end of file diff --git a/dist/esri-leaflet.js b/dist/esri-leaflet.js new file mode 100644 index 000000000..9dc78f516 --- /dev/null +++ b/dist/esri-leaflet.js @@ -0,0 +1,6 @@ +/* esri-leaflet - v2.0.5 - Wed Nov 16 2016 12:09:44 GMT-0800 (PST) + * 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.withCredentials=!0,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.withCredentials=!0,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/^(?!.*utility\.arcgis\.com).*\.arcgis\.com.*FeatureServer/i.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 N(t){return new dt(t)}function j(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.5",$=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){s&&s.extent&&nt.extentToBounds(s.extent)?t.call(e,i,nt.extentToBounds(s.extent),s):(i={message:"Invalid Bounds"},t.call(e,i,null,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=N(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),this._lodMap||this.metadata(function(i,s){if(!i&&s.spatialReference){var r=s.spatialReference.latestWkid||s.spatialReference.wkid;if(!this.options.attribution&&t.attributionControl&&s.copyrightText&&(this.options.attribution=s.copyrightText,t.attributionControl.addAttribution(this.getAttribution())),t.options.crs===e.CRS.EPSG3857&&102100===r||3857===r){this._lodMap={};for(var n=s.tileInfo.lods,o=vt.MercatorZoomLevels,a=0;athis.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 \"parallelshell\": \"^2.0.0\",\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\": \"watch \\\"npm run build\\\" src\",\n \"start\": \"parallelshell \\\"npm run start-watch\\\" \\\"http-server -p 5000 -c-1 -o\\\"\",\n \"test\": \"npm run lint && karma start\"\n },\n \"semistandard\": {\n \"globals\": [ \"expect\", \"L\", \"XMLHttpRequest\", \"sinon\", \"xhr\", \"proj4\" ]\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 // ensure cookies are passed through in cross-site Access-Control requests\n httpRequest.withCredentials = true;\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.withCredentials = true;\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 // \"NaN\" coordinates from ArcGIS Server indicate a null geometry\n if (extent.xmin !== 'NaN' && extent.ymin !== 'NaN' && extent.xmax !== 'NaN' && extent.ymax !== 'NaN') {\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 } else {\n return null;\n }\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 support geojson as an output format\n utility.arcgis.com services are proxied from a variety of ArcGIS Server vintages, and may not */\n return (/^(?!.*utility\\.arcgis\\.com).*\\.arcgis\\.com.*FeatureServer/i).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 if (response && response.extent && Util.extentToBounds(response.extent)) {\n callback.call(context, error, Util.extentToBounds(response.extent), response);\n } else {\n error = {\n message: 'Invalid Bounds'\n };\n callback.call(context, error, null, response);\n }\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 (!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 (map.options.crs === L.CRS.EPSG3857 && sr === 102100 || sr === 3857) {\n this._lodMap = {};\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 if (!proj4) {\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 }\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\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 = typeof this.options.layerDefs === 'string' ? this.options.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 if (this.options.proxy) {\n params.proxy = this.options.proxy;\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 (this.options.proxy) {\n response.href = this.options.proxy + '?' + response.href;\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","withCredentials","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","xmin","ymin","xmax","ymax","sw","latLng","ne","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","latestWkid","copyrightText","addAttribution","CRS","EPSG3857","arcgisLODs","tileInfo","lods","correctResolutions","arcgisLOD","ci","correctRes","_withinPercentage","resolution","level","proj4","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,MAAO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