Skip to content

Commit

Permalink
Merge pull request Esri#406 from jgravois/no-fill
Browse files Browse the repository at this point in the history
make sure fill is set by default for multipolygons
  • Loading branch information
patrickarlt committed Dec 5, 2014
2 parents 94f4f9c + a2d77e9 commit ced40a0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/Layers/FeatureLayer/FeatureLayerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,18 @@ describe('L.esri.Layers.FeatureLayer', function () {
expect(layer.getFeature(1).getLayers()[0].options.color).to.equal('#0033ff');
});

it('should draw multi polygon features with a fill', function(){
layer = L.esri.featureLayer('http://services.arcgis.com/mock/arcgis/rest/services/MockService/MockFeatureServer/0').addTo(map);

layer.createLayers(multiPolygon);

expect(layer.getFeature(1).getLayers()[0].options.fill).to.equal(true);

layer.resetStyle(1);

expect(layer.getFeature(1).getLayers()[0].options.color).to.equal('#0033ff');
});

it('should iterate over each feature', function(){
var spy = sinon.spy();
layer.eachFeature(spy);
Expand Down
1 change: 1 addition & 0 deletions src/Layers/FeatureLayer/FeatureLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ EsriLeaflet.Layers.FeatureLayer = EsriLeaflet.Layers.FeatureManager.extend({
else if (!style && !layer.defaultOptions) {
var dummyPath = new L.Path();
style = L.Path.prototype.options;
style.fill = true; //not set by default
}

if (layer.setStyle) {
Expand Down

0 comments on commit ced40a0

Please sign in to comment.