mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-18 15:54:22 +00:00
should not set layerIds when querying unknown mapStyle (#423)
This commit is contained in:
parent
9daeddaa3f
commit
4d06d10db9
@ -2,7 +2,7 @@ import {Map} from 'immutable';
|
||||
import diffStyles from './diff-styles';
|
||||
|
||||
export function getInteractiveLayerIds(mapStyle) {
|
||||
let interactiveLayerIds = [];
|
||||
let interactiveLayerIds = null;
|
||||
|
||||
if (Map.isMap(mapStyle) && mapStyle.has('layers')) {
|
||||
interactiveLayerIds = mapStyle.get('layers')
|
||||
|
||||
@ -19,7 +19,7 @@ const TEST_STYLE_IMMUTABLE = Immutable.fromJS(TEST_STYLE_JS);
|
||||
|
||||
test('getInteractiveLayerIds#String style', t => {
|
||||
const layers = getInteractiveLayerIds(TEST_STYLE_STRING);
|
||||
t.equal(deepEqual(layers, []), true, 'got expected layer ids');
|
||||
t.notOk(layers, 'should not return layer ids');
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user