diff --git a/Gruntfile.js b/Gruntfile.js
index 5f88035..3565878 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -157,7 +157,7 @@ module.exports = function(grunt) {
// Require all grunt modules
require('load-grunt-tasks')(grunt, {
- pattern: ['grunt-*', 'assemble']
+ pattern: ['grunt-*', 'grunt-assemble']
});
};
diff --git a/dist/esri-leaflet-legend-compat-src.js b/dist/esri-leaflet-legend-compat-src.js
index 9140e40..2c9d756 100644
--- a/dist/esri-leaflet-legend-compat-src.js
+++ b/dist/esri-leaflet-legend-compat-src.js
@@ -61,25 +61,25 @@ EsriLeaflet.Util.reduce = function(values, initial, fn, cb, context) {
};
-EsriLeaflet.Services.MapService.include({
+EsriLeaflet.MapService.include({
legend: function(callback, context) {
- return new EsriLeaflet.Tasks.Legend(this).run(callback, context);
+ return new EsriLeaflet.Legend(this).run(callback, context);
}
});
-EsriLeaflet.Services.FeatureLayerService.include({
+EsriLeaflet.FeatureLayerService.include({
legend: function(callback, context) {
- return new EsriLeaflet.Tasks.Legend(this).run(callback, context);
+ return new L.esri.Legend(this).run(callback, context);
}
});
-EsriLeaflet.Tasks.Legend = EsriLeaflet.Tasks.Task.extend({
+EsriLeaflet.Legend = EsriLeaflet.Task.extend({
path: 'legend',
params: {
@@ -96,23 +96,23 @@ EsriLeaflet.Tasks.Legend = EsriLeaflet.Tasks.Task.extend({
});
-EsriLeaflet.Tasks.legend = function(params) {
- return new EsriLeaflet.Tasks.Legend(params);
+EsriLeaflet.legend = function(params) {
+ return new EsriLeaflet.Legend(params);
};
-EsriLeaflet.Tasks.Legend.include({
+EsriLeaflet.Legend.include({
initialize: function(endpoint) {
- this._renderer = new EsriLeaflet.Tasks.Legend.SymbolRenderer();
- EsriLeaflet.Tasks.Task.prototype.initialize.call(this, endpoint);
+ this._renderer = new EsriLeaflet.Legend.SymbolRenderer();
+ EsriLeaflet.Task.prototype.initialize.call(this, endpoint);
},
run: function(callback, context) {
function cb(error, response) {
- if (error && error.error.code === 400) { // ArcGIS server >=10.0
+ if (error && error.code === 400) { // ArcGIS server >=10.0
this._collectLegendFromLayers(callback, context);
- } else if (response.drawingInfo) {
+ } else if (response && response.drawingInfo) {
this._symbolsToLegends([response], function(err, result) {
callback.call(context, err, {
layers: result
@@ -257,7 +257,7 @@ EsriLeaflet.Tasks.Legend.include({
});
-EsriLeaflet.Tasks.Legend.SymbolRenderer = L.Class.extend({
+EsriLeaflet.Legend.SymbolRenderer = L.Class.extend({
statics: {
SYMBOL_TYPES: {
@@ -387,7 +387,7 @@ EsriLeaflet.Tasks.Legend.SymbolRenderer = L.Class.extend({
},
_renderLine: function(ctx, symbol, callback) {
- var size = EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE;
+ var size = EsriLeaflet.Legend.SymbolRenderer.DEFAULT_SIZE;
ctx.beginPath();
ctx.lineWidth = symbol.width;
ctx.strokeStyle = this._formatColor(symbol.color);
@@ -510,7 +510,7 @@ EsriLeaflet.Tasks.Legend.SymbolRenderer = L.Class.extend({
ctx.width = ctx.height = symbol.size;
} else if (symbol.type === 'esriSLS' ||
symbol.type === 'esriSFS') {
- ctx.width = ctx.height = EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE;
+ ctx.width = ctx.height = EsriLeaflet.Legend.SymbolRenderer.DEFAULT_SIZE;
} else {
ctx.width = symbol.width;
ctx.height = symbol.height;
@@ -586,7 +586,7 @@ EsriLeaflet.Tasks.Legend.SymbolRenderer = L.Class.extend({
},
_fillImage: function(ctx, imageData, symbol, contentType, image) {
- var size = L.EsriLeaflet.Tasks.Legend.DEFAULT_SIZE;
+ var size = L.esri.Legend.DEFAULT_SIZE;
var w = symbol.width || size;
var h = symbol.height || size;
if (imageData) {
@@ -634,25 +634,25 @@ EsriLeaflet.Tasks.Legend.SymbolRenderer = L.Class.extend({
});
-EsriLeaflet.Layers.DynamicMapLayer.include({
+EsriLeaflet.DynamicMapLayer.include({
legend: function(callback, context) {
- return this._service.legend(callback, context);
+ return this.service.legend(callback, context);
}
});
-EsriLeaflet.Layers.FeatureLayer.include({
+EsriLeaflet.FeatureLayer.include({
legend: function(callback, context) {
- return this._service.legend(callback, context);
+ return this.service.legend(callback, context);
}
});
-EsriLeaflet.Controls.Legend = L.Control.extend({
+EsriLeaflet.LegendControl = L.Control.extend({
options: {
listTemplate: '
',
@@ -729,8 +729,8 @@ EsriLeaflet.Controls.Legend = L.Control.extend({
});
-EsriLeaflet.Controls.legend = function(layers, options) {
- return new L.esri.Controls.Legend(layers, options);
+EsriLeaflet.legendControl = function(layers, options) {
+ return new L.esri.LegendControl(layers, options);
};
diff --git a/dist/esri-leaflet-legend-compat-src.js.map b/dist/esri-leaflet-legend-compat-src.js.map
index 0291596..1a17fee 100644
--- a/dist/esri-leaflet-legend-compat-src.js.map
+++ b/dist/esri-leaflet-legend-compat-src.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../src/Util.js","../src/Services/MapService.js","../src/Services/FeatureLayer.js","../src/Tasks/Legend.js","../src/Tasks/Legend/SymbolLegend.js","../src/Tasks/Legend/SymbolRenderer.js","../src/Layers/DynamicMapLayer.js","../src/Layers/FeatureLayer/FeatureLayer.js","../src/Controls/Legend.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,GAAG;AACH,CAAC,CAAC,CAAC,CAAC,OAAO;AACX,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACT,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;AACrB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE;AAC7C,CAAC,CAAC,KAAK,UAAU,CAAC,QAAQ,GAAG;AAC7B,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,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O,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG;AAChE,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG;AAC9B,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG;AAC7B,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG;AAC5B,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI;AAC7B,EAAE,CAAC;AACH;AACA,GAAG;AACH;AACA,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACzD,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;AACrD,EAAE","file":"esri-leaflet-legend-compat-src.js","sourcesContent":["/**\n * @example\n * \n * L.esri.Util.queue(\n * [1, 2, 3], [], function(curr, item, cb){\n * setTimeout(function(){\n * cb(null, curr.concat([item + 10]));\n * }, 200);\n * }, function(err, result) {\n * console.log(result); // [11, 12, 13]\n * });\n *
\n * @param {Array.<*>} values\n * @param {*} initial\n * @param {Function} fn process item fn(memo, item, callback)\n * @param {Function} done queue complete\n * @param {*=} context\n */\nEsriLeaflet.Util.reduce = function(values, initial, fn, cb, context) {\n var curr = initial;\n\n function next(index) {\n var sync = true;\n for (var i = index; i < values.length; i++) {\n var done = false;\n fn(curr, values[i], function(err, val) {\n if (err) {\n return cb.call(context, err, curr);\n }\n done = true;\n curr = val;\n if (!sync) {\n next(i + 1);\n }\n });\n sync = done;\n if (!sync) {\n return;\n }\n }\n cb.call(context, null, curr);\n }\n\n next(0);\n};\n","EsriLeaflet.Services.MapService.include({\n\n legend: function(callback, context) {\n return new EsriLeaflet.Tasks.Legend(this).run(callback, context);\n }\n\n});\n","EsriLeaflet.Services.FeatureLayerService.include({\n\n legend: function(callback, context) {\n return new EsriLeaflet.Tasks.Legend(this).run(callback, context);\n }\n\n});\n","EsriLeaflet.Tasks.Legend = EsriLeaflet.Tasks.Task.extend({\n path: 'legend',\n\n params: {\n f: 'json'\n },\n\n run: function(callback, context) {\n if (this._service) {\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n }\n\n});\n\nEsriLeaflet.Tasks.legend = function(params) {\n return new EsriLeaflet.Tasks.Legend(params);\n};\n","EsriLeaflet.Tasks.Legend.include({\n\n initialize: function(endpoint) {\n this._renderer = new EsriLeaflet.Tasks.Legend.SymbolRenderer();\n EsriLeaflet.Tasks.Task.prototype.initialize.call(this, endpoint);\n },\n\n run: function(callback, context) {\n function cb(error, response) {\n if (error && error.error.code === 400) { // ArcGIS server >=10.0\n this._collectLegendFromLayers(callback, context);\n } else if (response.drawingInfo) {\n this._symbolsToLegends([response], function(err, result) {\n callback.call(context, err, {\n layers: result\n });\n });\n } else {\n callback.call(context, error, response);\n }\n }\n\n if (this._service) {\n return this._service.request(this.path, this.params, cb, this);\n } else {\n return this._request('request', this.path, this.params, cb, this);\n }\n },\n\n _collectLegendFromLayers: function(callback, context) {\n this._service.metadata(function(error, response) {\n if (error) {\n return callback.call(context, error);\n }\n\n var layers = [];\n for (var i = 0, len = response.layers.length; i < len; i++) {\n if (!response.layers[i].subLayerIds) {\n layers.push(response.layers[i]);\n }\n }\n\n this._getLayersLegends(layers, function(err, layerData) {\n if (err) {\n callback.call(context, err);\n } else {\n this._symbolsToLegends(layerData, function(err, result) {\n callback.call(context, err, {\n layers: result\n });\n });\n }\n }, this);\n }, this);\n },\n\n _getLayersLegends: function(layerDefs, callback, context) {\n var layerData = [];\n var self = this;\n\n EsriLeaflet.Util.reduce(layerDefs, [], function(curr, layer, cb) {\n self._getLayerLegend(layer, function(err, data) {\n if (err) {\n return cb(err, null);\n }\n cb(null, curr.concat(data));\n }, self);\n }, function(err, result) {\n callback.call(context, err, result);\n });\n },\n\n _getLayerLegend: function(layer, callback, context) {\n this._service.request(layer.id, {\n f: 'json'\n }, callback, context);\n },\n\n _symbolsToLegends: function(layerData, callback, context) {\n var self = this;\n EsriLeaflet.Util.reduce(layerData, [], function(curr, layer, cb) {\n self._drawingInfoToLegend(layer.drawingInfo, function(err, legend) {\n if (err) {\n return cb(err, null);\n }\n cb(null, curr.concat([{\n layerId: layer.id,\n layerType: layer.type,\n layerName: layer.name,\n maxScale: layer.maxScale,\n minScale: layer.minScale,\n legend: legend\n }]));\n }, self);\n }, function(err, result) {\n callback.call(context, err, result);\n });\n },\n\n _getRendererSymbols: function(renderer) {\n var symbols;\n if (renderer.type === 'uniqueValue') {\n symbols = renderer.uniqueValueInfos.slice();\n } else if (renderer.type === 'classBreaks') {\n symbols = renderer.classBreakInfos.slice();\n } else if (renderer.type === 'simple') {\n symbols = [{\n symbol: renderer.symbol,\n label: renderer.label,\n description: renderer.description,\n value: renderer.value\n }];\n }\n if (renderer.defaultSymbol) {\n symbols.push({\n symbol: renderer.defaultSymbol,\n label: renderer.defaultLabel,\n description: '',\n value: null\n });\n }\n return symbols;\n },\n\n _drawingInfoToLegend: function(drawingInfo, callback, context) {\n var self = this;\n EsriLeaflet.Util.reduce(\n this._getRendererSymbols(drawingInfo.renderer), [],\n function(curr, symbol, cb) {\n self._renderSymbol(symbol, function(err, image) {\n if (err) {\n return cb(err, curr);\n }\n cb(null, curr.concat([{\n label: symbol.label,\n height: image.height,\n url: symbol.symbol.url,\n imageData: image.imageData,\n contentType: image.contentType,\n width: image.width,\n values: [symbol.value || '']\n }]));\n }, self);\n },\n function(err, legend) {\n callback.call(context, err, legend);\n });\n },\n\n _renderSymbol: function(symbol, callback, context) {\n return this._renderer.render(symbol.symbol, callback, context);\n }\n\n});\n","EsriLeaflet.Tasks.Legend.SymbolRenderer = L.Class.extend({\n\n statics: {\n SYMBOL_TYPES: {\n MARKER: 'esriSMS',\n LINE: 'esriSLS',\n FILL: 'esriSFS',\n PICTURE_MARKER: 'esriPMS',\n PICTURE_FILL: 'esriPFS',\n TEXT: 'esriTS'\n },\n DEFAULT_SIZE: 20\n },\n\n render: function(symbol, callback, context) {\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n var imageData = symbol.imageData;\n this._setSize(canvas, symbol);\n\n function done(error, imageData) {\n if (error) {\n callback.call(context, error);\n } else {\n callback.call(context, null, {\n width: canvas.width || EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE,\n height: canvas.height || EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE,\n imageData: imageData.replace('data:image/png;base64,', ''),\n url: null,\n contentType: 'image/png'\n });\n }\n }\n\n if (symbol.imageData) {\n return done(null, symbol.imageData);\n }\n\n switch (symbol.type) {\n case 'esriSMS':\n this._renderMarker(ctx, symbol, done);\n break;\n case 'esriSLS':\n this._renderLine(ctx, symbol, done);\n break;\n case 'esriSFS':\n this._renderFill(ctx, symbol, done);\n break;\n case 'esriPMS':\n this._renderImageMarker(ctx, symbol, done);\n break;\n case 'esriPFS':\n this._renderImageFill(ctx, symbol, done);\n break;\n case 'esriST':\n this._renderText(ctx, symbol, done);\n break;\n default:\n break;\n }\n },\n\n _renderText: function(ctx, symbol, callback) {\n callback(null, ctx.canvas.toDataURL());\n },\n\n _renderFill: function(ctx, symbol, callback) {\n var size = EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE;\n var lineWidth = symbol.outline ? symbol.outline.width : 1;\n var lineOffset = Math.max(5, lineWidth * 3);\n switch (symbol.style) {\n\n case 'esriSFSVertical':\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSHorizontal':\n this._setRotation(ctx, 90);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSBackwardDiagonal':\n this._setRotation(ctx, -45);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSForwardDiagonal':\n this._setRotation(ctx, 45);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSCross':\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n this._setRotation(ctx, 90);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSDiagonalCross':\n this._setRotation(ctx, 45);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n this._setRotation(ctx, 45);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSSolid':\n ctx.fillStyle = this._formatColor(symbol.color);\n ctx.fillRect(0, 0, size, size);\n break;\n\n case 'esriSFSNull':\n break;\n\n default:\n throw new Error('Unknown SFS style: ' + symbol.style);\n }\n\n if (symbol.outline) {\n ctx.strokeStyle = this._formatColor(symbol.outline.color);\n ctx.lineWidth = symbol.outline.width;\n ctx.fillStyle = this._formatColor([0, 0, 0, 0]);\n this._setDashArray(ctx, symbol.outline);\n ctx.rect(symbol.outline.width, symbol.outline.width,\n size - symbol.outline.width, size - symbol.outline.width);\n ctx.stroke();\n }\n\n callback(null, ctx.canvas.toDataURL());\n },\n\n _renderLine: function(ctx, symbol, callback) {\n var size = EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE;\n ctx.beginPath();\n ctx.lineWidth = symbol.width;\n ctx.strokeStyle = this._formatColor(symbol.color);\n this._setDashArray(ctx, symbol); //\n\n ctx.moveTo(0, size / 2);\n ctx.lineTo(size, size / 2);\n\n ctx.closePath();\n ctx.stroke();\n callback(null, ctx.canvas.toDataURL());\n },\n\n _renderMarker: function(ctx, symbol, callback) {\n var xoffset = 0;\n var yoffset = 0;\n var size = symbol.size;\n var r, rx, ry;\n\n ctx.beginPath();\n\n if (symbol.outline) {\n ctx.strokeStyle = this._formatColor(symbol.outline.color);\n ctx.lineWidth = symbol.outline.width;\n xoffset += symbol.outline.width;\n yoffset += symbol.outline.width;\n }\n\n this._setRotation(ctx, symbol.angle);\n\n switch (symbol.style) {\n case 'esriSMSCircle':\n ctx.fillStyle = this._formatColor(symbol.color);\n r = (size - 2 * xoffset) / 2;\n ctx.arc(r + xoffset, r + xoffset, r, 0, 2 * Math.PI, false);\n ctx.fill();\n break;\n\n case 'esriSMSX':\n ctx.moveTo(xoffset, yoffset);\n ctx.lineTo(size - xoffset, size - yoffset);\n ctx.moveTo(size - xoffset, yoffset);\n ctx.lineTo(xoffset, size - yoffset);\n break;\n\n case 'esriSMSCross':\n ctx.moveTo(xoffset, size / 2);\n ctx.lineTo(size - xoffset, size / 2);\n ctx.moveTo(size / 2, yoffset);\n ctx.lineTo(size / 2, size - yoffset);\n break;\n\n case 'esriSMSDiamond':\n ctx.fillStyle = this._formatColor(symbol.color);\n rx = (size - 2 * xoffset) / 2;\n ry = (size - 2 * yoffset) / 2;\n\n ctx.moveTo(xoffset, yoffset + ry);\n ctx.lineTo(xoffset + rx, yoffset);\n ctx.lineTo(xoffset + rx * 2, yoffset + ry);\n ctx.lineTo(xoffset + rx, yoffset + 2 * ry);\n ctx.lineTo(xoffset, yoffset + ry);\n ctx.fill();\n break;\n\n case 'esriSMSSquare':\n ctx.rect(xoffset, yoffset, size - 2 * xoffset, size - 2 * yoffset);\n break;\n\n case 'esriSMSTriangle':\n ctx.fillStyle = this._formatColor(symbol.color);\n rx = (size - 2 * xoffset) / 2;\n ry = (size - 2 * yoffset) / 2;\n ctx.moveTo(xoffset, yoffset + ry * 2);\n ctx.lineTo(xoffset + rx, yoffset);\n ctx.lineTo(xoffset + rx * 2, yoffset + ry * 2);\n ctx.lineTo(xoffset, yoffset + ry * 2);\n ctx.fill();\n break;\n\n default:\n throw new Error('Unknown esriSMS style: ' + symbol.style);\n }\n\n ctx.closePath();\n if (symbol.outline) {\n ctx.stroke();\n }\n callback(null, ctx.canvas.toDataURL());\n },\n\n _renderImageFill: function(ctx, symbol, callback) {\n this._setRotation(ctx, symbol.angle);\n if (symbol.imageData) {\n this._fillImage(ctx, symbol.imageData, symbol, symbol.contentType);\n callback(null, ctx.toDataURL());\n } else {\n this._loadImage(symbol.url, function(err, image) {\n this._fillImage(ctx, null, symbol, symbol.contentType, image);\n callback(null, ctx.canvas.toDataURL());\n }, this);\n }\n },\n\n _renderImageMarker: function(ctx, symbol, callback) {\n this._setRotation(ctx, symbol.angle);\n if (symbol.imageData) {\n this._drawImage(ctx, symbol.imageData, symbol.contentType);\n callback(null, ctx.toDataURL());\n } else {\n this._loadImage(symbol.url, function(err, image) {\n ctx.drawImage(image, 0, 0);\n callback(null, ctx.canvas.toDataURL());\n }, this);\n }\n },\n\n _setSize: function(ctx, symbol) {\n if (symbol.size) {\n ctx.width = ctx.height = symbol.size;\n } else if (symbol.type === 'esriSLS' ||\n symbol.type === 'esriSFS') {\n ctx.width = ctx.height = EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE;\n } else {\n ctx.width = symbol.width;\n ctx.height = symbol.height;\n }\n },\n\n _setRotation: function(ctx, angle) {\n ctx.rotate(-parseFloat(angle) * Math.PI / 180);\n },\n\n _setDashArray: function(ctx, symbol) {\n var dashArray = this._formatDashArray(symbol);\n if (dashArray.length) {\n ctx.setLineDash(dashArray);\n }\n },\n\n _drawCross: function(ctx, xoffset, yoffset, size) {\n ctx.moveTo(xoffset, yoffset);\n ctx.lineTo(size - xoffset, size - yoffset);\n ctx.moveTo(size - xoffset, yoffset);\n ctx.lineTo(xoffset, size - yoffset);\n },\n\n _hatchCanvas: function(ctx, size, color, width, offset) {\n var w = size * 2;\n var h = size * 2;\n\n for (var i = -w; i < w; i += offset) {\n ctx.moveTo(i, -h);\n ctx.lineTo(i, h);\n }\n\n ctx.lineWidth = width;\n ctx.strokeStyle = this._formatColor(color);\n ctx.stroke();\n },\n\n _formatColor: function(color) {\n return 'rgba(' + color.slice(0, 3).join(',') + ',' + color[3] / 255 + ')';\n },\n\n _formatDashArray: function(symbol) {\n var dashValues = [];\n\n switch (symbol.style) {\n case 'esriSLSDash':\n dashValues = [4, 3];\n break;\n case 'esriSLSDot':\n dashValues = [1, 3];\n break;\n case 'esriSLSDashDot':\n dashValues = [8, 3, 1, 3];\n break;\n case 'esriSLSDashDotDot':\n dashValues = [8, 3, 1, 3, 1, 3];\n break;\n }\n\n //use the dash values and the line weight to set dash array\n if (dashValues.length > 0) {\n for (var i = 0, len = dashValues.length; i < len; i++) {\n dashValues[i] *= symbol.width;\n }\n }\n\n return dashValues;\n },\n\n _getImageData: function(ctx, symbol) {\n return ctx.toDImageData(0, 0, symbol.width, symbol.height);\n },\n\n _fillImage: function(ctx, imageData, symbol, contentType, image) {\n var size = L.EsriLeaflet.Tasks.Legend.DEFAULT_SIZE;\n var w = symbol.width || size;\n var h = symbol.height || size;\n if (imageData) {\n image = new Image();\n image.src = 'data:' + contentType + ';base64,' + imageData;\n }\n\n var pattern = ctx.createPattern(image, 'repeat');\n ctx.rect(0, 0, w, h);\n ctx.fillStyle = pattern;\n ctx.fill();\n\n if (symbol.outline) {\n ctx.strokeStyle = this._formatColor(symbol.outline.color);\n ctx.lineWidth = symbol.outline.width;\n ctx.fillStyle = this._formatColor([0, 0, 0, 0]);\n this._setDashArray(ctx, symbol.outline);\n ctx.rect(symbol.outline.width, symbol.outline.width,\n w - symbol.outline.width, h - symbol.outline.width);\n ctx.stroke();\n }\n },\n\n _drawImage: function(ctx, imageData, contentType) {\n var image = new Image();\n image.src = 'data:' + contentType + ';base64,' + imageData;\n ctx.drawImage(image, 0, 0);\n },\n\n _loadImage: function(url, callback, context) {\n var image = new Image();\n image.crossOrigin = '';\n image.onload = function() {\n callback.call(context, null, this);\n };\n image.onerror = function(e) {\n callback.call(context, {\n code: 500\n });\n };\n image.src = url + (url.indexOf('?') === -1 ? '?' : '&') +\n 'nc=' + (new Date()).getTime();\n }\n\n});\n","EsriLeaflet.Layers.DynamicMapLayer.include({\n\n legend: function(callback, context) {\n return this._service.legend(callback, context);\n }\n\n});\n","EsriLeaflet.Layers.FeatureLayer.include({\n\n legend: function(callback, context) {\n return this._service.legend(callback, context);\n }\n\n});\n","EsriLeaflet.Controls.Legend = L.Control.extend({\n\n options: {\n listTemplate: '',\n layerTemplate: '{layerName}',\n listRowTemplate: '{label}',\n emptyLabel: '',\n container: null\n },\n\n initialize: function(layers, options) {\n this._layers = L.Util.isArray(layers) ? layers : [layers];\n L.Control.prototype.initialize.call(this, options);\n },\n\n onAdd: function(map) {\n var container = this.options.container ||\n L.DomUtil.create('div', 'leaflet-legend-control leaflet-bar');\n L.DomEvent\n .disableScrollPropagation(container)\n .disableClickPropagation(container);\n\n if (this._layers.length) {\n this._load();\n }\n return container;\n },\n\n _load: function() {\n L.esri.Util.reduce(this._layers, {\n layers: []\n }, function(curr, layer, cb) {\n layer.legend(function(err, legend) {\n if (err) {\n return cb(err, curr);\n }\n curr.layers = curr.layers.concat(legend.layers);\n cb(null, curr);\n });\n }, this._onLoad, this);\n },\n\n _onLoad: function(error, legend) {\n if (!error) {\n var layersHtml = '';\n for (var i = 0, len = legend.layers.length; i < len; i++) {\n var layer = legend.layers[i];\n var legendsHtml = '';\n for (var j = 0, jj = layer.legend.length; j < jj; j++) {\n var layerLegend = JSON.parse(JSON.stringify(layer.legend[j]));\n this._validateLegendLabel(layerLegend);\n legendsHtml += L.Util.template(this.options.listRowTemplate, layerLegend);\n }\n layersHtml += L.Util.template(this.options.layerTemplate, {\n layerName: layer.layerName,\n legends: legendsHtml\n });\n }\n this._container.innerHTML = L.Util.template(this.options.listTemplate, {\n layers: layersHtml\n });\n }\n },\n\n _validateLegendLabel: function(layerLegend) {\n if (!layerLegend.label && this.options.emptyLabel) {\n layerLegend.label = this.options.emptyLabel;\n }\n layerLegend.label = layerLegend.label.replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(//g, '>');\n }\n\n});\n\nEsriLeaflet.Controls.legend = function(layers, options) {\n return new L.esri.Controls.Legend(layers, options);\n};\n"]}
\ No newline at end of file
+{"version":3,"sources":["../src/Util.js","../src/Services/MapService.js","../src/Services/FeatureLayer.js","../src/Tasks/Legend.js","../src/Tasks/Legend/SymbolLegend.js","../src/Tasks/Legend/SymbolRenderer.js","../src/Layers/DynamicMapLayer.js","../src/Layers/FeatureLayer/FeatureLayer.js","../src/Controls/Legend.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,GAAG;AACH,CAAC,CAAC,CAAC,CAAC,OAAO;AACX,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACT,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;AACrB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE;AAC7C,CAAC,CAAC,KAAK,UAAU,CAAC,QAAQ,GAAG;AAC7B,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI;AAC5C,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE;AACf,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAC3C,CAAC,CAAC,CAAC,GAAG;AACN,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;AACV,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,CAAC,MAAM;AAC7B,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,SAAS,OAAO;AAC9B,CAAC,CAAC,CAAC,CAAC,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,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;AAC9E,QAAQ,MAAM,CAAC,CAAC,UAAU;AAC1B,MAAM,GAAG;AACT,IAAI,CAAC;AACL,EAAE,EAAE;AACJ;AACA,EAAE,oBAAoB,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;AAC/C,IAAI,EAAE,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;AACxD,MAAM,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;AAClD,IAAI,CAAC;AACL,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG;AAChE,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG;AAC9B,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG;AAC7B,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG;AAC5B,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI;AAC7B,EAAE,CAAC;AACH;AACA,GAAG;AACH;AACA,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACvD,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;AACnD,EAAE","file":"esri-leaflet-legend-compat-src.js","sourcesContent":["/**\n * @example\n * \n * L.esri.Util.queue(\n * [1, 2, 3], [], function(curr, item, cb){\n * setTimeout(function(){\n * cb(null, curr.concat([item + 10]));\n * }, 200);\n * }, function(err, result) {\n * console.log(result); // [11, 12, 13]\n * });\n *
\n * @param {Array.<*>} values\n * @param {*} initial\n * @param {Function} fn process item fn(memo, item, callback)\n * @param {Function} done queue complete\n * @param {*=} context\n */\nEsriLeaflet.Util.reduce = function(values, initial, fn, cb, context) {\n var curr = initial;\n\n function next(index) {\n var sync = true;\n for (var i = index; i < values.length; i++) {\n var done = false;\n fn(curr, values[i], function(err, val) {\n if (err) {\n return cb.call(context, err, curr);\n }\n done = true;\n curr = val;\n if (!sync) {\n next(i + 1);\n }\n });\n sync = done;\n if (!sync) {\n return;\n }\n }\n cb.call(context, null, curr);\n }\n\n next(0);\n};\n","EsriLeaflet.MapService.include({\n\n legend: function(callback, context) {\n return new EsriLeaflet.Legend(this).run(callback, context);\n }\n\n});\n","EsriLeaflet.FeatureLayerService.include({\n\n legend: function(callback, context) {\n return new L.esri.Legend(this).run(callback, context);\n }\n\n});\n","EsriLeaflet.Legend = EsriLeaflet.Task.extend({\n path: 'legend',\n\n params: {\n f: 'json'\n },\n\n run: function(callback, context) {\n if (this._service) {\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n }\n\n});\n\nEsriLeaflet.legend = function(params) {\n return new EsriLeaflet.Legend(params);\n};\n","EsriLeaflet.Legend.include({\n\n initialize: function(endpoint) {\n this._renderer = new EsriLeaflet.Legend.SymbolRenderer();\n EsriLeaflet.Task.prototype.initialize.call(this, endpoint);\n },\n\n run: function(callback, context) {\n function cb(error, response) {\n if (error && error.code === 400) { // ArcGIS server >=10.0\n this._collectLegendFromLayers(callback, context);\n } else if (response && response.drawingInfo) {\n this._symbolsToLegends([response], function(err, result) {\n callback.call(context, err, {\n layers: result\n });\n });\n } else {\n callback.call(context, error, response);\n }\n }\n\n if (this._service) {\n return this._service.request(this.path, this.params, cb, this);\n } else {\n return this._request('request', this.path, this.params, cb, this);\n }\n },\n\n _collectLegendFromLayers: function(callback, context) {\n this._service.metadata(function(error, response) {\n if (error) {\n return callback.call(context, error);\n }\n\n var layers = [];\n for (var i = 0, len = response.layers.length; i < len; i++) {\n if (!response.layers[i].subLayerIds) {\n layers.push(response.layers[i]);\n }\n }\n\n this._getLayersLegends(layers, function(err, layerData) {\n if (err) {\n callback.call(context, err);\n } else {\n this._symbolsToLegends(layerData, function(err, result) {\n callback.call(context, err, {\n layers: result\n });\n });\n }\n }, this);\n }, this);\n },\n\n _getLayersLegends: function(layerDefs, callback, context) {\n var layerData = [];\n var self = this;\n\n EsriLeaflet.Util.reduce(layerDefs, [], function(curr, layer, cb) {\n self._getLayerLegend(layer, function(err, data) {\n if (err) {\n return cb(err, null);\n }\n cb(null, curr.concat(data));\n }, self);\n }, function(err, result) {\n callback.call(context, err, result);\n });\n },\n\n _getLayerLegend: function(layer, callback, context) {\n this._service.request(layer.id, {\n f: 'json'\n }, callback, context);\n },\n\n _symbolsToLegends: function(layerData, callback, context) {\n var self = this;\n EsriLeaflet.Util.reduce(layerData, [], function(curr, layer, cb) {\n self._drawingInfoToLegend(layer.drawingInfo, function(err, legend) {\n if (err) {\n return cb(err, null);\n }\n cb(null, curr.concat([{\n layerId: layer.id,\n layerType: layer.type,\n layerName: layer.name,\n maxScale: layer.maxScale,\n minScale: layer.minScale,\n legend: legend\n }]));\n }, self);\n }, function(err, result) {\n callback.call(context, err, result);\n });\n },\n\n _getRendererSymbols: function(renderer) {\n var symbols;\n if (renderer.type === 'uniqueValue') {\n symbols = renderer.uniqueValueInfos.slice();\n } else if (renderer.type === 'classBreaks') {\n symbols = renderer.classBreakInfos.slice();\n } else if (renderer.type === 'simple') {\n symbols = [{\n symbol: renderer.symbol,\n label: renderer.label,\n description: renderer.description,\n value: renderer.value\n }];\n }\n if (renderer.defaultSymbol) {\n symbols.push({\n symbol: renderer.defaultSymbol,\n label: renderer.defaultLabel,\n description: '',\n value: null\n });\n }\n return symbols;\n },\n\n _drawingInfoToLegend: function(drawingInfo, callback, context) {\n var self = this;\n EsriLeaflet.Util.reduce(\n this._getRendererSymbols(drawingInfo.renderer), [],\n function(curr, symbol, cb) {\n self._renderSymbol(symbol, function(err, image) {\n if (err) {\n return cb(err, curr);\n }\n cb(null, curr.concat([{\n label: symbol.label,\n height: image.height,\n url: symbol.symbol.url,\n imageData: image.imageData,\n contentType: image.contentType,\n width: image.width,\n values: [symbol.value || '']\n }]));\n }, self);\n },\n function(err, legend) {\n callback.call(context, err, legend);\n });\n },\n\n _renderSymbol: function(symbol, callback, context) {\n return this._renderer.render(symbol.symbol, callback, context);\n }\n\n});\n","EsriLeaflet.Legend.SymbolRenderer = L.Class.extend({\n\n statics: {\n SYMBOL_TYPES: {\n MARKER: 'esriSMS',\n LINE: 'esriSLS',\n FILL: 'esriSFS',\n PICTURE_MARKER: 'esriPMS',\n PICTURE_FILL: 'esriPFS',\n TEXT: 'esriTS'\n },\n DEFAULT_SIZE: 20\n },\n\n render: function(symbol, callback, context) {\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n var imageData = symbol.imageData;\n this._setSize(canvas, symbol);\n\n function done(error, imageData) {\n if (error) {\n callback.call(context, error);\n } else {\n callback.call(context, null, {\n width: canvas.width || EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE,\n height: canvas.height || EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE,\n imageData: imageData.replace('data:image/png;base64,', ''),\n url: null,\n contentType: 'image/png'\n });\n }\n }\n\n if (symbol.imageData) {\n return done(null, symbol.imageData);\n }\n\n switch (symbol.type) {\n case 'esriSMS':\n this._renderMarker(ctx, symbol, done);\n break;\n case 'esriSLS':\n this._renderLine(ctx, symbol, done);\n break;\n case 'esriSFS':\n this._renderFill(ctx, symbol, done);\n break;\n case 'esriPMS':\n this._renderImageMarker(ctx, symbol, done);\n break;\n case 'esriPFS':\n this._renderImageFill(ctx, symbol, done);\n break;\n case 'esriST':\n this._renderText(ctx, symbol, done);\n break;\n default:\n break;\n }\n },\n\n _renderText: function(ctx, symbol, callback) {\n callback(null, ctx.canvas.toDataURL());\n },\n\n _renderFill: function(ctx, symbol, callback) {\n var size = EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE;\n var lineWidth = symbol.outline ? symbol.outline.width : 1;\n var lineOffset = Math.max(5, lineWidth * 3);\n switch (symbol.style) {\n\n case 'esriSFSVertical':\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSHorizontal':\n this._setRotation(ctx, 90);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSBackwardDiagonal':\n this._setRotation(ctx, -45);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSForwardDiagonal':\n this._setRotation(ctx, 45);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSCross':\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n this._setRotation(ctx, 90);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSDiagonalCross':\n this._setRotation(ctx, 45);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n this._setRotation(ctx, 45);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSSolid':\n ctx.fillStyle = this._formatColor(symbol.color);\n ctx.fillRect(0, 0, size, size);\n break;\n\n case 'esriSFSNull':\n break;\n\n default:\n throw new Error('Unknown SFS style: ' + symbol.style);\n }\n\n if (symbol.outline) {\n ctx.strokeStyle = this._formatColor(symbol.outline.color);\n ctx.lineWidth = symbol.outline.width;\n ctx.fillStyle = this._formatColor([0, 0, 0, 0]);\n this._setDashArray(ctx, symbol.outline);\n ctx.rect(symbol.outline.width, symbol.outline.width,\n size - symbol.outline.width, size - symbol.outline.width);\n ctx.stroke();\n }\n\n callback(null, ctx.canvas.toDataURL());\n },\n\n _renderLine: function(ctx, symbol, callback) {\n var size = EsriLeaflet.Legend.SymbolRenderer.DEFAULT_SIZE;\n ctx.beginPath();\n ctx.lineWidth = symbol.width;\n ctx.strokeStyle = this._formatColor(symbol.color);\n this._setDashArray(ctx, symbol); //\n\n ctx.moveTo(0, size / 2);\n ctx.lineTo(size, size / 2);\n\n ctx.closePath();\n ctx.stroke();\n callback(null, ctx.canvas.toDataURL());\n },\n\n _renderMarker: function(ctx, symbol, callback) {\n var xoffset = 0;\n var yoffset = 0;\n var size = symbol.size;\n var r, rx, ry;\n\n ctx.beginPath();\n\n if (symbol.outline) {\n ctx.strokeStyle = this._formatColor(symbol.outline.color);\n ctx.lineWidth = symbol.outline.width;\n xoffset += symbol.outline.width;\n yoffset += symbol.outline.width;\n }\n\n this._setRotation(ctx, symbol.angle);\n\n switch (symbol.style) {\n case 'esriSMSCircle':\n ctx.fillStyle = this._formatColor(symbol.color);\n r = (size - 2 * xoffset) / 2;\n ctx.arc(r + xoffset, r + xoffset, r, 0, 2 * Math.PI, false);\n ctx.fill();\n break;\n\n case 'esriSMSX':\n ctx.moveTo(xoffset, yoffset);\n ctx.lineTo(size - xoffset, size - yoffset);\n ctx.moveTo(size - xoffset, yoffset);\n ctx.lineTo(xoffset, size - yoffset);\n break;\n\n case 'esriSMSCross':\n ctx.moveTo(xoffset, size / 2);\n ctx.lineTo(size - xoffset, size / 2);\n ctx.moveTo(size / 2, yoffset);\n ctx.lineTo(size / 2, size - yoffset);\n break;\n\n case 'esriSMSDiamond':\n ctx.fillStyle = this._formatColor(symbol.color);\n rx = (size - 2 * xoffset) / 2;\n ry = (size - 2 * yoffset) / 2;\n\n ctx.moveTo(xoffset, yoffset + ry);\n ctx.lineTo(xoffset + rx, yoffset);\n ctx.lineTo(xoffset + rx * 2, yoffset + ry);\n ctx.lineTo(xoffset + rx, yoffset + 2 * ry);\n ctx.lineTo(xoffset, yoffset + ry);\n ctx.fill();\n break;\n\n case 'esriSMSSquare':\n ctx.rect(xoffset, yoffset, size - 2 * xoffset, size - 2 * yoffset);\n break;\n\n case 'esriSMSTriangle':\n ctx.fillStyle = this._formatColor(symbol.color);\n rx = (size - 2 * xoffset) / 2;\n ry = (size - 2 * yoffset) / 2;\n ctx.moveTo(xoffset, yoffset + ry * 2);\n ctx.lineTo(xoffset + rx, yoffset);\n ctx.lineTo(xoffset + rx * 2, yoffset + ry * 2);\n ctx.lineTo(xoffset, yoffset + ry * 2);\n ctx.fill();\n break;\n\n default:\n throw new Error('Unknown esriSMS style: ' + symbol.style);\n }\n\n ctx.closePath();\n if (symbol.outline) {\n ctx.stroke();\n }\n callback(null, ctx.canvas.toDataURL());\n },\n\n _renderImageFill: function(ctx, symbol, callback) {\n this._setRotation(ctx, symbol.angle);\n if (symbol.imageData) {\n this._fillImage(ctx, symbol.imageData, symbol, symbol.contentType);\n callback(null, ctx.toDataURL());\n } else {\n this._loadImage(symbol.url, function(err, image) {\n this._fillImage(ctx, null, symbol, symbol.contentType, image);\n callback(null, ctx.canvas.toDataURL());\n }, this);\n }\n },\n\n _renderImageMarker: function(ctx, symbol, callback) {\n this._setRotation(ctx, symbol.angle);\n if (symbol.imageData) {\n this._drawImage(ctx, symbol.imageData, symbol.contentType);\n callback(null, ctx.toDataURL());\n } else {\n this._loadImage(symbol.url, function(err, image) {\n ctx.drawImage(image, 0, 0);\n callback(null, ctx.canvas.toDataURL());\n }, this);\n }\n },\n\n _setSize: function(ctx, symbol) {\n if (symbol.size) {\n ctx.width = ctx.height = symbol.size;\n } else if (symbol.type === 'esriSLS' ||\n symbol.type === 'esriSFS') {\n ctx.width = ctx.height = EsriLeaflet.Legend.SymbolRenderer.DEFAULT_SIZE;\n } else {\n ctx.width = symbol.width;\n ctx.height = symbol.height;\n }\n },\n\n _setRotation: function(ctx, angle) {\n ctx.rotate(-parseFloat(angle) * Math.PI / 180);\n },\n\n _setDashArray: function(ctx, symbol) {\n var dashArray = this._formatDashArray(symbol);\n if (dashArray.length) {\n ctx.setLineDash(dashArray);\n }\n },\n\n _drawCross: function(ctx, xoffset, yoffset, size) {\n ctx.moveTo(xoffset, yoffset);\n ctx.lineTo(size - xoffset, size - yoffset);\n ctx.moveTo(size - xoffset, yoffset);\n ctx.lineTo(xoffset, size - yoffset);\n },\n\n _hatchCanvas: function(ctx, size, color, width, offset) {\n var w = size * 2;\n var h = size * 2;\n\n for (var i = -w; i < w; i += offset) {\n ctx.moveTo(i, -h);\n ctx.lineTo(i, h);\n }\n\n ctx.lineWidth = width;\n ctx.strokeStyle = this._formatColor(color);\n ctx.stroke();\n },\n\n _formatColor: function(color) {\n return 'rgba(' + color.slice(0, 3).join(',') + ',' + color[3] / 255 + ')';\n },\n\n _formatDashArray: function(symbol) {\n var dashValues = [];\n\n switch (symbol.style) {\n case 'esriSLSDash':\n dashValues = [4, 3];\n break;\n case 'esriSLSDot':\n dashValues = [1, 3];\n break;\n case 'esriSLSDashDot':\n dashValues = [8, 3, 1, 3];\n break;\n case 'esriSLSDashDotDot':\n dashValues = [8, 3, 1, 3, 1, 3];\n break;\n }\n\n //use the dash values and the line weight to set dash array\n if (dashValues.length > 0) {\n for (var i = 0, len = dashValues.length; i < len; i++) {\n dashValues[i] *= symbol.width;\n }\n }\n\n return dashValues;\n },\n\n _getImageData: function(ctx, symbol) {\n return ctx.toDImageData(0, 0, symbol.width, symbol.height);\n },\n\n _fillImage: function(ctx, imageData, symbol, contentType, image) {\n var size = L.esri.Legend.DEFAULT_SIZE;\n var w = symbol.width || size;\n var h = symbol.height || size;\n if (imageData) {\n image = new Image();\n image.src = 'data:' + contentType + ';base64,' + imageData;\n }\n\n var pattern = ctx.createPattern(image, 'repeat');\n ctx.rect(0, 0, w, h);\n ctx.fillStyle = pattern;\n ctx.fill();\n\n if (symbol.outline) {\n ctx.strokeStyle = this._formatColor(symbol.outline.color);\n ctx.lineWidth = symbol.outline.width;\n ctx.fillStyle = this._formatColor([0, 0, 0, 0]);\n this._setDashArray(ctx, symbol.outline);\n ctx.rect(symbol.outline.width, symbol.outline.width,\n w - symbol.outline.width, h - symbol.outline.width);\n ctx.stroke();\n }\n },\n\n _drawImage: function(ctx, imageData, contentType) {\n var image = new Image();\n image.src = 'data:' + contentType + ';base64,' + imageData;\n ctx.drawImage(image, 0, 0);\n },\n\n _loadImage: function(url, callback, context) {\n var image = new Image();\n image.crossOrigin = '';\n image.onload = function() {\n callback.call(context, null, this);\n };\n image.onerror = function(e) {\n callback.call(context, {\n code: 500\n });\n };\n image.src = url + (url.indexOf('?') === -1 ? '?' : '&') +\n 'nc=' + (new Date()).getTime();\n }\n\n});\n","EsriLeaflet.DynamicMapLayer.include({\n\n legend: function(callback, context) {\n return this.service.legend(callback, context);\n }\n\n});\n","EsriLeaflet.FeatureLayer.include({\n\n legend: function(callback, context) {\n return this.service.legend(callback, context);\n }\n\n});\n","EsriLeaflet.LegendControl = L.Control.extend({\n\n options: {\n listTemplate: '',\n layerTemplate: '{layerName}',\n listRowTemplate: '{label}',\n emptyLabel: '',\n container: null\n },\n\n initialize: function(layers, options) {\n this._layers = L.Util.isArray(layers) ? layers : [layers];\n L.Control.prototype.initialize.call(this, options);\n },\n\n onAdd: function(map) {\n var container = this.options.container ||\n L.DomUtil.create('div', 'leaflet-legend-control leaflet-bar');\n L.DomEvent\n .disableScrollPropagation(container)\n .disableClickPropagation(container);\n\n if (this._layers.length) {\n this._load();\n }\n return container;\n },\n\n _load: function() {\n L.esri.Util.reduce(this._layers, {\n layers: []\n }, function(curr, layer, cb) {\n layer.legend(function(err, legend) {\n if (err) {\n return cb(err, curr);\n }\n curr.layers = curr.layers.concat(legend.layers);\n cb(null, curr);\n });\n }, this._onLoad, this);\n },\n\n _onLoad: function(error, legend) {\n if (!error) {\n var layersHtml = '';\n for (var i = 0, len = legend.layers.length; i < len; i++) {\n var layer = legend.layers[i];\n var legendsHtml = '';\n for (var j = 0, jj = layer.legend.length; j < jj; j++) {\n var layerLegend = JSON.parse(JSON.stringify(layer.legend[j]));\n this._validateLegendLabel(layerLegend);\n legendsHtml += L.Util.template(this.options.listRowTemplate, layerLegend);\n }\n layersHtml += L.Util.template(this.options.layerTemplate, {\n layerName: layer.layerName,\n legends: legendsHtml\n });\n }\n this._container.innerHTML = L.Util.template(this.options.listTemplate, {\n layers: layersHtml\n });\n }\n },\n\n _validateLegendLabel: function(layerLegend) {\n if (!layerLegend.label && this.options.emptyLabel) {\n layerLegend.label = this.options.emptyLabel;\n }\n layerLegend.label = layerLegend.label.replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(//g, '>');\n }\n\n});\n\nEsriLeaflet.legendControl = function(layers, options) {\n return new L.esri.LegendControl(layers, options);\n};\n"]}
\ No newline at end of file
diff --git a/dist/esri-leaflet-legend-compat.js b/dist/esri-leaflet-legend-compat.js
index a01fd9f..dda0869 100644
--- a/dist/esri-leaflet-legend-compat.js
+++ b/dist/esri-leaflet-legend-compat.js
@@ -15,29 +15,7 @@
}(function (L, EsriLeaflet) {
-/**
- * @example
- *
- * L.esri.Util.queue(
- * [1, 2, 3], [], function(curr, item, cb){
- * setTimeout(function(){
- * cb(null, curr.concat([item + 10]));
- * }, 200);
- * }, function(err, result) {
- * console.log(result); // [11, 12, 13]
- * });
- *
- * @param {Array.<*>} values
- * @param {*} initial
- * @param {Function} fn process item fn(memo, item, callback)
- * @param {Function} done queue complete
- * @param {*=} context
- */
-EsriLeaflet.Util.reduce=function(a,b,c,d,e){function f(b){for(var h=!0,i=b;i=10.0
-this._collectLegendFromLayers(a,b):d.drawingInfo?this._symbolsToLegends([d],function(c,d){a.call(b,c,{layers:d})}):a.call(b,c,d)}return this._service?this._service.request(this.path,this.params,c,this):this._request("request",this.path,this.params,c,this)},_collectLegendFromLayers:function(a,b){this._service.metadata(function(c,d){if(c)return a.call(b,c);for(var e=[],f=0,g=d.layers.length;f0)for(var c=0,d=b.length;c{layers}",layerTemplate:"{layerName}",listRowTemplate:'{label}',emptyLabel:"",container:null},initialize:function(a,b){this._layers=L.Util.isArray(a)?a:[a],L.Control.prototype.initialize.call(this,b)},onAdd:function(a){var b=this.options.container||L.DomUtil.create("div","leaflet-legend-control leaflet-bar");return L.DomEvent.disableScrollPropagation(b).disableClickPropagation(b),this._layers.length&&this._load(),b},_load:function(){L.esri.Util.reduce(this._layers,{layers:[]},function(a,b,c){b.legend(function(b,d){return b?c(b,a):(a.layers=a.layers.concat(d.layers),void c(null,a))})},this._onLoad,this)},_onLoad:function(a,b){if(!a){for(var c="",d=0,e=b.layers.length;d/g,">")}}),EsriLeaflet.Controls.legend=function(a,b){return new L.esri.Controls.Legend(a,b)};
+EsriLeaflet.Util.reduce=function(a,b,c,d,e){function f(b){for(var h=!0,i=b;i0)for(var c=0,d=b.length;c{layers}",layerTemplate:"{layerName}",listRowTemplate:'{label}',emptyLabel:"",container:null},initialize:function(a,b){this._layers=L.Util.isArray(a)?a:[a],L.Control.prototype.initialize.call(this,b)},onAdd:function(a){var b=this.options.container||L.DomUtil.create("div","leaflet-legend-control leaflet-bar");return L.DomEvent.disableScrollPropagation(b).disableClickPropagation(b),this._layers.length&&this._load(),b},_load:function(){L.esri.Util.reduce(this._layers,{layers:[]},function(a,b,c){b.legend(function(b,d){return b?c(b,a):(a.layers=a.layers.concat(d.layers),void c(null,a))})},this._onLoad,this)},_onLoad:function(a,b){if(!a){for(var c="",d=0,e=b.layers.length;d/g,">")}}),EsriLeaflet.legendControl=function(a,b){return new L.esri.LegendControl(a,b)};
//# sourceMappingURL=esri-leaflet-legend-compat.js.map
return EsriLeaflet;
diff --git a/dist/esri-leaflet-legend-compat.js.map b/dist/esri-leaflet-legend-compat.js.map
index 1f26aa5..e2aa332 100644
--- a/dist/esri-leaflet-legend-compat.js.map
+++ b/dist/esri-leaflet-legend-compat.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../src/Util.js","../src/Services/MapService.js","../src/Services/FeatureLayer.js","../src/Tasks/Legend.js","../src/Tasks/Legend/SymbolLegend.js","../src/Tasks/Legend/SymbolRenderer.js","../src/Layers/DynamicMapLayer.js","../src/Layers/FeatureLayer/FeatureLayer.js","../src/Controls/Legend.js"],"names":["EsriLeaflet","Util","reduce","values","initial","fn","cb","context","next","index","sync","i","length","done","curr","err","val","call","Services","MapService","include","legend","callback","Tasks","Legend","this","run","FeatureLayerService","Task","extend","path","params","f","_service","request","_request","initialize","endpoint","_renderer","SymbolRenderer","prototype","error","response","code","_collectLegendFromLayers","drawingInfo","_symbolsToLegends","result","layers","metadata","len","subLayerIds","push","_getLayersLegends","layerData","layerDefs","self","layer","_getLayerLegend","data","concat","id","_drawingInfoToLegend","layerId","layerType","type","layerName","name","maxScale","minScale","_getRendererSymbols","renderer","symbols","uniqueValueInfos","slice","classBreakInfos","symbol","label","description","value","defaultSymbol","defaultLabel","_renderSymbol","image","height","url","imageData","contentType","width","render","L","Class","statics","SYMBOL_TYPES","MARKER","LINE","FILL","PICTURE_MARKER","PICTURE_FILL","TEXT","DEFAULT_SIZE","canvas","replace","document","createElement","ctx","getContext","_setSize","_renderMarker","_renderLine","_renderFill","_renderImageMarker","_renderImageFill","_renderText","toDataURL","size","lineWidth","outline","lineOffset","Math","max","style","_hatchCanvas","color","_setRotation","fillStyle","_formatColor","fillRect","Error","strokeStyle","_setDashArray","rect","stroke","beginPath","moveTo","lineTo","closePath","r","rx","ry","xoffset","yoffset","angle","arc","PI","fill","_fillImage","_loadImage","_drawImage","drawImage","rotate","parseFloat","dashArray","_formatDashArray","setLineDash","_drawCross","offset","w","h","join","dashValues","_getImageData","toDImageData","Image","src","pattern","createPattern","crossOrigin","onload","onerror","e","indexOf","Date","getTime","Layers","DynamicMapLayer","FeatureLayer","Controls","Control","options","listTemplate","layerTemplate","listRowTemplate","emptyLabel","container","_layers","isArray","onAdd","map","DomUtil","create","DomEvent","disableScrollPropagation","disableClickPropagation","_load","esri","_onLoad","layersHtml","legendsHtml","j","jj","layerLegend","JSON","parse","stringify","_validateLegendLabel","template","legends","_container","innerHTML"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBAA,YAAYC,KAAKC,OAAS,SAASC,EAAQ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IE,GAAcC,KAAKC,MAAMD,KAAKE,UAAUnJ,EAAMpC,OAAOkL,IACzD9K,MAAKoL,qBAAqBJ,GAC1BH,GAAe5G,EAAEzF,KAAK6M,SAASrL,KAAK0J,QAAQG,gBAAiBmB,GAE/DJ,GAAc3G,EAAEzF,KAAK6M,SAASrL,KAAK0J,QAAQE,eACzCnH,UAAWT,EAAMS,UACjB6I,QAAST,IAGb7K,KAAKuL,WAAWC,UAAYvH,EAAEzF,KAAK6M,SAASrL,KAAK0J,QAAQC,cACvDpI,OAAQqJ,MAKdQ,qBAAsB,SAASJ,IACxBA,EAAY5H,OAASpD,KAAK0J,QAAQI,aACrCkB,EAAY5H,MAAQpD,KAAK0J,QAAQI,YAEnCkB,EAAY5H,MAAQ4H,EAAY5H,MAAMyB,QAAQ,KAAM,SACjDA,QAAQ,KAAM,UACdA,QAAQ,KAAM,SACdA,QAAQ,KAAM,QACdA,QAAQ,KAAM,WAKrBtG,YAAYiL,SAAS5J,OAAS,SAAS2B,EAAQmI,GAC7C,MAAO,IAAIzF,GAAEyG,KAAKlB,SAASzJ,OAAOwB,EAAQmI","file":"esri-leaflet-legend-compat.js","sourcesContent":["/**\n * @example\n * \n * L.esri.Util.queue(\n * [1, 2, 3], [], function(curr, item, cb){\n * setTimeout(function(){\n * cb(null, curr.concat([item + 10]));\n * }, 200);\n * }, function(err, result) {\n * console.log(result); // [11, 12, 13]\n * });\n *
\n * @param {Array.<*>} values\n * @param {*} initial\n * @param {Function} fn process item fn(memo, item, callback)\n * @param {Function} done queue complete\n * @param {*=} context\n */\nEsriLeaflet.Util.reduce = function(values, initial, fn, cb, context) {\n var curr = initial;\n\n function next(index) {\n var sync = true;\n for (var i = index; i < values.length; i++) {\n var done = false;\n fn(curr, values[i], function(err, val) {\n if (err) {\n return cb.call(context, err, curr);\n }\n done = true;\n curr = val;\n if (!sync) {\n next(i + 1);\n }\n });\n sync = done;\n if (!sync) {\n return;\n }\n }\n cb.call(context, null, curr);\n }\n\n next(0);\n};\n","EsriLeaflet.Services.MapService.include({\n\n legend: function(callback, context) {\n return new EsriLeaflet.Tasks.Legend(this).run(callback, context);\n }\n\n});\n","EsriLeaflet.Services.FeatureLayerService.include({\n\n legend: function(callback, context) {\n return new EsriLeaflet.Tasks.Legend(this).run(callback, context);\n }\n\n});\n","EsriLeaflet.Tasks.Legend = EsriLeaflet.Tasks.Task.extend({\n path: 'legend',\n\n params: {\n f: 'json'\n },\n\n run: function(callback, context) {\n if (this._service) {\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n }\n\n});\n\nEsriLeaflet.Tasks.legend = function(params) {\n return new EsriLeaflet.Tasks.Legend(params);\n};\n","EsriLeaflet.Tasks.Legend.include({\n\n initialize: function(endpoint) {\n this._renderer = new EsriLeaflet.Tasks.Legend.SymbolRenderer();\n EsriLeaflet.Tasks.Task.prototype.initialize.call(this, endpoint);\n },\n\n run: function(callback, context) {\n function cb(error, response) {\n if (error && error.error.code === 400) { // ArcGIS server >=10.0\n this._collectLegendFromLayers(callback, context);\n } else if (response.drawingInfo) {\n this._symbolsToLegends([response], function(err, result) {\n callback.call(context, err, {\n layers: result\n });\n });\n } else {\n callback.call(context, error, response);\n }\n }\n\n if (this._service) {\n return this._service.request(this.path, this.params, cb, this);\n } else {\n return this._request('request', this.path, this.params, cb, this);\n }\n },\n\n _collectLegendFromLayers: function(callback, context) {\n this._service.metadata(function(error, response) {\n if (error) {\n return callback.call(context, error);\n }\n\n var layers = [];\n for (var i = 0, len = response.layers.length; i < len; i++) {\n if (!response.layers[i].subLayerIds) {\n layers.push(response.layers[i]);\n }\n }\n\n this._getLayersLegends(layers, function(err, layerData) {\n if (err) {\n callback.call(context, err);\n } else {\n this._symbolsToLegends(layerData, function(err, result) {\n callback.call(context, err, {\n layers: result\n });\n });\n }\n }, this);\n }, this);\n },\n\n _getLayersLegends: function(layerDefs, callback, context) {\n var layerData = [];\n var self = this;\n\n EsriLeaflet.Util.reduce(layerDefs, [], function(curr, layer, cb) {\n self._getLayerLegend(layer, function(err, data) {\n if (err) {\n return cb(err, null);\n }\n cb(null, curr.concat(data));\n }, self);\n }, function(err, result) {\n callback.call(context, err, result);\n });\n },\n\n _getLayerLegend: function(layer, callback, context) {\n this._service.request(layer.id, {\n f: 'json'\n }, callback, context);\n },\n\n _symbolsToLegends: function(layerData, callback, context) {\n var self = this;\n EsriLeaflet.Util.reduce(layerData, [], function(curr, layer, cb) {\n self._drawingInfoToLegend(layer.drawingInfo, function(err, legend) {\n if (err) {\n return cb(err, null);\n }\n cb(null, curr.concat([{\n layerId: layer.id,\n layerType: layer.type,\n layerName: layer.name,\n maxScale: layer.maxScale,\n minScale: layer.minScale,\n legend: legend\n }]));\n }, self);\n }, function(err, result) {\n callback.call(context, err, result);\n });\n },\n\n _getRendererSymbols: function(renderer) {\n var symbols;\n if (renderer.type === 'uniqueValue') {\n symbols = renderer.uniqueValueInfos.slice();\n } else if (renderer.type === 'classBreaks') {\n symbols = renderer.classBreakInfos.slice();\n } else if (renderer.type === 'simple') {\n symbols = [{\n symbol: renderer.symbol,\n label: renderer.label,\n description: renderer.description,\n value: renderer.value\n }];\n }\n if (renderer.defaultSymbol) {\n symbols.push({\n symbol: renderer.defaultSymbol,\n label: renderer.defaultLabel,\n description: '',\n value: null\n });\n }\n return symbols;\n },\n\n _drawingInfoToLegend: function(drawingInfo, callback, context) {\n var self = this;\n EsriLeaflet.Util.reduce(\n this._getRendererSymbols(drawingInfo.renderer), [],\n function(curr, symbol, cb) {\n self._renderSymbol(symbol, function(err, image) {\n if (err) {\n return cb(err, curr);\n }\n cb(null, curr.concat([{\n label: symbol.label,\n height: image.height,\n url: symbol.symbol.url,\n imageData: image.imageData,\n contentType: image.contentType,\n width: image.width,\n values: [symbol.value || '']\n }]));\n }, self);\n },\n function(err, legend) {\n callback.call(context, err, legend);\n });\n },\n\n _renderSymbol: function(symbol, callback, context) {\n return this._renderer.render(symbol.symbol, callback, context);\n }\n\n});\n","EsriLeaflet.Tasks.Legend.SymbolRenderer = L.Class.extend({\n\n statics: {\n SYMBOL_TYPES: {\n MARKER: 'esriSMS',\n LINE: 'esriSLS',\n FILL: 'esriSFS',\n PICTURE_MARKER: 'esriPMS',\n PICTURE_FILL: 'esriPFS',\n TEXT: 'esriTS'\n },\n DEFAULT_SIZE: 20\n },\n\n render: function(symbol, callback, context) {\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n var imageData = symbol.imageData;\n this._setSize(canvas, symbol);\n\n function done(error, imageData) {\n if (error) {\n callback.call(context, error);\n } else {\n callback.call(context, null, {\n width: canvas.width || EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE,\n height: canvas.height || EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE,\n imageData: imageData.replace('data:image/png;base64,', ''),\n url: null,\n contentType: 'image/png'\n });\n }\n }\n\n if (symbol.imageData) {\n return done(null, symbol.imageData);\n }\n\n switch (symbol.type) {\n case 'esriSMS':\n this._renderMarker(ctx, symbol, done);\n break;\n case 'esriSLS':\n this._renderLine(ctx, symbol, done);\n break;\n case 'esriSFS':\n this._renderFill(ctx, symbol, done);\n break;\n case 'esriPMS':\n this._renderImageMarker(ctx, symbol, done);\n break;\n case 'esriPFS':\n this._renderImageFill(ctx, symbol, done);\n break;\n case 'esriST':\n this._renderText(ctx, symbol, done);\n break;\n default:\n break;\n }\n },\n\n _renderText: function(ctx, symbol, callback) {\n callback(null, ctx.canvas.toDataURL());\n },\n\n _renderFill: function(ctx, symbol, callback) {\n var size = EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE;\n var lineWidth = symbol.outline ? symbol.outline.width : 1;\n var lineOffset = Math.max(5, lineWidth * 3);\n switch (symbol.style) {\n\n case 'esriSFSVertical':\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSHorizontal':\n this._setRotation(ctx, 90);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSBackwardDiagonal':\n this._setRotation(ctx, -45);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSForwardDiagonal':\n this._setRotation(ctx, 45);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSCross':\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n this._setRotation(ctx, 90);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSDiagonalCross':\n this._setRotation(ctx, 45);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n this._setRotation(ctx, 45);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSSolid':\n ctx.fillStyle = this._formatColor(symbol.color);\n ctx.fillRect(0, 0, size, size);\n break;\n\n case 'esriSFSNull':\n break;\n\n default:\n throw new Error('Unknown SFS style: ' + symbol.style);\n }\n\n if (symbol.outline) {\n ctx.strokeStyle = this._formatColor(symbol.outline.color);\n ctx.lineWidth = symbol.outline.width;\n ctx.fillStyle = this._formatColor([0, 0, 0, 0]);\n this._setDashArray(ctx, symbol.outline);\n ctx.rect(symbol.outline.width, symbol.outline.width,\n size - symbol.outline.width, size - symbol.outline.width);\n ctx.stroke();\n }\n\n callback(null, ctx.canvas.toDataURL());\n },\n\n _renderLine: function(ctx, symbol, callback) {\n var size = EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE;\n ctx.beginPath();\n ctx.lineWidth = symbol.width;\n ctx.strokeStyle = this._formatColor(symbol.color);\n this._setDashArray(ctx, symbol); //\n\n ctx.moveTo(0, size / 2);\n ctx.lineTo(size, size / 2);\n\n ctx.closePath();\n ctx.stroke();\n callback(null, ctx.canvas.toDataURL());\n },\n\n _renderMarker: function(ctx, symbol, callback) {\n var xoffset = 0;\n var yoffset = 0;\n var size = symbol.size;\n var r, rx, ry;\n\n ctx.beginPath();\n\n if (symbol.outline) {\n ctx.strokeStyle = this._formatColor(symbol.outline.color);\n ctx.lineWidth = symbol.outline.width;\n xoffset += symbol.outline.width;\n yoffset += symbol.outline.width;\n }\n\n this._setRotation(ctx, symbol.angle);\n\n switch (symbol.style) {\n case 'esriSMSCircle':\n ctx.fillStyle = this._formatColor(symbol.color);\n r = (size - 2 * xoffset) / 2;\n ctx.arc(r + xoffset, r + xoffset, r, 0, 2 * Math.PI, false);\n ctx.fill();\n break;\n\n case 'esriSMSX':\n ctx.moveTo(xoffset, yoffset);\n ctx.lineTo(size - xoffset, size - yoffset);\n ctx.moveTo(size - xoffset, yoffset);\n ctx.lineTo(xoffset, size - yoffset);\n break;\n\n case 'esriSMSCross':\n ctx.moveTo(xoffset, size / 2);\n ctx.lineTo(size - xoffset, size / 2);\n ctx.moveTo(size / 2, yoffset);\n ctx.lineTo(size / 2, size - yoffset);\n break;\n\n case 'esriSMSDiamond':\n ctx.fillStyle = this._formatColor(symbol.color);\n rx = (size - 2 * xoffset) / 2;\n ry = (size - 2 * yoffset) / 2;\n\n ctx.moveTo(xoffset, yoffset + ry);\n ctx.lineTo(xoffset + rx, yoffset);\n ctx.lineTo(xoffset + rx * 2, yoffset + ry);\n ctx.lineTo(xoffset + rx, yoffset + 2 * ry);\n ctx.lineTo(xoffset, yoffset + ry);\n ctx.fill();\n break;\n\n case 'esriSMSSquare':\n ctx.rect(xoffset, yoffset, size - 2 * xoffset, size - 2 * yoffset);\n break;\n\n case 'esriSMSTriangle':\n ctx.fillStyle = this._formatColor(symbol.color);\n rx = (size - 2 * xoffset) / 2;\n ry = (size - 2 * yoffset) / 2;\n ctx.moveTo(xoffset, yoffset + ry * 2);\n ctx.lineTo(xoffset + rx, yoffset);\n ctx.lineTo(xoffset + rx * 2, yoffset + ry * 2);\n ctx.lineTo(xoffset, yoffset + ry * 2);\n ctx.fill();\n break;\n\n default:\n throw new Error('Unknown esriSMS style: ' + symbol.style);\n }\n\n ctx.closePath();\n if (symbol.outline) {\n ctx.stroke();\n }\n callback(null, ctx.canvas.toDataURL());\n },\n\n _renderImageFill: function(ctx, symbol, callback) {\n this._setRotation(ctx, symbol.angle);\n if (symbol.imageData) {\n this._fillImage(ctx, symbol.imageData, symbol, symbol.contentType);\n callback(null, ctx.toDataURL());\n } else {\n this._loadImage(symbol.url, function(err, image) {\n this._fillImage(ctx, null, symbol, symbol.contentType, image);\n callback(null, ctx.canvas.toDataURL());\n }, this);\n }\n },\n\n _renderImageMarker: function(ctx, symbol, callback) {\n this._setRotation(ctx, symbol.angle);\n if (symbol.imageData) {\n this._drawImage(ctx, symbol.imageData, symbol.contentType);\n callback(null, ctx.toDataURL());\n } else {\n this._loadImage(symbol.url, function(err, image) {\n ctx.drawImage(image, 0, 0);\n callback(null, ctx.canvas.toDataURL());\n }, this);\n }\n },\n\n _setSize: function(ctx, symbol) {\n if (symbol.size) {\n ctx.width = ctx.height = symbol.size;\n } else if (symbol.type === 'esriSLS' ||\n symbol.type === 'esriSFS') {\n ctx.width = ctx.height = EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE;\n } else {\n ctx.width = symbol.width;\n ctx.height = symbol.height;\n }\n },\n\n _setRotation: function(ctx, angle) {\n ctx.rotate(-parseFloat(angle) * Math.PI / 180);\n },\n\n _setDashArray: function(ctx, symbol) {\n var dashArray = this._formatDashArray(symbol);\n if (dashArray.length) {\n ctx.setLineDash(dashArray);\n }\n },\n\n _drawCross: function(ctx, xoffset, yoffset, size) {\n ctx.moveTo(xoffset, yoffset);\n ctx.lineTo(size - xoffset, size - yoffset);\n ctx.moveTo(size - xoffset, yoffset);\n ctx.lineTo(xoffset, size - yoffset);\n },\n\n _hatchCanvas: function(ctx, size, color, width, offset) {\n var w = size * 2;\n var h = size * 2;\n\n for (var i = -w; i < w; i += offset) {\n ctx.moveTo(i, -h);\n ctx.lineTo(i, h);\n }\n\n ctx.lineWidth = width;\n ctx.strokeStyle = this._formatColor(color);\n ctx.stroke();\n },\n\n _formatColor: function(color) {\n return 'rgba(' + color.slice(0, 3).join(',') + ',' + color[3] / 255 + ')';\n },\n\n _formatDashArray: function(symbol) {\n var dashValues = [];\n\n switch (symbol.style) {\n case 'esriSLSDash':\n dashValues = [4, 3];\n break;\n case 'esriSLSDot':\n dashValues = [1, 3];\n break;\n case 'esriSLSDashDot':\n dashValues = [8, 3, 1, 3];\n break;\n case 'esriSLSDashDotDot':\n dashValues = [8, 3, 1, 3, 1, 3];\n break;\n }\n\n //use the dash values and the line weight to set dash array\n if (dashValues.length > 0) {\n for (var i = 0, len = dashValues.length; i < len; i++) {\n dashValues[i] *= symbol.width;\n }\n }\n\n return dashValues;\n },\n\n _getImageData: function(ctx, symbol) {\n return ctx.toDImageData(0, 0, symbol.width, symbol.height);\n },\n\n _fillImage: function(ctx, imageData, symbol, contentType, image) {\n var size = L.EsriLeaflet.Tasks.Legend.DEFAULT_SIZE;\n var w = symbol.width || size;\n var h = symbol.height || size;\n if (imageData) {\n image = new Image();\n image.src = 'data:' + contentType + ';base64,' + imageData;\n }\n\n var pattern = ctx.createPattern(image, 'repeat');\n ctx.rect(0, 0, w, h);\n ctx.fillStyle = pattern;\n ctx.fill();\n\n if (symbol.outline) {\n ctx.strokeStyle = this._formatColor(symbol.outline.color);\n ctx.lineWidth = symbol.outline.width;\n ctx.fillStyle = this._formatColor([0, 0, 0, 0]);\n this._setDashArray(ctx, symbol.outline);\n ctx.rect(symbol.outline.width, symbol.outline.width,\n w - symbol.outline.width, h - symbol.outline.width);\n ctx.stroke();\n }\n },\n\n _drawImage: function(ctx, imageData, contentType) {\n var image = new Image();\n image.src = 'data:' + contentType + ';base64,' + imageData;\n ctx.drawImage(image, 0, 0);\n },\n\n _loadImage: function(url, callback, context) {\n var image = new Image();\n image.crossOrigin = '';\n image.onload = function() {\n callback.call(context, null, this);\n };\n image.onerror = function(e) {\n callback.call(context, {\n code: 500\n });\n };\n image.src = url + (url.indexOf('?') === -1 ? '?' : '&') +\n 'nc=' + (new Date()).getTime();\n }\n\n});\n","EsriLeaflet.Layers.DynamicMapLayer.include({\n\n legend: function(callback, context) {\n return this._service.legend(callback, context);\n }\n\n});\n","EsriLeaflet.Layers.FeatureLayer.include({\n\n legend: function(callback, context) {\n return this._service.legend(callback, context);\n }\n\n});\n","EsriLeaflet.Controls.Legend = L.Control.extend({\n\n options: {\n listTemplate: '',\n layerTemplate: '{layerName}',\n listRowTemplate: '{label}',\n emptyLabel: '',\n container: null\n },\n\n initialize: function(layers, options) {\n this._layers = L.Util.isArray(layers) ? layers : [layers];\n L.Control.prototype.initialize.call(this, options);\n },\n\n onAdd: function(map) {\n var container = this.options.container ||\n L.DomUtil.create('div', 'leaflet-legend-control leaflet-bar');\n L.DomEvent\n .disableScrollPropagation(container)\n .disableClickPropagation(container);\n\n if (this._layers.length) {\n this._load();\n }\n return container;\n },\n\n _load: function() {\n L.esri.Util.reduce(this._layers, {\n layers: []\n }, function(curr, layer, cb) {\n layer.legend(function(err, legend) {\n if (err) {\n return cb(err, curr);\n }\n curr.layers = curr.layers.concat(legend.layers);\n cb(null, curr);\n });\n }, this._onLoad, this);\n },\n\n _onLoad: function(error, legend) {\n if (!error) {\n var layersHtml = '';\n for (var i = 0, len = legend.layers.length; i < len; i++) {\n var layer = legend.layers[i];\n var legendsHtml = '';\n for (var j = 0, jj = layer.legend.length; j < jj; j++) {\n var layerLegend = JSON.parse(JSON.stringify(layer.legend[j]));\n this._validateLegendLabel(layerLegend);\n legendsHtml += L.Util.template(this.options.listRowTemplate, layerLegend);\n }\n layersHtml += L.Util.template(this.options.layerTemplate, {\n layerName: layer.layerName,\n legends: legendsHtml\n });\n }\n this._container.innerHTML = L.Util.template(this.options.listTemplate, {\n layers: layersHtml\n });\n }\n },\n\n _validateLegendLabel: function(layerLegend) {\n if (!layerLegend.label && this.options.emptyLabel) {\n layerLegend.label = this.options.emptyLabel;\n }\n layerLegend.label = layerLegend.label.replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(//g, '>');\n }\n\n});\n\nEsriLeaflet.Controls.legend = function(layers, options) {\n return new L.esri.Controls.Legend(layers, options);\n};\n"]}
\ No newline at end of file
+{"version":3,"sources":["../src/Util.js","../src/Services/MapService.js","../src/Services/FeatureLayer.js","../src/Tasks/Legend.js","../src/Tasks/Legend/SymbolLegend.js","../src/Tasks/Legend/SymbolRenderer.js","../src/Layers/DynamicMapLayer.js","../src/Layers/FeatureLayer/FeatureLayer.js","../src/Controls/Legend.js"],"names":["EsriLeaflet","Util","reduce","values","initial","fn","cb","context","next","index","sync","i","length","done","curr","err","val","call","MapService","include","legend","callback","Legend","this","run","FeatureLayerService","L","esri","Task","extend","path","params","f","_service","request","_request","initialize","endpoint","_renderer","SymbolRenderer","prototype","error","response","code","_collectLegendFromLayers","drawingInfo","_symbolsToLegends","result","layers","metadata","len","subLayerIds","push","_getLayersLegends","layerData","layerDefs","self","layer","_getLayerLegend","data","concat","id","_drawingInfoToLegend","layerId","layerType","type","layerName","name","maxScale","minScale","_getRendererSymbols","renderer","symbols","uniqueValueInfos","slice","classBreakInfos","symbol","label","description","value","defaultSymbol","defaultLabel","_renderSymbol","image","height","url","imageData","contentType","width","render","Class","statics","SYMBOL_TYPES","MARKER","LINE","FILL","PICTURE_MARKER","PICTURE_FILL","TEXT","DEFAULT_SIZE","canvas","Tasks","replace","document","createElement","ctx","getContext","_setSize","_renderMarker","_renderLine","_renderFill","_renderImageMarker","_renderImageFill","_renderText","toDataURL","size","lineWidth","outline","lineOffset","Math","max","style","_hatchCanvas","color","_setRotation","fillStyle","_formatColor","fillRect","Error","strokeStyle","_setDashArray","rect","stroke","beginPath","moveTo","lineTo","closePath","r","rx","ry","xoffset","yoffset","angle","arc","PI","fill","_fillImage","_loadImage","_drawImage","drawImage","rotate","parseFloat","dashArray","_formatDashArray","setLineDash","_drawCross","offset","w","h","join","dashValues","_getImageData","toDImageData","Image","src","pattern","createPattern","crossOrigin","onload","onerror","e","indexOf","Date","getTime","DynamicMapLayer","service","FeatureLayer","LegendControl","Control","options","listTemplate","layerTemplate","listRowTemplate","emptyLabel","container","_layers","isArray","onAdd","map","DomUtil","create","DomEvent","disableScrollPropagation","disableClickPropagation","_load","_onLoad","layersHtml","legendsHtml","j","jj","layerLegend","JSON","parse","stringify","_validateLegendLabel","template","legends","_container","innerHTML","legendControl"],"mappings":";;;;;;;;;;;;;;;;;AAkBAA,YAAYC,KAAKC,OAAS,SAASC,EAAQC,EAASC,EAAIC,EAAIC,GAG1D,QAASC,GAAKC,GAEZ,IAAK,GADDC,IAAO,EACFC,EAAIF,EAAOE,EAAIR,EAAOS,OAAQD,IAAK,CAC1C,GAAIE,IAAO,CAYX,IAXAR,EAAGS,EAAMX,EAAOQ,GAAI,SAASI,EAAKC,GAChC,MAAID,GACKT,EAAGW,KAAKV,EAASQ,EAAKD,IAE/BD,GAAO,EACPC,EAAOE,OACFN,GACHF,EAAKG,EAAI,OAGbD,EAAOG,GACFH,EACH,OAGJJ,EAAGW,KAAKV,EAAS,KAAMO,GArBzB,GAAIA,GAAOV,CAwBXI,GAAK,IC3CPR,YAAYkB,WAAWC,SAErBC,OAAQ,SAASC,EAAUd,GACzB,MAAO,IAAIP,aAAYsB,OAAOC,MAAMC,IAAIH,EAAUd,MCHtDP,YAAYyB,oBAAoBN,SAE9BC,OAAQ,SAASC,EAAUd,GACzB,MAAO,IAAImB,GAAEC,KAAKL,OAAOC,MAAMC,IAAIH,EAAUd,MCHjDP,YAAYsB,OAAStB,YAAY4B,KAAKC,QACpCC,KAAM,SAENC,QACEC,EAAG,QAGLR,IAAK,SAASH,EAAUd,GACtB,MAAIgB,MAAKU,SACAV,KAAKU,SAASC,QAAQX,KAAKO,KAAMP,KAAKQ,OAAQV,EAAUd,GAExDgB,KAAKY,SAAS,UAAWZ,KAAKO,KAAMP,KAAKQ,OAAQV,EAAUd,MAMxEP,YAAYoB,OAAS,SAASW,GAC5B,MAAO,IAAI/B,aAAYsB,OAAOS,IClBhC/B,YAAYsB,O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O4B,OAAOpC,OAAQD,EAAIuC,EAAKvC,IAAK,CAGxD,IAAK,GAFD8C,GAAQrC,EAAO4B,OAAOrC,GACtB0L,EAAc,GACTC,EAAI,EAAGC,EAAK9I,EAAMrC,OAAOR,OAAQ0L,EAAIC,EAAID,IAAK,CACrD,GAAIE,GAAcC,KAAKC,MAAMD,KAAKE,UAAUlJ,EAAMrC,OAAOkL,IACzD/K,MAAKqL,qBAAqBJ,GAC1BH,GAAe3K,EAAEzB,KAAK4M,SAAStL,KAAK4J,QAAQG,gBAAiBkB,GAE/DJ,GAAc1K,EAAEzB,KAAK4M,SAAStL,KAAK4J,QAAQE,eACzCnH,UAAWT,EAAMS,UACjB4I,QAAST,IAGb9K,KAAKwL,WAAWC,UAAYtL,EAAEzB,KAAK4M,SAAStL,KAAK4J,QAAQC,cACvDpI,OAAQoJ,MAKdQ,qBAAsB,SAASJ,IACxBA,EAAY3H,OAAStD,KAAK4J,QAAQI,aACrCiB,EAAY3H,MAAQtD,KAAK4J,QAAQI,YAEnCiB,EAAY3H,MAAQ2H,EAAY3H,MAAMyB,QAAQ,KAAM,SACjDA,QAAQ,KAAM,UACdA,QAAQ,KAAM,SACdA,QAAQ,KAAM,QACdA,QAAQ,KAAM,WAKrBtG,YAAYiN,cAAgB,SAASjK,EAAQmI,GAC3C,MAAO,IAAIzJ,GAAEC,KAAKsJ,cAAcjI,EAAQmI","file":"esri-leaflet-legend-compat.js","sourcesContent":["/**\n * @example\n * \n * L.esri.Util.queue(\n * [1, 2, 3], [], function(curr, item, cb){\n * setTimeout(function(){\n * cb(null, curr.concat([item + 10]));\n * }, 200);\n * }, function(err, result) {\n * console.log(result); // [11, 12, 13]\n * });\n *
\n * @param {Array.<*>} values\n * @param {*} initial\n * @param {Function} fn process item fn(memo, item, callback)\n * @param {Function} done queue complete\n * @param {*=} context\n */\nEsriLeaflet.Util.reduce = function(values, initial, fn, cb, context) {\n var curr = initial;\n\n function next(index) {\n var sync = true;\n for (var i = index; i < values.length; i++) {\n var done = false;\n fn(curr, values[i], function(err, val) {\n if (err) {\n return cb.call(context, err, curr);\n }\n done = true;\n curr = val;\n if (!sync) {\n next(i + 1);\n }\n });\n sync = done;\n if (!sync) {\n return;\n }\n }\n cb.call(context, null, curr);\n }\n\n next(0);\n};\n","EsriLeaflet.MapService.include({\n\n legend: function(callback, context) {\n return new EsriLeaflet.Legend(this).run(callback, context);\n }\n\n});\n","EsriLeaflet.FeatureLayerService.include({\n\n legend: function(callback, context) {\n return new L.esri.Legend(this).run(callback, context);\n }\n\n});\n","EsriLeaflet.Legend = EsriLeaflet.Task.extend({\n path: 'legend',\n\n params: {\n f: 'json'\n },\n\n run: function(callback, context) {\n if (this._service) {\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n }\n\n});\n\nEsriLeaflet.legend = function(params) {\n return new EsriLeaflet.Legend(params);\n};\n","EsriLeaflet.Legend.include({\n\n initialize: function(endpoint) {\n this._renderer = new EsriLeaflet.Legend.SymbolRenderer();\n EsriLeaflet.Task.prototype.initialize.call(this, endpoint);\n },\n\n run: function(callback, context) {\n function cb(error, response) {\n if (error && error.code === 400) { // ArcGIS server >=10.0\n this._collectLegendFromLayers(callback, context);\n } else if (response && response.drawingInfo) {\n this._symbolsToLegends([response], function(err, result) {\n callback.call(context, err, {\n layers: result\n });\n });\n } else {\n callback.call(context, error, response);\n }\n }\n\n if (this._service) {\n return this._service.request(this.path, this.params, cb, this);\n } else {\n return this._request('request', this.path, this.params, cb, this);\n }\n },\n\n _collectLegendFromLayers: function(callback, context) {\n this._service.metadata(function(error, response) {\n if (error) {\n return callback.call(context, error);\n }\n\n var layers = [];\n for (var i = 0, len = response.layers.length; i < len; i++) {\n if (!response.layers[i].subLayerIds) {\n layers.push(response.layers[i]);\n }\n }\n\n this._getLayersLegends(layers, function(err, layerData) {\n if (err) {\n callback.call(context, err);\n } else {\n this._symbolsToLegends(layerData, function(err, result) {\n callback.call(context, err, {\n layers: result\n });\n });\n }\n }, this);\n }, this);\n },\n\n _getLayersLegends: function(layerDefs, callback, context) {\n var layerData = [];\n var self = this;\n\n EsriLeaflet.Util.reduce(layerDefs, [], function(curr, layer, cb) {\n self._getLayerLegend(layer, function(err, data) {\n if (err) {\n return cb(err, null);\n }\n cb(null, curr.concat(data));\n }, self);\n }, function(err, result) {\n callback.call(context, err, result);\n });\n },\n\n _getLayerLegend: function(layer, callback, context) {\n this._service.request(layer.id, {\n f: 'json'\n }, callback, context);\n },\n\n _symbolsToLegends: function(layerData, callback, context) {\n var self = this;\n EsriLeaflet.Util.reduce(layerData, [], function(curr, layer, cb) {\n self._drawingInfoToLegend(layer.drawingInfo, function(err, legend) {\n if (err) {\n return cb(err, null);\n }\n cb(null, curr.concat([{\n layerId: layer.id,\n layerType: layer.type,\n layerName: layer.name,\n maxScale: layer.maxScale,\n minScale: layer.minScale,\n legend: legend\n }]));\n }, self);\n }, function(err, result) {\n callback.call(context, err, result);\n });\n },\n\n _getRendererSymbols: function(renderer) {\n var symbols;\n if (renderer.type === 'uniqueValue') {\n symbols = renderer.uniqueValueInfos.slice();\n } else if (renderer.type === 'classBreaks') {\n symbols = renderer.classBreakInfos.slice();\n } else if (renderer.type === 'simple') {\n symbols = [{\n symbol: renderer.symbol,\n label: renderer.label,\n description: renderer.description,\n value: renderer.value\n }];\n }\n if (renderer.defaultSymbol) {\n symbols.push({\n symbol: renderer.defaultSymbol,\n label: renderer.defaultLabel,\n description: '',\n value: null\n });\n }\n return symbols;\n },\n\n _drawingInfoToLegend: function(drawingInfo, callback, context) {\n var self = this;\n EsriLeaflet.Util.reduce(\n this._getRendererSymbols(drawingInfo.renderer), [],\n function(curr, symbol, cb) {\n self._renderSymbol(symbol, function(err, image) {\n if (err) {\n return cb(err, curr);\n }\n cb(null, curr.concat([{\n label: symbol.label,\n height: image.height,\n url: symbol.symbol.url,\n imageData: image.imageData,\n contentType: image.contentType,\n width: image.width,\n values: [symbol.value || '']\n }]));\n }, self);\n },\n function(err, legend) {\n callback.call(context, err, legend);\n });\n },\n\n _renderSymbol: function(symbol, callback, context) {\n return this._renderer.render(symbol.symbol, callback, context);\n }\n\n});\n","EsriLeaflet.Legend.SymbolRenderer = L.Class.extend({\n\n statics: {\n SYMBOL_TYPES: {\n MARKER: 'esriSMS',\n LINE: 'esriSLS',\n FILL: 'esriSFS',\n PICTURE_MARKER: 'esriPMS',\n PICTURE_FILL: 'esriPFS',\n TEXT: 'esriTS'\n },\n DEFAULT_SIZE: 20\n },\n\n render: function(symbol, callback, context) {\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n var imageData = symbol.imageData;\n this._setSize(canvas, symbol);\n\n function done(error, imageData) {\n if (error) {\n callback.call(context, error);\n } else {\n callback.call(context, null, {\n width: canvas.width || EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE,\n height: canvas.height || EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE,\n imageData: imageData.replace('data:image/png;base64,', ''),\n url: null,\n contentType: 'image/png'\n });\n }\n }\n\n if (symbol.imageData) {\n return done(null, symbol.imageData);\n }\n\n switch (symbol.type) {\n case 'esriSMS':\n this._renderMarker(ctx, symbol, done);\n break;\n case 'esriSLS':\n this._renderLine(ctx, symbol, done);\n break;\n case 'esriSFS':\n this._renderFill(ctx, symbol, done);\n break;\n case 'esriPMS':\n this._renderImageMarker(ctx, symbol, done);\n break;\n case 'esriPFS':\n this._renderImageFill(ctx, symbol, done);\n break;\n case 'esriST':\n this._renderText(ctx, symbol, done);\n break;\n default:\n break;\n }\n },\n\n _renderText: function(ctx, symbol, callback) {\n callback(null, ctx.canvas.toDataURL());\n },\n\n _renderFill: function(ctx, symbol, callback) {\n var size = EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE;\n var lineWidth = symbol.outline ? symbol.outline.width : 1;\n var lineOffset = Math.max(5, lineWidth * 3);\n switch (symbol.style) {\n\n case 'esriSFSVertical':\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSHorizontal':\n this._setRotation(ctx, 90);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSBackwardDiagonal':\n this._setRotation(ctx, -45);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSForwardDiagonal':\n this._setRotation(ctx, 45);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSCross':\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n this._setRotation(ctx, 90);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSDiagonalCross':\n this._setRotation(ctx, 45);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n this._setRotation(ctx, 45);\n this._hatchCanvas(ctx, size, symbol.color, lineWidth, lineOffset);\n break;\n\n case 'esriSFSSolid':\n ctx.fillStyle = this._formatColor(symbol.color);\n ctx.fillRect(0, 0, size, size);\n break;\n\n case 'esriSFSNull':\n break;\n\n default:\n throw new Error('Unknown SFS style: ' + symbol.style);\n }\n\n if (symbol.outline) {\n ctx.strokeStyle = this._formatColor(symbol.outline.color);\n ctx.lineWidth = symbol.outline.width;\n ctx.fillStyle = this._formatColor([0, 0, 0, 0]);\n this._setDashArray(ctx, symbol.outline);\n ctx.rect(symbol.outline.width, symbol.outline.width,\n size - symbol.outline.width, size - symbol.outline.width);\n ctx.stroke();\n }\n\n callback(null, ctx.canvas.toDataURL());\n },\n\n _renderLine: function(ctx, symbol, callback) {\n var size = EsriLeaflet.Legend.SymbolRenderer.DEFAULT_SIZE;\n ctx.beginPath();\n ctx.lineWidth = symbol.width;\n ctx.strokeStyle = this._formatColor(symbol.color);\n this._setDashArray(ctx, symbol); //\n\n ctx.moveTo(0, size / 2);\n ctx.lineTo(size, size / 2);\n\n ctx.closePath();\n ctx.stroke();\n callback(null, ctx.canvas.toDataURL());\n },\n\n _renderMarker: function(ctx, symbol, callback) {\n var xoffset = 0;\n var yoffset = 0;\n var size = symbol.size;\n var r, rx, ry;\n\n ctx.beginPath();\n\n if (symbol.outline) {\n ctx.strokeStyle = this._formatColor(symbol.outline.color);\n ctx.lineWidth = symbol.outline.width;\n xoffset += symbol.outline.width;\n yoffset += symbol.outline.width;\n }\n\n this._setRotation(ctx, symbol.angle);\n\n switch (symbol.style) {\n case 'esriSMSCircle':\n ctx.fillStyle = this._formatColor(symbol.color);\n r = (size - 2 * xoffset) / 2;\n ctx.arc(r + xoffset, r + xoffset, r, 0, 2 * Math.PI, false);\n ctx.fill();\n break;\n\n case 'esriSMSX':\n ctx.moveTo(xoffset, yoffset);\n ctx.lineTo(size - xoffset, size - yoffset);\n ctx.moveTo(size - xoffset, yoffset);\n ctx.lineTo(xoffset, size - yoffset);\n break;\n\n case 'esriSMSCross':\n ctx.moveTo(xoffset, size / 2);\n ctx.lineTo(size - xoffset, size / 2);\n ctx.moveTo(size / 2, yoffset);\n ctx.lineTo(size / 2, size - yoffset);\n break;\n\n case 'esriSMSDiamond':\n ctx.fillStyle = this._formatColor(symbol.color);\n rx = (size - 2 * xoffset) / 2;\n ry = (size - 2 * yoffset) / 2;\n\n ctx.moveTo(xoffset, yoffset + ry);\n ctx.lineTo(xoffset + rx, yoffset);\n ctx.lineTo(xoffset + rx * 2, yoffset + ry);\n ctx.lineTo(xoffset + rx, yoffset + 2 * ry);\n ctx.lineTo(xoffset, yoffset + ry);\n ctx.fill();\n break;\n\n case 'esriSMSSquare':\n ctx.rect(xoffset, yoffset, size - 2 * xoffset, size - 2 * yoffset);\n break;\n\n case 'esriSMSTriangle':\n ctx.fillStyle = this._formatColor(symbol.color);\n rx = (size - 2 * xoffset) / 2;\n ry = (size - 2 * yoffset) / 2;\n ctx.moveTo(xoffset, yoffset + ry * 2);\n ctx.lineTo(xoffset + rx, yoffset);\n ctx.lineTo(xoffset + rx * 2, yoffset + ry * 2);\n ctx.lineTo(xoffset, yoffset + ry * 2);\n ctx.fill();\n break;\n\n default:\n throw new Error('Unknown esriSMS style: ' + symbol.style);\n }\n\n ctx.closePath();\n if (symbol.outline) {\n ctx.stroke();\n }\n callback(null, ctx.canvas.toDataURL());\n },\n\n _renderImageFill: function(ctx, symbol, callback) {\n this._setRotation(ctx, symbol.angle);\n if (symbol.imageData) {\n this._fillImage(ctx, symbol.imageData, symbol, symbol.contentType);\n callback(null, ctx.toDataURL());\n } else {\n this._loadImage(symbol.url, function(err, image) {\n this._fillImage(ctx, null, symbol, symbol.contentType, image);\n callback(null, ctx.canvas.toDataURL());\n }, this);\n }\n },\n\n _renderImageMarker: function(ctx, symbol, callback) {\n this._setRotation(ctx, symbol.angle);\n if (symbol.imageData) {\n this._drawImage(ctx, symbol.imageData, symbol.contentType);\n callback(null, ctx.toDataURL());\n } else {\n this._loadImage(symbol.url, function(err, image) {\n ctx.drawImage(image, 0, 0);\n callback(null, ctx.canvas.toDataURL());\n }, this);\n }\n },\n\n _setSize: function(ctx, symbol) {\n if (symbol.size) {\n ctx.width = ctx.height = symbol.size;\n } else if (symbol.type === 'esriSLS' ||\n symbol.type === 'esriSFS') {\n ctx.width = ctx.height = EsriLeaflet.Legend.SymbolRenderer.DEFAULT_SIZE;\n } else {\n ctx.width = symbol.width;\n ctx.height = symbol.height;\n }\n },\n\n _setRotation: function(ctx, angle) {\n ctx.rotate(-parseFloat(angle) * Math.PI / 180);\n },\n\n _setDashArray: function(ctx, symbol) {\n var dashArray = this._formatDashArray(symbol);\n if (dashArray.length) {\n ctx.setLineDash(dashArray);\n }\n },\n\n _drawCross: function(ctx, xoffset, yoffset, size) {\n ctx.moveTo(xoffset, yoffset);\n ctx.lineTo(size - xoffset, size - yoffset);\n ctx.moveTo(size - xoffset, yoffset);\n ctx.lineTo(xoffset, size - yoffset);\n },\n\n _hatchCanvas: function(ctx, size, color, width, offset) {\n var w = size * 2;\n var h = size * 2;\n\n for (var i = -w; i < w; i += offset) {\n ctx.moveTo(i, -h);\n ctx.lineTo(i, h);\n }\n\n ctx.lineWidth = width;\n ctx.strokeStyle = this._formatColor(color);\n ctx.stroke();\n },\n\n _formatColor: function(color) {\n return 'rgba(' + color.slice(0, 3).join(',') + ',' + color[3] / 255 + ')';\n },\n\n _formatDashArray: function(symbol) {\n var dashValues = [];\n\n switch (symbol.style) {\n case 'esriSLSDash':\n dashValues = [4, 3];\n break;\n case 'esriSLSDot':\n dashValues = [1, 3];\n break;\n case 'esriSLSDashDot':\n dashValues = [8, 3, 1, 3];\n break;\n case 'esriSLSDashDotDot':\n dashValues = [8, 3, 1, 3, 1, 3];\n break;\n }\n\n //use the dash values and the line weight to set dash array\n if (dashValues.length > 0) {\n for (var i = 0, len = dashValues.length; i < len; i++) {\n dashValues[i] *= symbol.width;\n }\n }\n\n return dashValues;\n },\n\n _getImageData: function(ctx, symbol) {\n return ctx.toDImageData(0, 0, symbol.width, symbol.height);\n },\n\n _fillImage: function(ctx, imageData, symbol, contentType, image) {\n var size = L.esri.Legend.DEFAULT_SIZE;\n var w = symbol.width || size;\n var h = symbol.height || size;\n if (imageData) {\n image = new Image();\n image.src = 'data:' + contentType + ';base64,' + imageData;\n }\n\n var pattern = ctx.createPattern(image, 'repeat');\n ctx.rect(0, 0, w, h);\n ctx.fillStyle = pattern;\n ctx.fill();\n\n if (symbol.outline) {\n ctx.strokeStyle = this._formatColor(symbol.outline.color);\n ctx.lineWidth = symbol.outline.width;\n ctx.fillStyle = this._formatColor([0, 0, 0, 0]);\n this._setDashArray(ctx, symbol.outline);\n ctx.rect(symbol.outline.width, symbol.outline.width,\n w - symbol.outline.width, h - symbol.outline.width);\n ctx.stroke();\n }\n },\n\n _drawImage: function(ctx, imageData, contentType) {\n var image = new Image();\n image.src = 'data:' + contentType + ';base64,' + imageData;\n ctx.drawImage(image, 0, 0);\n },\n\n _loadImage: function(url, callback, context) {\n var image = new Image();\n image.crossOrigin = '';\n image.onload = function() {\n callback.call(context, null, this);\n };\n image.onerror = function(e) {\n callback.call(context, {\n code: 500\n });\n };\n image.src = url + (url.indexOf('?') === -1 ? '?' : '&') +\n 'nc=' + (new Date()).getTime();\n }\n\n});\n","EsriLeaflet.DynamicMapLayer.include({\n\n legend: function(callback, context) {\n return this.service.legend(callback, context);\n }\n\n});\n","EsriLeaflet.FeatureLayer.include({\n\n legend: function(callback, context) {\n return this.service.legend(callback, context);\n }\n\n});\n","EsriLeaflet.LegendControl = L.Control.extend({\n\n options: {\n listTemplate: '',\n layerTemplate: '{layerName}',\n listRowTemplate: '{label}',\n emptyLabel: '',\n container: null\n },\n\n initialize: function(layers, options) {\n this._layers = L.Util.isArray(layers) ? layers : [layers];\n L.Control.prototype.initialize.call(this, options);\n },\n\n onAdd: function(map) {\n var container = this.options.container ||\n L.DomUtil.create('div', 'leaflet-legend-control leaflet-bar');\n L.DomEvent\n .disableScrollPropagation(container)\n .disableClickPropagation(container);\n\n if (this._layers.length) {\n this._load();\n }\n return container;\n },\n\n _load: function() {\n L.esri.Util.reduce(this._layers, {\n layers: []\n }, function(curr, layer, cb) {\n layer.legend(function(err, legend) {\n if (err) {\n return cb(err, curr);\n }\n curr.layers = curr.layers.concat(legend.layers);\n cb(null, curr);\n });\n }, this._onLoad, this);\n },\n\n _onLoad: function(error, legend) {\n if (!error) {\n var layersHtml = '';\n for (var i = 0, len = legend.layers.length; i < len; i++) {\n var layer = legend.layers[i];\n var legendsHtml = '';\n for (var j = 0, jj = layer.legend.length; j < jj; j++) {\n var layerLegend = JSON.parse(JSON.stringify(layer.legend[j]));\n this._validateLegendLabel(layerLegend);\n legendsHtml += L.Util.template(this.options.listRowTemplate, layerLegend);\n }\n layersHtml += L.Util.template(this.options.layerTemplate, {\n layerName: layer.layerName,\n legends: legendsHtml\n });\n }\n this._container.innerHTML = L.Util.template(this.options.listTemplate, {\n layers: layersHtml\n });\n }\n },\n\n _validateLegendLabel: function(layerLegend) {\n if (!layerLegend.label && this.options.emptyLabel) {\n layerLegend.label = this.options.emptyLabel;\n }\n layerLegend.label = layerLegend.label.replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(//g, '>');\n }\n\n});\n\nEsriLeaflet.legendControl = function(layers, options) {\n return new L.esri.LegendControl(layers, options);\n};\n"]}
\ No newline at end of file
diff --git a/dist/esri-leaflet-legend-src.js b/dist/esri-leaflet-legend-src.js
index 1325c0d..2f0f5fb 100644
--- a/dist/esri-leaflet-legend-src.js
+++ b/dist/esri-leaflet-legend-src.js
@@ -61,16 +61,16 @@ EsriLeaflet.Util.reduce = function(values, initial, fn, cb, context) {
};
-EsriLeaflet.Services.MapService.include({
+EsriLeaflet.MapService.include({
legend: function(callback, context) {
- return new EsriLeaflet.Tasks.Legend(this).run(callback, context);
+ return new EsriLeaflet.Legend(this).run(callback, context);
}
});
-EsriLeaflet.Tasks.Legend = EsriLeaflet.Tasks.Task.extend({
+EsriLeaflet.Legend = EsriLeaflet.Task.extend({
path: 'legend',
params: {
@@ -87,21 +87,21 @@ EsriLeaflet.Tasks.Legend = EsriLeaflet.Tasks.Task.extend({
});
-EsriLeaflet.Tasks.legend = function(params) {
- return new EsriLeaflet.Tasks.Legend(params);
+EsriLeaflet.legend = function(params) {
+ return new EsriLeaflet.Legend(params);
};
-EsriLeaflet.Layers.DynamicMapLayer.include({
+EsriLeaflet.DynamicMapLayer.include({
legend: function(callback, context) {
- return this._service.legend(callback, context);
+ return this.service.legend(callback, context);
}
});
-EsriLeaflet.Controls.Legend = L.Control.extend({
+EsriLeaflet.LegendControl = L.Control.extend({
options: {
listTemplate: '',
@@ -178,8 +178,8 @@ EsriLeaflet.Controls.Legend = L.Control.extend({
});
-EsriLeaflet.Controls.legend = function(layers, options) {
- return new L.esri.Controls.Legend(layers, options);
+EsriLeaflet.legendControl = function(layers, options) {
+ return new L.esri.LegendControl(layers, options);
};
diff --git a/dist/esri-leaflet-legend-src.js.map b/dist/esri-leaflet-legend-src.js.map
index 3d4fe26..c9c0eeb 100644
--- a/dist/esri-leaflet-legend-src.js.map
+++ b/dist/esri-leaflet-legend-src.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../src/Util.js","../src/Services/MapService.js","../src/Tasks/Legend.js","../src/Layers/DynamicMapLayer.js","../src/Controls/Legend.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,GAAG;AACH,CAAC,CAAC,CAAC,CAAC,OAAO;AACX,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACT,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;AACrB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE;AAC7C,CAAC,CAAC,KAAK,UAAU,CAAC,QAAQ,GAAG;AAC7B,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI;AAC5C,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE;AACf,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAC3C,CAAC,CAAC,CAAC,GAAG;AACN,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;AACV,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,CAAC,MAAM;AAC7B,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,SAAS,OAAO;AAC9B,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,OAAO,CAAC,IAA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C,CAAC,CAAC;AAC/C,IAAI,EAAE,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;AACxD,MAAM,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;AAClD,IAAI,CAAC;AACL,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG;AAChE,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG;AAC9B,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG;AAC7B,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG;AAC5B,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI;AAC7B,EAAE,CAAC;AACH;AACA,GAAG;AACH;AACA,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACzD,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;AACrD,EAAE","file":"esri-leaflet-legend-src.js","sourcesContent":["/**\n * @example\n * \n * L.esri.Util.queue(\n * [1, 2, 3], [], function(curr, item, cb){\n * setTimeout(function(){\n * cb(null, curr.concat([item + 10]));\n * }, 200);\n * }, function(err, result) {\n * console.log(result); // [11, 12, 13]\n * });\n *
\n * @param {Array.<*>} values\n * @param {*} initial\n * @param {Function} fn process item fn(memo, item, callback)\n * @param {Function} done queue complete\n * @param {*=} context\n */\nEsriLeaflet.Util.reduce = function(values, initial, fn, cb, context) {\n var curr = initial;\n\n function next(index) {\n var sync = true;\n for (var i = index; i < values.length; i++) {\n var done = false;\n fn(curr, values[i], function(err, val) {\n if (err) {\n return cb.call(context, err, curr);\n }\n done = true;\n curr = val;\n if (!sync) {\n next(i + 1);\n }\n });\n sync = done;\n if (!sync) {\n return;\n }\n }\n cb.call(context, null, curr);\n }\n\n next(0);\n};\n","EsriLeaflet.Services.MapService.include({\n\n legend: function(callback, context) {\n return new EsriLeaflet.Tasks.Legend(this).run(callback, context);\n }\n\n});\n","EsriLeaflet.Tasks.Legend = EsriLeaflet.Tasks.Task.extend({\n path: 'legend',\n\n params: {\n f: 'json'\n },\n\n run: function(callback, context) {\n if (this._service) {\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n }\n\n});\n\nEsriLeaflet.Tasks.legend = function(params) {\n return new EsriLeaflet.Tasks.Legend(params);\n};\n","EsriLeaflet.Layers.DynamicMapLayer.include({\n\n legend: function(callback, context) {\n return this._service.legend(callback, context);\n }\n\n});\n","EsriLeaflet.Controls.Legend = L.Control.extend({\n\n options: {\n listTemplate: '',\n layerTemplate: '{layerName}',\n listRowTemplate: '{label}',\n emptyLabel: '',\n container: null\n },\n\n initialize: function(layers, options) {\n this._layers = L.Util.isArray(layers) ? layers : [layers];\n L.Control.prototype.initialize.call(this, options);\n },\n\n onAdd: function(map) {\n var container = this.options.container ||\n L.DomUtil.create('div', 'leaflet-legend-control leaflet-bar');\n L.DomEvent\n .disableScrollPropagation(container)\n .disableClickPropagation(container);\n\n if (this._layers.length) {\n this._load();\n }\n return container;\n },\n\n _load: function() {\n L.esri.Util.reduce(this._layers, {\n layers: []\n }, function(curr, layer, cb) {\n layer.legend(function(err, legend) {\n if (err) {\n return cb(err, curr);\n }\n curr.layers = curr.layers.concat(legend.layers);\n cb(null, curr);\n });\n }, this._onLoad, this);\n },\n\n _onLoad: function(error, legend) {\n if (!error) {\n var layersHtml = '';\n for (var i = 0, len = legend.layers.length; i < len; i++) {\n var layer = legend.layers[i];\n var legendsHtml = '';\n for (var j = 0, jj = layer.legend.length; j < jj; j++) {\n var layerLegend = JSON.parse(JSON.stringify(layer.legend[j]));\n this._validateLegendLabel(layerLegend);\n legendsHtml += L.Util.template(this.options.listRowTemplate, layerLegend);\n }\n layersHtml += L.Util.template(this.options.layerTemplate, {\n layerName: layer.layerName,\n legends: legendsHtml\n });\n }\n this._container.innerHTML = L.Util.template(this.options.listTemplate, {\n layers: layersHtml\n });\n }\n },\n\n _validateLegendLabel: function(layerLegend) {\n if (!layerLegend.label && this.options.emptyLabel) {\n layerLegend.label = this.options.emptyLabel;\n }\n layerLegend.label = layerLegend.label.replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(//g, '>');\n }\n\n});\n\nEsriLeaflet.Controls.legend = function(layers, options) {\n return new L.esri.Controls.Legend(layers, options);\n};\n"]}
\ No newline at end of file
+{"version":3,"sources":["../src/Util.js","../src/Services/MapService.js","../src/Tasks/Legend.js","../src/Layers/DynamicMapLayer.js","../src/Controls/Legend.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,GAAG;AACH,CAAC,CAAC,CAAC,CAAC,OAAO;AACX,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACT,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;AACrB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE;AAC7C,CAAC,CAAC,KAAK,UAAU,CAAC,QAAQ,GAAG;AAC7B,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI;AAC5C,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE;AACf,CAAC,CAAC,GAAG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AM,CAAC,CAAC,OAAO,EAAE;AACnD,EAAE","file":"esri-leaflet-legend-src.js","sourcesContent":["/**\n * @example\n * \n * L.esri.Util.queue(\n * [1, 2, 3], [], function(curr, item, cb){\n * setTimeout(function(){\n * cb(null, curr.concat([item + 10]));\n * }, 200);\n * }, function(err, result) {\n * console.log(result); // [11, 12, 13]\n * });\n *
\n * @param {Array.<*>} values\n * @param {*} initial\n * @param {Function} fn process item fn(memo, item, callback)\n * @param {Function} done queue complete\n * @param {*=} context\n */\nEsriLeaflet.Util.reduce = function(values, initial, fn, cb, context) {\n var curr = initial;\n\n function next(index) {\n var sync = true;\n for (var i = index; i < values.length; i++) {\n var done = false;\n fn(curr, values[i], function(err, val) {\n if (err) {\n return cb.call(context, err, curr);\n }\n done = true;\n curr = val;\n if (!sync) {\n next(i + 1);\n }\n });\n sync = done;\n if (!sync) {\n return;\n }\n }\n cb.call(context, null, curr);\n }\n\n next(0);\n};\n","EsriLeaflet.MapService.include({\n\n legend: function(callback, context) {\n return new EsriLeaflet.Legend(this).run(callback, context);\n }\n\n});\n","EsriLeaflet.Legend = EsriLeaflet.Task.extend({\n path: 'legend',\n\n params: {\n f: 'json'\n },\n\n run: function(callback, context) {\n if (this._service) {\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n }\n\n});\n\nEsriLeaflet.legend = function(params) {\n return new EsriLeaflet.Legend(params);\n};\n","EsriLeaflet.DynamicMapLayer.include({\n\n legend: function(callback, context) {\n return this.service.legend(callback, context);\n }\n\n});\n","EsriLeaflet.LegendControl = L.Control.extend({\n\n options: {\n listTemplate: '',\n layerTemplate: '{layerName}',\n listRowTemplate: '{label}',\n emptyLabel: '',\n container: null\n },\n\n initialize: function(layers, options) {\n this._layers = L.Util.isArray(layers) ? layers : [layers];\n L.Control.prototype.initialize.call(this, options);\n },\n\n onAdd: function(map) {\n var container = this.options.container ||\n L.DomUtil.create('div', 'leaflet-legend-control leaflet-bar');\n L.DomEvent\n .disableScrollPropagation(container)\n .disableClickPropagation(container);\n\n if (this._layers.length) {\n this._load();\n }\n return container;\n },\n\n _load: function() {\n L.esri.Util.reduce(this._layers, {\n layers: []\n }, function(curr, layer, cb) {\n layer.legend(function(err, legend) {\n if (err) {\n return cb(err, curr);\n }\n curr.layers = curr.layers.concat(legend.layers);\n cb(null, curr);\n });\n }, this._onLoad, this);\n },\n\n _onLoad: function(error, legend) {\n if (!error) {\n var layersHtml = '';\n for (var i = 0, len = legend.layers.length; i < len; i++) {\n var layer = legend.layers[i];\n var legendsHtml = '';\n for (var j = 0, jj = layer.legend.length; j < jj; j++) {\n var layerLegend = JSON.parse(JSON.stringify(layer.legend[j]));\n this._validateLegendLabel(layerLegend);\n legendsHtml += L.Util.template(this.options.listRowTemplate, layerLegend);\n }\n layersHtml += L.Util.template(this.options.layerTemplate, {\n layerName: layer.layerName,\n legends: legendsHtml\n });\n }\n this._container.innerHTML = L.Util.template(this.options.listTemplate, {\n layers: layersHtml\n });\n }\n },\n\n _validateLegendLabel: function(layerLegend) {\n if (!layerLegend.label && this.options.emptyLabel) {\n layerLegend.label = this.options.emptyLabel;\n }\n layerLegend.label = layerLegend.label.replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(//g, '>');\n }\n\n});\n\nEsriLeaflet.legendControl = function(layers, options) {\n return new L.esri.LegendControl(layers, options);\n};\n"]}
\ No newline at end of file
diff --git a/dist/esri-leaflet-legend.js b/dist/esri-leaflet-legend.js
index 942dcc7..0e1fe22 100644
--- a/dist/esri-leaflet-legend.js
+++ b/dist/esri-leaflet-legend.js
@@ -15,25 +15,7 @@
}(function (L, EsriLeaflet) {
-/**
- * @example
- *
- * L.esri.Util.queue(
- * [1, 2, 3], [], function(curr, item, cb){
- * setTimeout(function(){
- * cb(null, curr.concat([item + 10]));
- * }, 200);
- * }, function(err, result) {
- * console.log(result); // [11, 12, 13]
- * });
- *
- * @param {Array.<*>} values
- * @param {*} initial
- * @param {Function} fn process item fn(memo, item, callback)
- * @param {Function} done queue complete
- * @param {*=} context
- */
-EsriLeaflet.Util.reduce=function(a,b,c,d,e){function f(b){for(var h=!0,i=b;i{layers}",layerTemplate:"{layerName}",listRowTemplate:'{label}',emptyLabel:"",container:null},initialize:function(a,b){this._layers=L.Util.isArray(a)?a:[a],L.Control.prototype.initialize.call(this,b)},onAdd:function(a){var b=this.options.container||L.DomUtil.create("div","leaflet-legend-control leaflet-bar");return L.DomEvent.disableScrollPropagation(b).disableClickPropagation(b),this._layers.length&&this._load(),b},_load:function(){L.esri.Util.reduce(this._layers,{layers:[]},function(a,b,c){b.legend(function(b,d){return b?c(b,a):(a.layers=a.layers.concat(d.layers),void c(null,a))})},this._onLoad,this)},_onLoad:function(a,b){if(!a){for(var c="",d=0,e=b.layers.length;d/g,">")}}),EsriLeaflet.Controls.legend=function(a,b){return new L.esri.Controls.Legend(a,b)};
+EsriLeaflet.Util.reduce=function(a,b,c,d,e){function f(b){for(var h=!0,i=b;i{layers}",layerTemplate:"{layerName}",listRowTemplate:'{label}',emptyLabel:"",container:null},initialize:function(a,b){this._layers=L.Util.isArray(a)?a:[a],L.Control.prototype.initialize.call(this,b)},onAdd:function(a){var b=this.options.container||L.DomUtil.create("div","leaflet-legend-control leaflet-bar");return L.DomEvent.disableScrollPropagation(b).disableClickPropagation(b),this._layers.length&&this._load(),b},_load:function(){L.esri.Util.reduce(this._layers,{layers:[]},function(a,b,c){b.legend(function(b,d){return b?c(b,a):(a.layers=a.layers.concat(d.layers),void c(null,a))})},this._onLoad,this)},_onLoad:function(a,b){if(!a){for(var c="",d=0,e=b.layers.length;d/g,">")}}),EsriLeaflet.legendControl=function(a,b){return new L.esri.LegendControl(a,b)};
//# sourceMappingURL=esri-leaflet-legend.js.map
return EsriLeaflet;
diff --git a/dist/esri-leaflet-legend.js.map b/dist/esri-leaflet-legend.js.map
index 7c1eafd..4e05e91 100644
--- a/dist/esri-leaflet-legend.js.map
+++ b/dist/esri-leaflet-legend.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../src/Util.js","../src/Services/MapService.js","../src/Tasks/Legend.js","../src/Layers/DynamicMapLayer.js","../src/Controls/Legend.js"],"names":["EsriLeaflet","Util","reduce","values","initial","fn","cb","context","next","index","sync","i","length","done","curr","err","val","call","Services","MapService","include","legend","callback","Tasks","Legend","this","run","Task","extend","path","params","f","_service","request","_request","Layers","DynamicMapLayer","Controls","L","Control","options","listTemplate","layerTemplate","listRowTemplate","emptyLabel","container","initialize","layers","_layers","isArray","prototype","onAdd","map","DomUtil","create","DomEvent","disableScrollPropagation","disableClickPropagation","_load","esri","layer","concat","_onLoad","error","layersHtml","len","legendsHtml","j","jj","layerLegend","JSON","parse","stringify","_validateLegendLabel","template","layerName","legends","_container","innerHTML","label","replace"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBAA,YAAYC,KAAKC,OAAS,SAASC,EAAQC,EAASC,EAAIC,EAAIC,GAG1D,QAASC,GAAKC,GAEZ,IAAK,GADDC,IAAO,EACFC,EAAIF,EAAOE,EAAIR,EAAOS,OAAQD,IAAK,CAC1C,GAAIE,IAAO,CAYX,IAXAR,EAAGS,EAAMX,EAAOQ,GAAI,SAASI,EAAKC,GAChC,MAAID,GACKT,EAAGW,KAAKV,EAASQ,EAAKD,IAE/BD,GAAO,EACPC,EAAOE,OACFN,GACHF,EAAKG,EAAI,OAGbD,EAAOG,GACFH,EACH,OAGJJ,EAAGW,KAAKV,EAAS,KAAMO,GArBzB,GAAIA,GAAOV,CAwBXI,GAAK,IC3CPR,YAAYkB,SAASC,WAAWC,SAE9BC,OAAQ,SAASC,EAAUf,GACzB,MAAO,IAAIP,aAAYuB,MAAMC,OAAOC,MAAMC,IAAIJ,EAAUf,MCH5DP,YAAYuB,MAAMC,OAASxB,YAAYuB,MAAMI,KAAKC,QAChDC,KAAM,SAENC,QACEC,EAAG,QAGLL,IAAK,SAASJ,EAAUf,GACtB,MAAIkB,MAAKO,SACAP,KAAKO,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ACtBuD,EAAc,GACTC,EAAI,EAAGC,EAAKR,EAAMvC,OAAOT,OAAQuD,EAAIC,EAAID,IAAK,CACrD,GAAIE,GAAcC,KAAKC,MAAMD,KAAKE,UAAUZ,EAAMvC,OAAO8C,IACzD1C,MAAKgD,qBAAqBJ,GAC1BH,GAAe5B,EAAErC,KAAKyE,SAASjD,KAAKe,QAAQG,gBAAiB0B,GAE/DL,GAAc1B,EAAErC,KAAKyE,SAASjD,KAAKe,QAAQE,eACzCiC,UAAWf,EAAMe,UACjBC,QAASV,IAGbzC,KAAKoD,WAAWC,UAAYxC,EAAErC,KAAKyE,SAASjD,KAAKe,QAAQC,cACvDM,OAAQiB,MAKdS,qBAAsB,SAASJ,IACxBA,EAAYU,OAAStD,KAAKe,QAAQI,aACrCyB,EAAYU,MAAQtD,KAAKe,QAAQI,YAEnCyB,EAAYU,MAAQV,EAAYU,MAAMC,QAAQ,KAAM,SACjDA,QAAQ,KAAM,UACdA,QAAQ,KAAM,SACdA,QAAQ,KAAM,QACdA,QAAQ,KAAM,WAKrBhF,YAAYqC,SAAShB,OAAS,SAAS0B,EAAQP,GAC7C,MAAO,IAAIF,GAAEqB,KAAKtB,SAASb,OAAOuB,EAAQP","file":"esri-leaflet-legend.js","sourcesContent":["/**\n * @example\n * \n * L.esri.Util.queue(\n * [1, 2, 3], [], function(curr, item, cb){\n * setTimeout(function(){\n * cb(null, curr.concat([item + 10]));\n * }, 200);\n * }, function(err, result) {\n * console.log(result); // [11, 12, 13]\n * });\n *
\n * @param {Array.<*>} values\n * @param {*} initial\n * @param {Function} fn process item fn(memo, item, callback)\n * @param {Function} done queue complete\n * @param {*=} context\n */\nEsriLeaflet.Util.reduce = function(values, initial, fn, cb, context) {\n var curr = initial;\n\n function next(index) {\n var sync = true;\n for (var i = index; i < values.length; i++) {\n var done = false;\n fn(curr, values[i], function(err, val) {\n if (err) {\n return cb.call(context, err, curr);\n }\n done = true;\n curr = val;\n if (!sync) {\n next(i + 1);\n }\n });\n sync = done;\n if (!sync) {\n return;\n }\n }\n cb.call(context, null, curr);\n }\n\n next(0);\n};\n","EsriLeaflet.Services.MapService.include({\n\n legend: function(callback, context) {\n return new EsriLeaflet.Tasks.Legend(this).run(callback, context);\n }\n\n});\n","EsriLeaflet.Tasks.Legend = EsriLeaflet.Tasks.Task.extend({\n path: 'legend',\n\n params: {\n f: 'json'\n },\n\n run: function(callback, context) {\n if (this._service) {\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n }\n\n});\n\nEsriLeaflet.Tasks.legend = function(params) {\n return new EsriLeaflet.Tasks.Legend(params);\n};\n","EsriLeaflet.Layers.DynamicMapLayer.include({\n\n legend: function(callback, context) {\n return this._service.legend(callback, context);\n }\n\n});\n","EsriLeaflet.Controls.Legend = L.Control.extend({\n\n options: {\n listTemplate: '',\n layerTemplate: '{layerName}',\n listRowTemplate: '{label}',\n emptyLabel: '',\n container: null\n },\n\n initialize: function(layers, options) {\n this._layers = L.Util.isArray(layers) ? layers : [layers];\n L.Control.prototype.initialize.call(this, options);\n },\n\n onAdd: function(map) {\n var container = this.options.container ||\n L.DomUtil.create('div', 'leaflet-legend-control leaflet-bar');\n L.DomEvent\n .disableScrollPropagation(container)\n .disableClickPropagation(container);\n\n if (this._layers.length) {\n this._load();\n }\n return container;\n },\n\n _load: function() {\n L.esri.Util.reduce(this._layers, {\n layers: []\n }, function(curr, layer, cb) {\n layer.legend(function(err, legend) {\n if (err) {\n return cb(err, curr);\n }\n curr.layers = curr.layers.concat(legend.layers);\n cb(null, curr);\n });\n }, this._onLoad, this);\n },\n\n _onLoad: function(error, legend) {\n if (!error) {\n var layersHtml = '';\n for (var i = 0, len = legend.layers.length; i < len; i++) {\n var layer = legend.layers[i];\n var legendsHtml = '';\n for (var j = 0, jj = layer.legend.length; j < jj; j++) {\n var layerLegend = JSON.parse(JSON.stringify(layer.legend[j]));\n this._validateLegendLabel(layerLegend);\n legendsHtml += L.Util.template(this.options.listRowTemplate, layerLegend);\n }\n layersHtml += L.Util.template(this.options.layerTemplate, {\n layerName: layer.layerName,\n legends: legendsHtml\n });\n }\n this._container.innerHTML = L.Util.template(this.options.listTemplate, {\n layers: layersHtml\n });\n }\n },\n\n _validateLegendLabel: function(layerLegend) {\n if (!layerLegend.label && this.options.emptyLabel) {\n layerLegend.label = this.options.emptyLabel;\n }\n layerLegend.label = layerLegend.label.replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(//g, '>');\n }\n\n});\n\nEsriLeaflet.Controls.legend = function(layers, options) {\n return new L.esri.Controls.Legend(layers, options);\n};\n"]}
\ No newline at end of file
+{"version":3,"sources":["../src/Util.js","../src/Services/MapService.js","../src/Tasks/Legend.js","../src/Layers/DynamicMapLayer.js","../src/Controls/Legend.js"],"names":["EsriLeaflet","Util","reduce","values","initial","fn","cb","context","next","index","sync","i","length","done","curr","err","val","call","MapService","include","legend","callback","Legend","this","run","Task","extend","path","params","f","_service","request","_request","DynamicMapLayer","service","LegendControl","L","Control","options","listTemplate","layerTemplate","listRowTemplate","emptyLabel","container","initialize","layers","_layers","isArray","prototype","onAdd","map","DomUtil","create","DomEvent","disableScrollPropagation","disableClickPropagation","_load","esri","layer","concat","_onLoad","error","layersHtml","len","legendsHtml","j","jj","layerLegend","JSON","parse","stringify","_validateLegendLabel","template","layerName","legends","_container","innerHTML","label","replace","legendControl"],"mappings":";;;;;;;;;;;;;;;;;AAkBAA,YAAYC,KAAKC,OAAS,SAASC,EAAQC,EAASC,EAAIC,EAAIC,GAG1D,QAASC,GAAKC,GAEZ,IAAK,GADDC,IAAO,EACFC,EAAIF,EAAOE,EAAIR,EAAOS,OAAQD,IAAK,CAC1C,GAAIE,IAAO,CAYX,IAXAR,EAAGS,EAAMX,EAAOQ,GAAI,SAASI,EAAKC,GAChC,MAAID,GACKT,EAAGW,KAAKV,EAASQ,EAAKD,IAE/BD,GAAO,EACPC,EAAOE,OACFN,GACHF,EAAKG,EAAI,OAGbD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,EAAKD,IAEjBA,EAAK+B,OAAS/B,EAAK+B,OAAOc,OAAOvC,EAAOyB,YACxCvC,GAAG,KAAMQ,OAEVS,KAAKqC,QAASrC,OAGnBqC,QAAS,SAASC,EAAOzC,GACvB,IAAKyC,EAAO,CAEV,IAAK,GADDC,GAAa,GACRnD,EAAI,EAAGoD,EAAM3C,EAAOyB,OAAOjC,OAAQD,EAAIoD,EAAKpD,IAAK,CAGxD,IAAK,GAFD+C,GAAQtC,EAAOyB,OAAOlC,GACtBqD,EAAc,GACTC,EAAI,EAAGC,EAAKR,EAAMtC,OAAOR,OAAQqD,EAAIC,EAAID,IAAK,CACrD,GAAIE,GAAcC,KAAKC,MAAMD,KAAKE,UAAUZ,EAAMtC,OAAO6C,IACzD1C,MAAKgD,qBAAqBJ,GAC1BH,GAAe5B,EAAEnC,KAAKuE,SAASjD,KAAKe,QAAQG,gBAAiB0B,GAE/DL,GAAc1B,EAAEnC,KAAKuE,SAASjD,KAAKe,QAAQE,eACzCiC,UAAWf,EAAMe,UACjBC,QAASV,IAGbzC,KAAKoD,WAAWC,UAAYxC,EAAEnC,KAAKuE,SAASjD,KAAKe,QAAQC,cACvDM,OAAQiB,MAKdS,qBAAsB,SAASJ,IACxBA,EAAYU,OAAStD,KAAKe,QAAQI,aACrCyB,EAAYU,MAAQtD,KAAKe,QAAQI,YAEnCyB,EAAYU,MAAQV,EAAYU,MAAMC,QAAQ,KAAM,SACjDA,QAAQ,KAAM,UACdA,QAAQ,KAAM,SACdA,QAAQ,KAAM,QACdA,QAAQ,KAAM,WAKrB9E,YAAY+E,cAAgB,SAASlC,EAAQP,GAC3C,MAAO,IAAIF,GAAEqB,KAAKtB,cAAcU,EAAQP","file":"esri-leaflet-legend.js","sourcesContent":["/**\n * @example\n * \n * L.esri.Util.queue(\n * [1, 2, 3], [], function(curr, item, cb){\n * setTimeout(function(){\n * cb(null, curr.concat([item + 10]));\n * }, 200);\n * }, function(err, result) {\n * console.log(result); // [11, 12, 13]\n * });\n *
\n * @param {Array.<*>} values\n * @param {*} initial\n * @param {Function} fn process item fn(memo, item, callback)\n * @param {Function} done queue complete\n * @param {*=} context\n */\nEsriLeaflet.Util.reduce = function(values, initial, fn, cb, context) {\n var curr = initial;\n\n function next(index) {\n var sync = true;\n for (var i = index; i < values.length; i++) {\n var done = false;\n fn(curr, values[i], function(err, val) {\n if (err) {\n return cb.call(context, err, curr);\n }\n done = true;\n curr = val;\n if (!sync) {\n next(i + 1);\n }\n });\n sync = done;\n if (!sync) {\n return;\n }\n }\n cb.call(context, null, curr);\n }\n\n next(0);\n};\n","EsriLeaflet.MapService.include({\n\n legend: function(callback, context) {\n return new EsriLeaflet.Legend(this).run(callback, context);\n }\n\n});\n","EsriLeaflet.Legend = EsriLeaflet.Task.extend({\n path: 'legend',\n\n params: {\n f: 'json'\n },\n\n run: function(callback, context) {\n if (this._service) {\n return this._service.request(this.path, this.params, callback, context);\n } else {\n return this._request('request', this.path, this.params, callback, context);\n }\n }\n\n});\n\nEsriLeaflet.legend = function(params) {\n return new EsriLeaflet.Legend(params);\n};\n","EsriLeaflet.DynamicMapLayer.include({\n\n legend: function(callback, context) {\n return this.service.legend(callback, context);\n }\n\n});\n","EsriLeaflet.LegendControl = L.Control.extend({\n\n options: {\n listTemplate: '',\n layerTemplate: '{layerName}',\n listRowTemplate: '{label}',\n emptyLabel: '',\n container: null\n },\n\n initialize: function(layers, options) {\n this._layers = L.Util.isArray(layers) ? layers : [layers];\n L.Control.prototype.initialize.call(this, options);\n },\n\n onAdd: function(map) {\n var container = this.options.container ||\n L.DomUtil.create('div', 'leaflet-legend-control leaflet-bar');\n L.DomEvent\n .disableScrollPropagation(container)\n .disableClickPropagation(container);\n\n if (this._layers.length) {\n this._load();\n }\n return container;\n },\n\n _load: function() {\n L.esri.Util.reduce(this._layers, {\n layers: []\n }, function(curr, layer, cb) {\n layer.legend(function(err, legend) {\n if (err) {\n return cb(err, curr);\n }\n curr.layers = curr.layers.concat(legend.layers);\n cb(null, curr);\n });\n }, this._onLoad, this);\n },\n\n _onLoad: function(error, legend) {\n if (!error) {\n var layersHtml = '';\n for (var i = 0, len = legend.layers.length; i < len; i++) {\n var layer = legend.layers[i];\n var legendsHtml = '';\n for (var j = 0, jj = layer.legend.length; j < jj; j++) {\n var layerLegend = JSON.parse(JSON.stringify(layer.legend[j]));\n this._validateLegendLabel(layerLegend);\n legendsHtml += L.Util.template(this.options.listRowTemplate, layerLegend);\n }\n layersHtml += L.Util.template(this.options.layerTemplate, {\n layerName: layer.layerName,\n legends: legendsHtml\n });\n }\n this._container.innerHTML = L.Util.template(this.options.listTemplate, {\n layers: layersHtml\n });\n }\n },\n\n _validateLegendLabel: function(layerLegend) {\n if (!layerLegend.label && this.options.emptyLabel) {\n layerLegend.label = this.options.emptyLabel;\n }\n layerLegend.label = layerLegend.label.replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(//g, '>');\n }\n\n});\n\nEsriLeaflet.legendControl = function(layers, options) {\n return new L.esri.LegendControl(layers, options);\n};\n"]}
\ No newline at end of file
diff --git a/example/featureserver.html b/example/featureserver.html
index 1f50ca3..5d6dac6 100644
--- a/example/featureserver.html
+++ b/example/featureserver.html
@@ -5,13 +5,14 @@
-
-
+
+
-
+
+
-
+
diff --git a/example/index.html b/example/index.html
index c93ba5c..1156731 100644
--- a/example/index.html
+++ b/example/index.html
@@ -5,14 +5,14 @@
-
-
+
+
-
+
-
+
diff --git a/example/js/featureserver.js b/example/js/featureserver.js
index 4cb817f..69fbc1b 100644
--- a/example/js/featureserver.js
+++ b/example/js/featureserver.js
@@ -17,4 +17,4 @@ layers.push(new L.esri.featureLayer({
useCors: false
}).addTo(map));
-L.esri.Controls.legend(layers).addTo(map);
+L.esri.legendControl(layers).addTo(map);
diff --git a/example/js/mapserver.js b/example/js/mapserver.js
index b0f928a..c43ee95 100644
--- a/example/js/mapserver.js
+++ b/example/js/mapserver.js
@@ -9,4 +9,4 @@ var waterNetwork = L.esri.dynamicMapLayer({
useCors: false
}).addTo(map);
-L.esri.Controls.legend(waterNetwork).addTo(map);
+L.esri.legendControl(waterNetwork).addTo(map);
diff --git a/package.json b/package.json
index f5d4ada..e85afc0 100644
--- a/package.json
+++ b/package.json
@@ -5,7 +5,8 @@
"main": "dist/esri-leaflet-legend.js",
"scripts": {
"test": "grunt test",
- "start": "grunt"
+ "start": "grunt",
+ "build": "grunt build"
},
"repository": {
"type": "git",
@@ -26,36 +27,36 @@
},
"homepage": "https://github.com/w8r/esri-leaflet-legend#readme",
"dependencies": {
- "esri-leaflet": "^1.0.0-rc.8",
- "leaflet": "^0.7.3"
+ "esri-leaflet": "^2.0.6",
+ "leaflet": "^1.0.2"
},
"devDependencies": {
- "assemble": "^0.4.37",
+ "assemble": "^0.17.1",
"chai": "^3.5.0",
- "esri-leaflet": "^1.0.0",
"grunt": "^1.0.1",
+ "grunt-assemble": "^0.5.0",
"grunt-concurrent": "^2.3.1",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-connect": "^1.0.2",
- "grunt-contrib-jshint": "^1.0.0",
+ "grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-uglify": "^2.0.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-karma": "^2.0.0",
"grunt-newer": "^1.2.0",
- "highlight.js": "^8.0.0",
- "karma": "^1.2.0",
- "karma-chai-sinon": "^0.1.3",
- "karma-chrome-launcher": "^0.1.3",
- "karma-coverage": "^0.1",
- "karma-firefox-launcher": "^0.1.3",
- "karma-mocha": "^0.1.0",
- "karma-mocha-reporter": "^0.2.5",
- "karma-phantomjs-launcher": "^0.1.4",
- "karma-safari-launcher": "^0.1.1",
- "karma-sauce-launcher": "^0.2.10",
- "load-grunt-tasks": "^0.4.0",
- "mocha": "^3.0.2",
- "sinon": "^1.11.1",
+ "highlight.js": "^9.9.0",
+ "karma": "^1.3.0",
+ "karma-chai-sinon": "^0.1.5",
+ "karma-chrome-launcher": "^2.0.0",
+ "karma-coverage": "^1.1",
+ "karma-firefox-launcher": "^1.0.0",
+ "karma-mocha": "^1.3.0",
+ "karma-mocha-reporter": "^2.2.1",
+ "karma-phantomjs-launcher": "^1.0.2",
+ "karma-safari-launcher": "^1.0.0",
+ "karma-sauce-launcher": "^1.1.0",
+ "load-grunt-tasks": "^3.5.2",
+ "mocha": "^3.2.0",
+ "sinon": "^1.17.6",
"sinon-chai": "^2.8.0"
}
}
diff --git a/spec/Layers/DynamicMapLayerSpec.js b/spec/Layers/DynamicMapLayerSpec.js
index 377fa8c..4003866 100644
--- a/spec/Layers/DynamicMapLayerSpec.js
+++ b/spec/Layers/DynamicMapLayerSpec.js
@@ -1,4 +1,4 @@
-describe('L.esri.Layers.DynamicMapLayer', function() {
+describe('L.esri.DynamicMapLayer', function() {
function createMap() {
// create container
@@ -33,10 +33,10 @@ describe('L.esri.Layers.DynamicMapLayer', function() {
map.remove();
});
- it('should expose the legend method on the underlying service', function() {
- var spy = sinon.spy(layer._service, 'legend');
+ it('should expose the legend method on the underlying service', function(done) {
+ var spy = sinon.spy(layer.service, 'legend');
server.respondWith('GET',
- 'http://services.arcgis.com/mock/arcgis/rest/services/MockService/MapServer/legend?f=json', JSON.stringify({
+ 'http://services.arcgis.com/mock/arcgis/rest/services/MockMapService/MapServer/legend?f=json', JSON.stringify({
foo: 'bar'
}));
diff --git a/spec/Tasks/LegendSpec.js b/spec/Tasks/LegendSpec.js
index 2f2ff27..5a2f72f 100644
--- a/spec/Tasks/LegendSpec.js
+++ b/spec/Tasks/LegendSpec.js
@@ -1,4 +1,4 @@
-describe('L.esri.Tasks.Legend', function() {
+describe('L.esri.Legend', function() {
function createMap() {
// create container
var container = document.createElement('div');
@@ -43,7 +43,7 @@ describe('L.esri.Tasks.Legend', function() {
beforeEach(function() {
server = sinon.fakeServer.create();
- task = L.esri.Tasks.legend({
+ task = L.esri.legend({
url: mapServiceUrl
});
});
@@ -81,7 +81,7 @@ describe('L.esri.Tasks.Legend', function() {
});
it('should use a service to execute the request', function(done) {
- var service = L.esri.Services.mapService({
+ var service = L.esri.mapService({
url: mapServiceUrl
});
diff --git a/src/Controls/Legend.js b/src/Controls/Legend.js
index 01086ed..1661b44 100644
--- a/src/Controls/Legend.js
+++ b/src/Controls/Legend.js
@@ -1,4 +1,4 @@
-EsriLeaflet.Controls.Legend = L.Control.extend({
+EsriLeaflet.LegendControl = L.Control.extend({
options: {
listTemplate: '',
@@ -75,6 +75,6 @@ EsriLeaflet.Controls.Legend = L.Control.extend({
});
-EsriLeaflet.Controls.legend = function(layers, options) {
- return new L.esri.Controls.Legend(layers, options);
+EsriLeaflet.legendControl = function(layers, options) {
+ return new L.esri.LegendControl(layers, options);
};
diff --git a/src/Layers/DynamicMapLayer.js b/src/Layers/DynamicMapLayer.js
index 16fa524..d0d3165 100644
--- a/src/Layers/DynamicMapLayer.js
+++ b/src/Layers/DynamicMapLayer.js
@@ -1,7 +1,7 @@
-EsriLeaflet.Layers.DynamicMapLayer.include({
+EsriLeaflet.DynamicMapLayer.include({
legend: function(callback, context) {
- return this._service.legend(callback, context);
+ return this.service.legend(callback, context);
}
});
diff --git a/src/Layers/FeatureLayer/FeatureLayer.js b/src/Layers/FeatureLayer/FeatureLayer.js
index 8eafc6d..327c1b9 100644
--- a/src/Layers/FeatureLayer/FeatureLayer.js
+++ b/src/Layers/FeatureLayer/FeatureLayer.js
@@ -1,7 +1,7 @@
-EsriLeaflet.Layers.FeatureLayer.include({
+EsriLeaflet.FeatureLayer.include({
legend: function(callback, context) {
- return this._service.legend(callback, context);
+ return this.service.legend(callback, context);
}
});
diff --git a/src/Services/FeatureLayer.js b/src/Services/FeatureLayer.js
index 050f87f..caaeb46 100644
--- a/src/Services/FeatureLayer.js
+++ b/src/Services/FeatureLayer.js
@@ -1,7 +1,7 @@
-EsriLeaflet.Services.FeatureLayerService.include({
+EsriLeaflet.FeatureLayerService.include({
legend: function(callback, context) {
- return new EsriLeaflet.Tasks.Legend(this).run(callback, context);
+ return new L.esri.Legend(this).run(callback, context);
}
});
diff --git a/src/Services/MapService.js b/src/Services/MapService.js
index 7a87526..bfa8d6b 100644
--- a/src/Services/MapService.js
+++ b/src/Services/MapService.js
@@ -1,7 +1,7 @@
-EsriLeaflet.Services.MapService.include({
+EsriLeaflet.MapService.include({
legend: function(callback, context) {
- return new EsriLeaflet.Tasks.Legend(this).run(callback, context);
+ return new EsriLeaflet.Legend(this).run(callback, context);
}
});
diff --git a/src/Tasks/Legend.js b/src/Tasks/Legend.js
index c281de7..2d4dca7 100644
--- a/src/Tasks/Legend.js
+++ b/src/Tasks/Legend.js
@@ -1,4 +1,4 @@
-EsriLeaflet.Tasks.Legend = EsriLeaflet.Tasks.Task.extend({
+EsriLeaflet.Legend = EsriLeaflet.Task.extend({
path: 'legend',
params: {
@@ -15,6 +15,6 @@ EsriLeaflet.Tasks.Legend = EsriLeaflet.Tasks.Task.extend({
});
-EsriLeaflet.Tasks.legend = function(params) {
- return new EsriLeaflet.Tasks.Legend(params);
+EsriLeaflet.legend = function(params) {
+ return new EsriLeaflet.Legend(params);
};
diff --git a/src/Tasks/Legend/SymbolLegend.js b/src/Tasks/Legend/SymbolLegend.js
index 3866afe..b2dccb4 100644
--- a/src/Tasks/Legend/SymbolLegend.js
+++ b/src/Tasks/Legend/SymbolLegend.js
@@ -1,15 +1,15 @@
-EsriLeaflet.Tasks.Legend.include({
+EsriLeaflet.Legend.include({
initialize: function(endpoint) {
- this._renderer = new EsriLeaflet.Tasks.Legend.SymbolRenderer();
- EsriLeaflet.Tasks.Task.prototype.initialize.call(this, endpoint);
+ this._renderer = new EsriLeaflet.Legend.SymbolRenderer();
+ EsriLeaflet.Task.prototype.initialize.call(this, endpoint);
},
run: function(callback, context) {
function cb(error, response) {
- if (error && error.error.code === 400) { // ArcGIS server >=10.0
+ if (error && error.code === 400) { // ArcGIS server >=10.0
this._collectLegendFromLayers(callback, context);
- } else if (response.drawingInfo) {
+ } else if (response && response.drawingInfo) {
this._symbolsToLegends([response], function(err, result) {
callback.call(context, err, {
layers: result
diff --git a/src/Tasks/Legend/SymbolRenderer.js b/src/Tasks/Legend/SymbolRenderer.js
index 1411447..7c79f44 100644
--- a/src/Tasks/Legend/SymbolRenderer.js
+++ b/src/Tasks/Legend/SymbolRenderer.js
@@ -1,4 +1,4 @@
-EsriLeaflet.Tasks.Legend.SymbolRenderer = L.Class.extend({
+EsriLeaflet.Legend.SymbolRenderer = L.Class.extend({
statics: {
SYMBOL_TYPES: {
@@ -128,7 +128,7 @@ EsriLeaflet.Tasks.Legend.SymbolRenderer = L.Class.extend({
},
_renderLine: function(ctx, symbol, callback) {
- var size = EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE;
+ var size = EsriLeaflet.Legend.SymbolRenderer.DEFAULT_SIZE;
ctx.beginPath();
ctx.lineWidth = symbol.width;
ctx.strokeStyle = this._formatColor(symbol.color);
@@ -251,7 +251,7 @@ EsriLeaflet.Tasks.Legend.SymbolRenderer = L.Class.extend({
ctx.width = ctx.height = symbol.size;
} else if (symbol.type === 'esriSLS' ||
symbol.type === 'esriSFS') {
- ctx.width = ctx.height = EsriLeaflet.Tasks.Legend.SymbolRenderer.DEFAULT_SIZE;
+ ctx.width = ctx.height = EsriLeaflet.Legend.SymbolRenderer.DEFAULT_SIZE;
} else {
ctx.width = symbol.width;
ctx.height = symbol.height;
@@ -327,7 +327,7 @@ EsriLeaflet.Tasks.Legend.SymbolRenderer = L.Class.extend({
},
_fillImage: function(ctx, imageData, symbol, contentType, image) {
- var size = L.EsriLeaflet.Tasks.Legend.DEFAULT_SIZE;
+ var size = L.esri.Legend.DEFAULT_SIZE;
var w = symbol.width || size;
var h = symbol.height || size;
if (imageData) {