mirror of
https://github.com/maputnik/editor.git
synced 2026-01-08 06:20:00 +00:00
Remove unused colorize funcs
This commit is contained in:
14
src/style.js
14
src/style.js
@@ -2,7 +2,6 @@ import React from 'react';
|
|||||||
import Immutable from 'immutable'
|
import Immutable from 'immutable'
|
||||||
import spec from 'mapbox-gl-style-spec/reference/latest.min.js'
|
import spec from 'mapbox-gl-style-spec/reference/latest.min.js'
|
||||||
import diffJSONStyles from 'mapbox-gl-style-spec/lib/diff'
|
import diffJSONStyles from 'mapbox-gl-style-spec/lib/diff'
|
||||||
import randomColor from 'randomcolor'
|
|
||||||
|
|
||||||
// Standard JSON to Immutable conversion except layers
|
// Standard JSON to Immutable conversion except layers
|
||||||
// are stored in an OrderedMap to make lookups id fast
|
// are stored in an OrderedMap to make lookups id fast
|
||||||
@@ -70,20 +69,7 @@ function toJSON(mapStyle) {
|
|||||||
return jsonStyle
|
return jsonStyle
|
||||||
}
|
}
|
||||||
|
|
||||||
export function colorizeLayers(layers) {
|
|
||||||
return layers.map(layer => {
|
|
||||||
if(!layer.metadata) {
|
|
||||||
layer.metadata = {}
|
|
||||||
}
|
|
||||||
if(!"maputnik:color" in layer.metadata) {
|
|
||||||
layer.metadata["maputnik:color"] = randomColor()
|
|
||||||
}
|
|
||||||
return layer
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
colorizeLayers,
|
|
||||||
toJSON,
|
toJSON,
|
||||||
fromJSON,
|
fromJSON,
|
||||||
diffStyles,
|
diffStyles,
|
||||||
|
|||||||
Reference in New Issue
Block a user