Skip to content

Commit

Permalink
Merge branch 'master' into ignore-gl-line-z-values
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey authored Jun 1, 2018
2 parents 04074f7 + 8e790de commit 1d3c304
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/annotationLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
11 changes: 11 additions & 0 deletions src/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
5 changes: 5 additions & 0 deletions tests/cases/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
});
2 changes: 1 addition & 1 deletion tutorials/common/tutorials.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1d3c304

Please sign in to comment.