Highlight selected layer more #62

This commit is contained in:
Lukas Martinelli
2017-01-25 13:23:54 +01:00
parent c837179f71
commit 3f262885ca
4 changed files with 13 additions and 6 deletions
+8 -4
View File
@@ -1,6 +1,3 @@
import randomColor from 'randomcolor'
import Color from 'color'
import stylegen from 'mapbox-gl-inspect/lib/stylegen'
import colors from 'mapbox-gl-inspect/lib/colors'
@@ -8,6 +5,12 @@ export function colorHighlightedLayer(layer) {
if(!layer || layer.type === 'background' || layer.type === 'raster') return null
function changeLayer(l) {
if(l.type === 'circle') {
l.paint['circle-radius'] = 3
} else if(l.type === 'line') {
l.paint['line-width'] = 2
}
if(layer.filter) {
l.filter = layer.filter
} else {
@@ -17,7 +20,8 @@ export function colorHighlightedLayer(layer) {
return l
}
const color = colors.brightColor(layer.id, 1)
const sourceLayerId = layer['source-layer'] || ''
const color = colors.brightColor(sourceLayerId, 1)
const layers = []
if(layer.type === "fill" || layer.type === 'fill-extrusion') {