Skip to content

Commit bb2821a

Browse files
committed
Merge pull request #1 from monfera/master
Instead of dividing by 256 for vertex calculation, we apply a view that ...
2 parents 0fd666a + 098b5e0 commit bb2821a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

threejs-layer.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ ThreejsLayer.prototype.initialize = function(options){
9191

9292
this.options = options;
9393

94-
this.camera = new THREE.OrthographicCamera(0, 1, 0, 1, -3000, 3000);
94+
this.camera = new THREE.OrthographicCamera(0, 255, 0, 255, -3000, 3000);
9595
this.camera.position.z = 1000;
9696

9797
this.scene = new THREE.Scene();
@@ -216,8 +216,8 @@ ThreejsLayer.prototype.update = function() {
216216

217217
this.resize();
218218

219-
this.camera.position.x = offset.x / 256 ;
220-
this.camera.position.y = offset.y / 256;
219+
this.camera.position.x = offset.x;
220+
this.camera.position.y = offset.y;
221221

222222
this.camera.scale.x = this.width / 256 / scale;
223223
this.camera.scale.y = this.height / 256 / scale;
@@ -265,9 +265,9 @@ ThreejsLayer.prototype.fromLatLngToVertex = function(latLng) {
265265
point = projection.fromLatLngToPoint(latLng),
266266
vertex = new THREE.Vector3();
267267

268-
vertex.x = point.x / 256;
269-
vertex.y = point.y / 256;
268+
vertex.x = point.x;
269+
vertex.y = point.y;
270270
vertex.z = 0;
271271

272272
return vertex;
273-
};
273+
};

0 commit comments

Comments
 (0)