Compare commits
2 Commits
master
...
optimized-
Author | SHA1 | Date | |
---|---|---|---|
|
6f351dd5fb | ||
|
de5ad67a38 |
10
Makefile
10
Makefile
@ -9,20 +9,10 @@ JS_CLIENT_FILES= lib/torque/*.js \
|
||||
lib/torque/leaflet/canvas_layer.js \
|
||||
lib/torque/leaflet/torque.js
|
||||
|
||||
all: dist/torque.js dist/torque.full.js
|
||||
|
||||
dist/torque.full.uncompressed.js: dist_folder dist/torque.uncompressed.js
|
||||
$(BROWSERIFY) lib/torque/index.js --standalone torque > dist/torque.full.uncompressed.js
|
||||
|
||||
dist/torque.full.js: dist_folder dist/torque.full.uncompressed.js
|
||||
$(UGLIFYJS) dist/torque.full.uncompressed.js > dist/torque.full.js
|
||||
|
||||
dist/torque.uncompressed.js: dist_folder $(JS_CLIENT_FILES)
|
||||
$(BROWSERIFY) lib/torque/index.js --no-bundle-external --standalone torque > dist/torque.uncompressed.js
|
||||
|
||||
dist/torque.js: dist_folder dist/torque.uncompressed.js
|
||||
$(UGLIFYJS) dist/torque.uncompressed.js > dist/torque.js
|
||||
|
||||
dist_folder:
|
||||
mkdir -p dist
|
||||
|
||||
|
@ -243,6 +243,7 @@ var Filters = require('./torque_filters');
|
||||
_renderTile: function(tile, key, frame_offset, sprites, shader, shaderVars) {
|
||||
if (!this._canvas) return;
|
||||
|
||||
shaderVars = shaderVars || { zoom: tile.z, 'frame-offset': frame_offset };
|
||||
var prof = Profiler.metric('torque.renderer.point.renderTile').start();
|
||||
var ctx = this._ctx;
|
||||
var blendMode = compop2canvas(shader.eval('comp-op')) || this.options.blendmode;
|
||||
@ -255,7 +256,11 @@ var Filters = require('./torque_filters');
|
||||
}
|
||||
var tileMax = this.options.resolution * (this.TILE_SIZE/this.options.resolution - 1)
|
||||
var activePixels = tile.timeCount[key];
|
||||
var anchor = this.options.resolution/2;
|
||||
var anchor = this.options.resolution >> 1;
|
||||
if(this._style){
|
||||
var adjustmentFactor = this._style["marker-width"];
|
||||
var adjustmentFactorAnchored = adjustmentFactor + anchor;
|
||||
}
|
||||
if (activePixels) {
|
||||
var pixelIndex = tile.timeIndex[key];
|
||||
for(var p = 0; p < activePixels; ++p) {
|
||||
@ -264,12 +269,12 @@ var Filters = require('./torque_filters');
|
||||
if (c) {
|
||||
var sp = sprites[c];
|
||||
if (sp === undefined) {
|
||||
sp = sprites[c] = this.generateSprite(shader, c, torque.extend({ zoom: tile.z, 'frame-offset': frame_offset }, shaderVars));
|
||||
sp = sprites[c] = this.generateSprite(shader, c, shaderVars);
|
||||
}
|
||||
if (sp) {
|
||||
var x = tile.x[posIdx]- (sp.width >> 1) + anchor;
|
||||
var x = tile.x[posIdx]- adjustmentFactorAnchored;
|
||||
var y = tileMax - tile.y[posIdx] + anchor; // flip mercator
|
||||
ctx.drawImage(sp, x, y - (sp.height >> 1));
|
||||
ctx.drawImage(sp, x, y - adjustmentFactor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user