diff --git a/src/annotationLayer.js b/src/annotationLayer.js index 8c4a9b80bb..87e29bcb8a 100644 --- a/src/annotationLayer.js +++ b/src/annotationLayer.js @@ -1012,8 +1012,8 @@ var annotationLayer = function (args) { return m_this; } if (!m_labelFeature) { - var renderer = registry.rendererForFeatures(['text']); - if (renderer !== m_this.renderer().api()) { + if (!(registry.registries.features[m_this.rendererName()] || {}).text) { + var renderer = registry.rendererForFeatures(['text']); m_labelLayer = registry.createLayer('feature', m_this.map(), {renderer: renderer}); m_this.addChild(m_labelLayer); m_labelLayer._update(); diff --git a/src/registry.js b/src/registry.js index f6183f1af1..0f664c6b3d 100644 --- a/src/registry.js +++ b/src/registry.js @@ -459,4 +459,15 @@ util.rendererForAnnotations = function (annotationList) { return util.rendererForFeatures(util.featuresForAnnotations(annotationList)); }; +/* Expose the various registries so that the can be examined to see what + * things are registered. */ +util.registries = { + annotations: annotations, + features: features, + featureCapabilities: featureCapabilities, + fileReaders: fileReaders, + layers: layers, + renderers: renderers +}; + module.exports = util; diff --git a/tests/cases/registry.js b/tests/cases/registry.js index 98a171075f..a39f06b233 100644 --- a/tests/cases/registry.js +++ b/tests/cases/registry.js @@ -25,5 +25,10 @@ describe('geo.registry', function () { expect(geo.rendererForFeatures(['point'])).toBe('d3'); restoreVGLRenderer(); }); + it('expose registries', function () { + expect(geo.registries.unknown).toBe(undefined); + expect(geo.registries.annotations).not.toBe(undefined); + expect(geo.registries.features).not.toBe(undefined); + }); }); }); diff --git a/tutorials/common/tutorials.js b/tutorials/common/tutorials.js index 21e5e01e7b..5ee61256d4 100644 --- a/tutorials/common/tutorials.js +++ b/tutorials/common/tutorials.js @@ -192,8 +192,8 @@ function process_block_debounce(selector, debounce) { processBlockInfo.lastelem = selector; if (!debounce) { process_block(selector); + return; } - return; } processBlockInfo.timer = window.setTimeout(function () { process_block(processBlockInfo.lastelem);