should not set layerIds when querying unknown mapStyle (#423)

This commit is contained in:
Xiaoji Chen 2017-12-09 16:07:46 -08:00 committed by GitHub
parent 9daeddaa3f
commit 4d06d10db9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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')

View File

@ -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();
});