Given a Mapbox tile source and a layer-name, how do I know this layer's type is (point, line, polygon)?
I want know the feature type ahead of time before I add the layer to a map (with map.addLayer
)
if (layer-type 'point'){
// for point only
map.addLayer({
type: circle
}
} else {
// for both lineString and polygon
map.addLayer({
type: line
}
}