56 |
57 |
58 |
189 |
190 |
191 |
--------------------------------------------------------------------------------
/debug/comparisons.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
34 |
Leaflet
35 |
Esri JS API
36 |
37 |
190 |
191 |
192 |
--------------------------------------------------------------------------------
/spec/Renderers/UniqueValueRendererSpec.js:
--------------------------------------------------------------------------------
1 | /* global L beforeEach describe expect it */
2 | describe('UniqueValueRenderer', function () {
3 | describe('should create renderer from JSON', function () {
4 | var rendererJson;
5 |
6 | beforeEach(function () {
7 | rendererJson = {
8 | 'type': 'uniqueValue',
9 | 'field1': 'ZONE',
10 | 'defaultSymbol': {
11 | 'type': 'esriSFS',
12 | 'style': 'esriSFSSolid',
13 | 'color': [0, 0, 0, 64],
14 | 'outline': {
15 | 'type': 'esriSLS',
16 | 'style': 'esriSLSSolid',
17 | 'color': [0, 0, 0, 51],
18 | 'width': 1
19 | }
20 | },
21 | 'uniqueValueInfos': [
22 | {
23 | 'value': '-12',
24 | 'symbol': {
25 | 'type': 'esriSFS',
26 | 'style': 'esriSFSSolid',
27 | 'color': [255, 255, 255, 128],
28 | 'outline': {
29 | 'type': 'esriSLS',
30 | 'style': 'esriSLSSolid',
31 | 'color': [128, 128, 128, 255],
32 | 'width': 1.5
33 | }
34 | }
35 | },
36 | {
37 | 'value': '-11',
38 | 'symbol': {
39 | 'type': 'esriSFS',
40 | 'style': 'esriSFSSolid',
41 | 'color': [192, 192, 192, 128],
42 | 'outline': {
43 | 'type': 'esriSLS',
44 | 'style': 'esriSLSSolid',
45 | 'color': [128, 128, 128, 255],
46 | 'width': 1.5
47 | }
48 | }
49 | },
50 | {
51 | 'value': '-10',
52 | 'symbol': {
53 | 'type': 'esriSFS',
54 | 'style': 'esriSFSSolid',
55 | 'color': [255, 255, 255, 128],
56 | 'outline': {
57 | 'type': 'esriSLS',
58 | 'style': 'esriSLSSolid',
59 | 'color': [128, 128, 128, 255],
60 | 'width': 1.5
61 | }
62 | }
63 | }
64 | ]
65 | };
66 | });
67 |
68 | it('should create three symbols', function () {
69 | var renderer = L.esri.Renderers.uniqueValueRenderer(rendererJson);
70 | expect(renderer._symbols.length).to.be.eq(3);
71 | });
72 |
73 | it('should merge symbol styles', function () {
74 | var options = {
75 | userDefinedStyle: function (feature) {
76 | return { opacity: 0.5 };
77 | }
78 | };
79 | var renderer = L.esri.Renderers.uniqueValueRenderer(rendererJson, options);
80 | var feature = { 'properties': { 'ZONE': -12, 'VALUE': '$25.00', 'MARKET': '2Z' } };
81 | var style = renderer.style(feature);
82 | // user style
83 | expect(style.opacity).to.be.eq(0.5);
84 | // renderer style
85 | expect(style.weight).to.be.greaterThan(1);
86 | });
87 |
88 | describe('symbol transparency', function () {
89 | it('should be equal to symbol value when no layer transparency defined', function () {
90 | var renderer = L.esri.Renderers.uniqueValueRenderer(rendererJson);
91 | expect(renderer._symbols[0]._styles.fillOpacity).to.be.eq(128 / 255.0);
92 | expect(renderer._symbols[0]._lineStyles.opacity).to.be.eq(1);
93 | expect(renderer._defaultSymbol._styles.fillOpacity).to.be.eq(64 / 255.0);
94 | expect(renderer._defaultSymbol._lineStyles.opacity).to.be.eq(51 / 255.0);
95 | });
96 |
97 | it('should be equal to symbol value with transparency applied when defined', function () {
98 | var renderer = L.esri.Renderers.uniqueValueRenderer(rendererJson, { layerTransparency: 75 });
99 | expect(renderer._symbols[0]._styles.fillOpacity).to.be.eq(128 / 255.0 * 0.25);
100 | expect(renderer._symbols[0]._lineStyles.opacity).to.be.eq(0.25);
101 | expect(renderer._defaultSymbol._styles.fillOpacity).to.be.eq(64 / 255.0 * 0.25);
102 | expect(renderer._defaultSymbol._lineStyles.opacity).to.be.eq(51 / 255.0 * 0.25);
103 | });
104 | });
105 |
106 | it('should create a default symbol', function () {
107 | var renderer = L.esri.Renderers.uniqueValueRenderer(rendererJson);
108 | expect(renderer._defaultSymbol).to.not.equal(undefined);
109 | });
110 |
111 | it('should get default symbol when no matching value', function () {
112 | var renderer = L.esri.Renderers.uniqueValueRenderer(rendererJson);
113 | var feature = { 'properties': { 'ZONE': 5 } };
114 | var sym = renderer._getSymbol(feature);
115 | expect(sym.val).to.be.equal(null);
116 | });
117 |
118 | it('should get symbol for that matches the value', function () {
119 | var renderer = L.esri.Renderers.uniqueValueRenderer(rendererJson);
120 | var feature = { 'properties': { 'ZONE': -10 } };
121 | var sym = renderer._getSymbol(feature);
122 | expect(sym.val).to.be.eq('-10');
123 | });
124 | });
125 |
126 | describe('should renderer based on multiple fields', function () {
127 | var multipleFieldRendererJson;
128 |
129 | beforeEach(function () {
130 | multipleFieldRendererJson = {
131 | 'type': 'uniqueValue',
132 | 'field1': 'ZONE',
133 | 'field2': 'MARKET',
134 | 'field3': 'VALUE',
135 | 'fieldDelimiter': ',',
136 | 'defaultSymbol': {
137 | 'type': 'esriSFS',
138 | 'style': 'esriSFSSolid',
139 | 'color': [0, 0, 0, 64],
140 | 'outline': {
141 | 'type': 'esriSLS',
142 | 'style': 'esriSLSSolid',
143 | 'color': [0, 0, 0, 51],
144 | 'width': 1
145 | }
146 | },
147 | 'uniqueValueInfos': [
148 | {
149 | 'value': '-12,2Z,$25.00',
150 | 'symbol': {
151 | 'type': 'esriSFS',
152 | 'style': 'esriSFSSolid',
153 | 'color': [255, 255, 255, 128],
154 | 'outline': {
155 | 'type': 'esriSLS',
156 | 'style': 'esriSLSSolid',
157 | 'color': [128, 128, 128, 255],
158 | 'width': 1.5
159 | }
160 | }
161 | }
162 | ]
163 | };
164 | });
165 | it('should get default symbol when not matching all fields', function () {
166 | var renderer = L.esri.Renderers.uniqueValueRenderer(multipleFieldRendererJson);
167 | var feature = { 'properties': { 'ZONE': -12, 'MARKET': '2Z' } };
168 | var sym = renderer._getSymbol(feature);
169 | expect(sym.val).to.be.eq(null);
170 | });
171 |
172 | it('should get symbol for that matches the value', function () {
173 | var renderer = L.esri.Renderers.uniqueValueRenderer(multipleFieldRendererJson);
174 | var feature = { 'properties': { 'ZONE': -12, 'VALUE': '$25.00', 'MARKET': '2Z' } };
175 | var sym = renderer._getSymbol(feature);
176 | expect(sym.val).to.be.eq('-12,2Z,$25.00');
177 | });
178 | });
179 | });
180 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | > This repository has been archived. If you're an active user, please feel free to fork it.
2 |
3 | # Esri Leaflet Renderers
4 |
5 | Leaflet plugin for [ArcGIS Feature Services](http://developers.arcgis.com). Esri Leaflet Renderers works in conjunction with the Esri Leaflet Plugin to draw [feature services](https://developers.arcgis.com/esri-leaflet/samples/simple-feature-layer/) using renderers defined by the service.
6 |
7 | [](https://travis-ci.org/Esri/Leaflet.shapeMarkers)
8 |
9 | The sole purpose of this plugin is to allow [`L.esri.FeatureLayer`](https://developers.arcgis.com/esri-leaflet/api-reference/layers/feature-layer/) to automatically take on renderers defined in [ArcGIS Feature Services](https://developers.arcgis.com/en/features/cloud-storage/). Esri Leaflet Renderers works in conjunction with Esri Leaflet, but it does not add any additional methods or properties to the class that it extends.
10 |
11 | ### Example
12 | Take a look at the [live demo](https://developers.arcgis.com/esri-leaflet/samples/renderers-plugin/).
13 |
14 | You can also find a side by side comparison of the ArcGIS API for JavaScript [here](https://esri.github.io/esri-leaflet-renderers/spec/comparisons.html).
15 |
16 | ```html
17 |
18 |
19 |
20 |
21 |
Renderer from Service
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
39 |
40 |
41 |
42 |
43 |
44 |
55 |
56 |
57 |
58 | ```
59 |
60 | ### Development Instructions
61 |
62 | 1. [Fork and clone Esri Leaflet Renderers](https://help.github.com/articles/fork-a-repo)
63 | 2. `cd` into the `esri-leaflet-renderers` folder
64 | 3. Install the dependencies with `npm install`
65 | 4. Run `npm start` from the command line. This will compile minified source in a brand new `dist` directory, launch a tiny web server and begin watching the raw source for changes.
66 | 5. Run `npm test` to make sure you haven't introduced a new 'feature' accidentally.
67 | 6. Make your changes and create a [pull request](https://help.github.com/articles/creating-a-pull-request)
68 |
69 | ### Limitations
70 |
71 | * As of `2.0.1`, It is possible to override aspects of polyline and polygon symbology defined by the service in the FeatureLayer constructor. For points, it is not.
72 | * [Simple Marker](http://resources.arcgis.com/en/help/arcgis-rest-api/02r3/02r3000000n5000000.htm#GUID-C8D40B32-5F4B-45EB-8048-6D5A8763E13B) symbols do not support rotation (ie: the 'angle' property is ignored).
73 | * Polygons only support [solid fill](http://resources.arcgis.com/en/help/arcgis-rest-api/02r3/02r3000000n5000000.htm#GUID-517D9B3F-DF13-4E79-9B58-A0D24C5E4994). This does not include advanced fill types like PictureFill, Backward Diagonal, DiagonalCross, etc.
74 | * [Text](http://resources.arcgis.com/en/help/arcgis-rest-api/02r3/02r3000000n5000000.htm#ESRI_SECTION1_94E8CE0A9F614ABC8BEDDBCB0E9DC53A) symbols are not supported.
75 |
76 | ### Dependencies
77 |
78 | * Esri Leaflet Renderers [1.x](https://github.com/Esri/esri-leaflet-renderers/releases/tag/v1.0.0) (available on [CDN](https://unpkg.com/esri-leaflet-renderers@1/dist/esri-leaflet-renderers.js)) can be used in apps alongside:
79 | * [Leaflet](http://leafletjs.com) version 0.7.x.
80 | * [Esri Leaflet](https://developers.arcgis.com/esri-leaflet/) version 1.0.x.
81 |
82 | * Esri Leaflet Renderers [2.x](https://github.com/Esri/esri-leaflet-renderers/releases/tag/v2.0.4) (available on [CDN](https://unpkg.com/esri-leaflet-renderers@2/dist/esri-leaflet-renderers.js)) can be used in apps alongside:
83 | * [Leaflet](http://leafletjs.com) version 1.0.0-rc.3.
84 | * [Esri Leaflet](https://developers.arcgis.com/esri-leaflet/) version 2.0.x.
85 |
86 | * Esri Leaflet Renderers [3.x](https://github.com/Esri/esri-leaflet-renderers/releases/tag/v3.0.0) (available on [CDN](https://unpkg.com/esri-leaflet-renderers@3/dist/esri-leaflet-renderers.js)) can be used in apps alongside:
87 | * [Leaflet](http://leafletjs.com) version 1.x.
88 | * [Esri Leaflet](https://developers.arcgis.com/esri-leaflet/) version 3.x.
89 |
90 | ### Versioning
91 |
92 | For transparency into the release cycle and in striving to maintain backward compatibility, Esri Leaflet is maintained under the Semantic Versioning guidelines and will adhere to these rules whenever possible.
93 |
94 | Releases will be numbered with the following format:
95 |
96 | `
..`
97 |
98 | And constructed with the following guidelines:
99 |
100 | * Breaking backward compatibility **bumps the major** while resetting minor and patch
101 | * New additions without breaking backward compatibility **bumps the minor** while resetting the patch
102 | * Bug fixes and misc changes **bumps only the patch**
103 |
104 | For more information on SemVer, please visit .
105 |
106 | ### Contributing
107 |
108 | Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](https://github.com/Esri/esri-leaflet-renderers/blob/master/CONTRIBUTING.md).
109 |
110 | ### Licensing
111 | Copyright © 2015-2018 Esri
112 |
113 | Licensed under the Apache License, Version 2.0 (the "License");
114 | you may not use this file except in compliance with the License.
115 | You may obtain a copy of the License at
116 |
117 | > http://www.apache.org/licenses/LICENSE-2.0
118 |
119 | Unless required by applicable law or agreed to in writing, software
120 | distributed under the License is distributed on an "AS IS" BASIS,
121 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
122 | See the License for the specific language governing permissions and
123 | limitations under the License.
124 |
125 | A copy of the license is available in the repository's [LICENSE]( https://raw.github.com/Esri/esri-leaflet/master/LICENSE) file.
126 |
--------------------------------------------------------------------------------
/src/FeatureLayerHook.js:
--------------------------------------------------------------------------------
1 | import { Util, GeoJSON, geoJson } from 'leaflet';
2 | import * as EsriLeaflet from 'esri-leaflet';
3 | import EsriLeafletCluster, { FeatureLayer as EsriLeafletClusterFeatureLayer } from 'esri-leaflet-cluster';
4 | import classBreaksRenderer from './Renderers/ClassBreaksRenderer';
5 | import uniqueValueRenderer from './Renderers/UniqueValueRenderer';
6 | import simpleRenderer from './Renderers/SimpleRenderer';
7 |
8 | function wireUpRenderers () {
9 | if (this.options.ignoreRenderer) {
10 | return;
11 | }
12 | var oldOnAdd = Util.bind(this.onAdd, this);
13 | var oldUnbindPopup = Util.bind(this.unbindPopup, this);
14 | var oldOnRemove = Util.bind(this.onRemove, this);
15 |
16 | Util.bind(this.createNewLayer, this);
17 |
18 | this.onAdd = function (map) {
19 | this.metadata(function (error, response) {
20 | if (error) {
21 | console.warn('failed to load metadata from the service.');
22 | return;
23 | } if (response && response.drawingInfo) {
24 | if (this.options.drawingInfo) {
25 | // allow L.esri.webmap (and others) to override service symbology with info provided in layer constructor
26 | response.drawingInfo = this.options.drawingInfo;
27 | }
28 |
29 | // the default pane for lines and polygons is 'overlayPane', for points it is 'markerPane'
30 | if (this.options.pane === 'overlayPane' && response.geometryType === 'esriGeometryPoint') {
31 | this.options.pane = 'markerPane';
32 | }
33 |
34 | this._setRenderers(response);
35 | oldOnAdd(map);
36 | this._addPointLayer(map);
37 | }
38 | }, this);
39 | };
40 |
41 | this.onRemove = function (map) {
42 | oldOnRemove(map);
43 | if (this._pointLayer) {
44 | var pointLayers = this._pointLayer.getLayers();
45 | for (var i in pointLayers) {
46 | map.removeLayer(pointLayers[i]);
47 | }
48 | }
49 | };
50 |
51 | this.unbindPopup = function () {
52 | oldUnbindPopup();
53 | if (this._pointLayer) {
54 | var pointLayers = this._pointLayer.getLayers();
55 | for (var i in pointLayers) {
56 | pointLayers[i].unbindPopup();
57 | }
58 | }
59 | };
60 |
61 | this._addPointLayer = function (map) {
62 | if (this._pointLayer) {
63 | this._pointLayer.addTo(map);
64 | this._pointLayer.bringToFront();
65 | }
66 | };
67 |
68 | this._createPointLayer = function () {
69 | if (!this._pointLayer) {
70 | this._pointLayer = geoJson();
71 | // store the feature ids that have already been added to the map
72 | this._pointLayerIds = {};
73 |
74 | if (this._popup) {
75 | var popupFunction = function (feature, layer) {
76 | layer.bindPopup(this._popup(feature, layer), this._popupOptions);
77 | };
78 | this._pointLayer.options.onEachFeature = Util.bind(popupFunction, this);
79 | }
80 | }
81 | };
82 |
83 | this.createNewLayer = function (geojson) {
84 | var fLayer = GeoJSON.geometryToLayer(geojson, this.options);
85 |
86 | // add a point layer when the polygon is represented as proportional marker symbols
87 | if (this._hasProportionalSymbols) {
88 | var centroid = this.getPolygonCentroid(geojson.geometry.coordinates);
89 | if (!(isNaN(centroid[0]) || isNaN(centroid[0]))) {
90 | this._createPointLayer();
91 |
92 | var featureId = geojson.id.toString();
93 | // only add the feature if it does not already exist on the map
94 | if (!this._pointLayerIds[featureId]) {
95 | var pointjson = this.getPointJson(geojson, centroid);
96 |
97 | this._pointLayer.addData(pointjson);
98 | this._pointLayerIds[featureId] = true;
99 | }
100 |
101 | this._pointLayer.bringToFront();
102 | }
103 | }
104 | return fLayer;
105 | };
106 |
107 | this.getPolygonCentroid = function (coordinates) {
108 | var pts = coordinates[0][0];
109 | if (pts.length === 2) {
110 | pts = coordinates[0];
111 | }
112 |
113 | var twicearea = 0;
114 | var x = 0;
115 | var y = 0;
116 | var nPts = pts.length;
117 | var p1;
118 | var p2;
119 | var f;
120 |
121 | for (var i = 0, j = nPts - 1; i < nPts; j = i++) {
122 | p1 = pts[i]; p2 = pts[j];
123 | twicearea += p1[0] * p2[1];
124 | twicearea -= p1[1] * p2[0];
125 | f = (p1[0] * p2[1]) - (p2[0] * p1[1]);
126 | x += (p1[0] + p2[0]) * f;
127 | y += (p1[1] + p2[1]) * f;
128 | }
129 | f = twicearea * 3;
130 | return [x / f, y / f];
131 | };
132 |
133 | this.getPointJson = function (geojson, centroid) {
134 | return {
135 | type: 'Feature',
136 | properties: geojson.properties,
137 | id: geojson.id,
138 | geometry: {
139 | type: 'Point',
140 | coordinates: [centroid[0], centroid[1]]
141 | }
142 | };
143 | };
144 |
145 | this._checkForProportionalSymbols = function (geometryType, renderer) {
146 | this._hasProportionalSymbols = false;
147 | if (geometryType === 'esriGeometryPolygon') {
148 | if (renderer.backgroundFillSymbol) {
149 | this._hasProportionalSymbols = true;
150 | }
151 | // check to see if the first symbol in the classbreaks is a marker symbol
152 | if (renderer.classBreakInfos && renderer.classBreakInfos.length) {
153 | var sym = renderer.classBreakInfos[0].symbol;
154 | if (sym && (sym.type === 'esriSMS' || sym.type === 'esriPMS')) {
155 | this._hasProportionalSymbols = true;
156 | }
157 | }
158 | }
159 | };
160 |
161 | this._setRenderers = function (serviceInfo) {
162 | var rend;
163 | var rendererInfo = serviceInfo.drawingInfo.renderer;
164 |
165 | var options = {
166 | url: this.options.url
167 | };
168 |
169 | if (this.options.token) {
170 | options.token = this.options.token;
171 | }
172 |
173 | if (this.options.pane) {
174 | options.pane = this.options.pane;
175 | }
176 |
177 | if (serviceInfo.drawingInfo.transparency) {
178 | options.layerTransparency = serviceInfo.drawingInfo.transparency;
179 | }
180 |
181 | if (this.options.style) {
182 | options.userDefinedStyle = this.options.style;
183 | }
184 |
185 | switch (rendererInfo.type) {
186 | case 'classBreaks':
187 | this._checkForProportionalSymbols(serviceInfo.geometryType, rendererInfo);
188 | if (this._hasProportionalSymbols) {
189 | this._createPointLayer();
190 | var pRend = classBreaksRenderer(rendererInfo, options);
191 | pRend.attachStylesToLayer(this._pointLayer);
192 | options.proportionalPolygon = true;
193 | }
194 | rend = classBreaksRenderer(rendererInfo, options);
195 | break;
196 | case 'uniqueValue':
197 | rend = uniqueValueRenderer(rendererInfo, options);
198 | break;
199 | default:
200 | rend = simpleRenderer(rendererInfo, options);
201 | }
202 | rend.attachStylesToLayer(this);
203 | };
204 | }
205 |
206 | EsriLeaflet.FeatureLayer.addInitHook(wireUpRenderers);
207 |
208 | if (typeof EsriLeafletCluster !== 'undefined' && EsriLeafletClusterFeatureLayer) {
209 | EsriLeafletClusterFeatureLayer.addInitHook(wireUpRenderers);
210 | }
211 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # esri-leaflet-renderers change log
2 |
3 | All notable changes to this project will be documented in this file.
4 | This project adheres to [Semantic Versioning](http://semver.org/).
5 | This change log adheres to standards from [Keep a CHANGELOG](http://keepachangelog.com).
6 |
7 | ## [Unreleased]
8 |
9 | ## [3.0.1] - 2023-08-28
10 |
11 | ### Updated
12 |
13 | * Updated dependencies ([#191](https://github.com/Esri/esri-leaflet-renderers/pull/191))
14 | * Updated version export style ([#190](https://github.com/Esri/esri-leaflet-renderers/pull/190))
15 |
16 | ## [3.0.0] - 2022-06-24
17 |
18 | ### Changed
19 |
20 | * Updated `esri-leaflet` peer dependency version in `package.json` so that there will not be errors when installing via NPM ([#177](https://github.com/Esri/esri-leaflet-renderers/pull/177))
21 |
22 | ### Updated
23 |
24 | * Fixed renderers when working with esri-leaflet-cluster ([#179](https://github.com/Esri/esri-leaflet-renderers/pull/179))
25 |
26 | ## [2.1.3] - 2022-03-08
27 |
28 | ### Updated
29 |
30 | * Updated dependencies and changed build-related settings to be consistent with Esri Leaflet ([#171](https://github.com/Esri/esri-leaflet-renderers/pull/171))
31 |
32 | ## [2.1.2] - 2020-07-06
33 |
34 | ### Changed
35 |
36 | * Update `esri-leaflet-cluster` version in `package.json` (🙏francharbo🙏 [#160](https://github.com/Esri/esri-leaflet-renderers/pull/160))
37 |
38 | ## [2.1.1] - 2020-06-23
39 |
40 | ### Fixed
41 |
42 | * Follow-up to [#144](https://github.com/Esri/esri-leaflet-renderers/pull/144) to fix the clustering changes (🙏jgravois🙏 [#158](https://github.com/Esri/esri-leaflet-renderers/pull/158))
43 |
44 | ## [2.1.0] - 2020-06-19
45 |
46 | ### Added
47 |
48 | * Clustering ([#144](https://github.com/Esri/esri-leaflet-renderers/pull/144))
49 |
50 | ### Changed
51 |
52 | * esri-leaflet, leaflet, and leaflet-shape-markers are now peer dependencies ([#154](https://github.com/Esri/esri-leaflet-renderers/pull/154))
53 |
54 | ## [2.0.6] - 2017-06-02
55 |
56 | ### Fixed
57 |
58 | * bug that mangled server side color interpretation
59 |
60 | ## [2.0.5] - 2017-06-02
61 |
62 | ### Added
63 |
64 | * support for loading via AMD
65 | * support for Node 7
66 |
67 | ### Fixed
68 |
69 | * ensure that point geometry layers are assigned to Leaflet's `markerPane` by default
70 |
71 | ## [2.0.4] - 2016-08-17
72 |
73 | ### Added
74 |
75 | * support for picture marker symbols stored outside the ArcGIS ecosystem
76 |
77 | ### Fixed
78 |
79 | * ensure the plugin only fires *one* metadata requests
80 | * ensure that [`esriSLSNull`] symbol types display correctly
81 |
82 | ## [2.0.3] - 2016-07-01
83 |
84 | ### Added
85 |
86 | * support for base64 encoded PictureMarkerSymbols. thx @ynunokawa!
87 | * support for overriding service symbology with 'drawingInfo' provided in `L.esri.featureLayer`s constructor. thx @ynunokawa!
88 |
89 | ```js
90 | var fl = L.esri.featureLayer({
91 | url: 'http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/0',
92 | drawingInfo: {
93 | "renderer": {
94 | "type": "simple",
95 | "symbol": {
96 | "type": "esriSMS",
97 | "style": "esriSMSCircle",
98 | "color": [115, 178, 255, 255],
99 | "size": 10,
100 | "angle": 0,
101 | "xoffset": 0,
102 | "yoffset": 0,
103 | "outline": {
104 | "color": [0, 0, 0, 255],
105 | "width": 1
106 | }
107 | },
108 | "label": "",
109 | "description": ""
110 | },
111 | "transparency": 0,
112 | "labelingInfo": null
113 | }
114 | }).addTo(map);
115 | ```
116 |
117 | ### Fixed
118 |
119 | * odd cases where a subset of features were drawn with leaflet symbology.
120 |
121 | ### Added
122 |
123 | ## [2.0.2] - 2016-06-15
124 |
125 | ### Added
126 |
127 | * now its possible for individual featureLayers to *not* utilize the renderer defined by the service (when `ignoreRenderer: true` is included as a contructor option)
128 |
129 | ### Fixed
130 |
131 | * Ensured that its possible to specify custom panes for marker symbols (thanks @pbastia!)
132 | * Race condition encountered when metadata is slow to load
133 |
134 | ### Changed
135 |
136 | * Build system refactored to use latest Rollup and Rollup plugins.
137 | * Reworked bundling directives for various modules systems to resolve and simplify various issues
138 | * WebPack users no longer have to use the Babel loader.
139 | * Babelify with Babel 6 now works
140 |
141 | ## [2.0.1] - 2016-01-19
142 |
143 | ### Added
144 |
145 | * Now developers can now override individual style properties of interest for polyline and polygon services directly in the FeatureLayer constructor. (via [pull #100](https://github.com/Esri/esri-leaflet-renderers/pull/100))
146 |
147 | ```js
148 | L.esri.featureLayer({
149 | url: 'http://[server]/arcgis/rest/services/[yourservice]/MapServer/0',
150 | style: function (feature) {
151 | return {
152 | // override service symbology to make polygon fill 50% transparent
153 | fillOpacity: 0.5
154 | };
155 | }
156 | }).addTo(map);
157 | ```
158 |
159 | ## [2.0.0] - 2015-09-10
160 |
161 | This is the first release that supports [Leaflet 1.0.0-beta.1](http://leafletjs.com/2015/07/15/leaflet-1.0-beta1-released.html). As with version [1.0.0](https://github.com/Esri/esri-leaflet/releases/tag/v1.0.0) of Esri Leaflet, FeatureLayer constructors now expect `url`s to be provided within an options object (ie: `L.esri.featureLayer(url)` should be replaced with `L.esri.featureLayer( {url: url} )`).
162 |
163 | ## [1.0.1] - 2015-11-30
164 |
165 | ### Added
166 |
167 | * support for clusteredFeatureLayers
168 | * support for unique value renderers based on more than one field
169 | * support for transparency applied to the entire renderer (via the service symbology)
170 |
171 | ### Changed
172 |
173 | * Rewritten build and test systems to rely on ES 2015 Modules specification
174 | * More build and release automation
175 |
176 | ## [1.0.0] - 2015-09-08
177 |
178 | This is expected to be the last (and only) stable release of Esri Leaflet Renderers compatible with Leaflet 0.7.3. All future 1.0.X releases will be compatible with Leaflet 0.7.3 and contain only bug fixes. New features will only be added in Esri Leaflet Renderers 2.0.0 (which will require Leaflet 1.0.0).
179 |
180 | ### Breaking Changes
181 |
182 | * In Esri Leaflet itself, in L.esri.FeatureLayer constructors, the `url` is now provided within an options object (ie: `L.esri.featureLayer(url)` should be replaced with `L.esri.featureLayer( {url: url} )`).
183 |
184 | ### Added
185 |
186 | * support for unique value renderers based on more than one field
187 | * support for transparency applied to the entire renderer
188 |
189 | ### Fixed
190 |
191 | * ensured that tokens are passed through in requests for picture marker symbols
192 |
193 | ## [0.0.1-beta.3] - 2015-03-24
194 |
195 | * Render from the new visualVariables objects in the renderer JSON
196 | * Still backwards compatible with classic renderers
197 |
198 | ## [0.0.1-beta.2] - 2015-03-02
199 |
200 | * Fix to work with Browserify
201 | * Update to work with esri-leaflet 1.0.0-rc.5
202 | * Still backwards compatible with esri-leaflet 1.0.0-rc.4
203 |
204 | ## 0.0.1-beta.1 - 2015-01-29
205 |
206 | * First Beta release
207 | * Works with esri-leaflet 1.0.0-rc.4
208 |
209 | [Unreleased]: https://github.com/Esri/esri-leaflet-renderers/compare/v3.0.1...HEAD
210 | [3.0.1]: https://github.com/Esri/esri-leaflet-renderers/compare/v3.0.0...v3.0.1
211 | [3.0.0]: https://github.com/Esri/esri-leaflet-renderers/compare/v2.1.3...v3.0.0
212 | [2.1.3]: https://github.com/Esri/esri-leaflet-renderers/compare/v2.1.2...v2.1.3
213 | [2.1.2]: https://github.com/Esri/esri-leaflet-renderers/compare/v2.1.1...v2.1.2
214 | [2.1.1]: https://github.com/Esri/esri-leaflet-renderers/compare/v2.1.0...v2.1.1
215 | [2.1.0]: https://github.com/Esri/esri-leaflet-renderers/compare/v2.0.6...v2.1.0
216 | [2.0.6]: https://github.com/Esri/esri-leaflet-renderers/compare/v2.0.5...v2.0.6
217 | [2.0.5]: https://github.com/Esri/esri-leaflet-renderers/compare/v2.0.4...v2.0.5
218 | [2.0.4]: https://github.com/Esri/esri-leaflet-renderers/compare/v2.0.3...v2.0.4
219 | [2.0.3]: https://github.com/Esri/esri-leaflet-renderers/compare/v2.0.2...v2.0.3
220 | [2.0.2]: https://github.com/Esri/esri-leaflet-renderers/compare/v2.0.1...v2.0.2
221 | [2.0.1]: https://github.com/Esri/esri-leaflet-renderers/compare/v2.0.0...v2.0.1
222 | [2.0.0]: https://github.com/Esri/esri-leaflet-renderers/compare/v1.0.0...v2.0.0
223 | [1.0.1]: https://github.com/Esri/esri-leaflet-renderers/compare/v1.0.0...v1.0.1
224 | [1.0.0]: https://github.com/Esri/esri-leaflet-renderers/compare/v0.0.1-beta.3...v1.0.0
225 | [0.0.1-beta.3]: https://github.com/Esri/esri-leaflet-renderers/compare/v0.0.1-beta.2...v0.0.1-beta.3
226 | [0.0.1-beta.2]: https://github.com/Esri/esri-leaflet-renderers/compare/v0.0.1-beta.1...v0.0.1-beta.2
227 |
--------------------------------------------------------------------------------