Skip to content

Commit 5acdd62

Browse files
committed
Fix : Wrong bounding box values
1 parent dc0f37f commit 5acdd62

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/MapData.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,15 @@ public function __construct(LatLng $centerMap, int $zoom, XY $outputSize)
189189
);
190190
$this->latLngTopRight = new LatLng(
191191
static::tilePxToLat($this->mapCropTopLeft->getY(), $this->tileTopLeft->getY(), $zoom),
192-
static::tilePxToLng($this->mapCropBottomRight->getX(), $this->tileBottomRight->getX(), $zoom)
192+
static::tilePxToLng(256 - $this->mapCropBottomRight->getX(), $this->tileBottomRight->getX(), $zoom)
193193
);
194194
$this->latLngBottomLeft = new LatLng(
195-
static::tilePxToLat($this->mapCropBottomRight->getY(), $this->tileBottomRight->getY(), $zoom),
195+
static::tilePxToLat(256 - $this->mapCropBottomRight->getY(), $this->tileBottomRight->getY(), $zoom),
196196
static::tilePxToLng($this->mapCropTopLeft->getX(), $this->tileTopLeft->getX(), $zoom)
197197
);
198198
$this->latLngBottomRight = new LatLng(
199-
static::tilePxToLat($this->mapCropBottomRight->getY(), $this->tileBottomRight->getY(), $zoom),
200-
static::tilePxToLng($this->mapCropBottomRight->getX(), $this->tileBottomRight->getX(), $zoom)
199+
static::tilePxToLat(256 - $this->mapCropBottomRight->getY(), $this->tileBottomRight->getY(), $zoom),
200+
static::tilePxToLng(256 - $this->mapCropBottomRight->getX(), $this->tileBottomRight->getX(), $zoom)
201201
);
202202
}
203203

0 commit comments

Comments
 (0)