Clean up Renderer (still uses bluejay)

This commit is contained in:
Christian Paul 2017-12-22 22:40:02 -08:00
parent f236f95383
commit bf8ebfd3df

View File

@ -12,7 +12,6 @@ const simplify = require('simplify-js');
const Canvas = require('./Canvas');
const LabelBuffer = require('./LabelBuffer');
const Styler = require('./Styler');
const Tile = require('./Tile');
const utils = require('./utils');
const config = require('./config');
@ -143,8 +142,7 @@ class Renderer {
}
_renderTiles(tiles) {
var drawn, feature, i, j, k, l, label, labels, layer, layerId, len, len1, len2, len3, ref, ref1, tile;
drawn = {};
var feature, i, j, k, labels, layer, layerId, len, len1, len2, ref, ref1, tile;
labels = [];
ref = this._generateDrawOrder(tiles[0].xyz.z);
for (i = 0, len = ref.length; i < len; i++) {
@ -204,7 +202,7 @@ class Renderer {
}
switch (feature.style.type) {
case 'line':
case 'line': {
let width = feature.style.paint['line-width'];
if (width instanceof Object) {
// TODO: apply the correct zoom based value
@ -215,13 +213,15 @@ class Renderer {
this.canvas.polyline(points, feature.color, width);
}
break;
case 'fill':
}
case 'fill': {
points = feature.points.map((p) => {
return this._scaleAndReduce(tile, feature, p, scale, false);
});
this.canvas.polygon(points, feature.color);
break;
case 'symbol':
}
case 'symbol': {
const text = feature.label || (genericSymbol = config.poiMarker);
if (this._seen[text] && !genericSymbol) {
@ -247,6 +247,8 @@ class Renderer {
if (placed) {
this._seen[text] = true;
}
break;
}
}
return true;
}