Skip to content

Commit

Permalink
fix(clustering): get correct viewport box
Browse files Browse the repository at this point in the history
fix #54
  • Loading branch information
Wykks committed Sep 9, 2018
1 parent 063f67c commit a864d3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions projects/ngx-mapbox-gl/src/lib/map/map.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,8 @@ export class MapService {

getCurrentViewportBbox(): BBox {
const canvas = this.mapInstance.getCanvas();
const w = canvas.width;
const h = canvas.height;
const w = parseInt(canvas.style.width!, 10);
const h = parseInt(canvas.style.height!, 10);
const upLeft = this.mapInstance.unproject([0, 0]).toArray();
const upRight = this.mapInstance.unproject([w, 0]).toArray();
const downRight = this.mapInstance.unproject([w, h]).toArray();
Expand Down

0 comments on commit a864d3f

Please sign in to comment.