Skip to content

Commit

Permalink
Re-extract group_by_layout to style-spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Nov 7, 2016
1 parent fcfd275 commit 69e1eb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
17 changes: 1 addition & 16 deletions js/style/style_layer_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,7 @@
const StyleLayer = require('./style_layer');
const util = require('../util/util');
const featureFilter = require('feature-filter');
const stringify = require('fast-stable-stringify');

function groupByLayout(layers) {
const groups = {};

for (const layer of layers) {
const key = stringify([layer.type, layer.source, layer['source-layer'], layer.minzoom, layer.maxzoom, layer.filter, layer.layout]);
let group = groups[key];
if (!group) {
group = groups[key] = [];
}
group.push(layer);
}

return util.values(groups);
}
const groupByLayout = require('mapbox-gl-style-spec/lib/group_by_layout');

class StyleLayerIndex {
constructor(layers) {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"bubleify": "^0.5.1",
"csscolorparser": "^1.0.2",
"earcut": "^2.0.3",
"fast-stable-stringify": "^0.1.1",
"feature-filter": "^2.2.0",
"flow-remove-types": "^1.0.4",
"geojson-rewind": "^0.1.0",
Expand All @@ -24,7 +23,7 @@
"grid-index": "^1.0.0",
"mapbox-gl-function": "mapbox/mapbox-gl-function#41c6724e2bbd7bd1eb5991451bbf118b7d02b525",
"mapbox-gl-shaders": "mapbox/mapbox-gl-shaders#abd16b9e8b5da8efbbcad7a83f08491db4777c11",
"mapbox-gl-style-spec": "mapbox/mapbox-gl-style-spec#15c3c90c5d6cb245734192f0244e002eb6747f7c",
"mapbox-gl-style-spec": "mapbox/mapbox-gl-style-spec#1f2b1bd1c3793b4ff33f4b19c9db01f2b7882418",
"mapbox-gl-supported": "^1.2.0",
"package-json-versionify": "^1.0.2",
"pbf": "^1.3.2",
Expand Down

0 comments on commit 69e1eb9

Please sign in to comment.