|
@@ 254-263 (lines=10) @@
|
| 251 |
|
// create a new copy of this object, don't just change existing one |
| 252 |
|
$bounds = clone $bounds; |
| 253 |
|
|
| 254 |
|
if ($this->spanBoundsLat) { |
| 255 |
|
// workaround for crossover bounds being rounded too aggressively |
| 256 |
|
if ($bounds->sw->latitude == 0) { |
| 257 |
|
$bounds->sw->latitude += 180; |
| 258 |
|
} |
| 259 |
|
|
| 260 |
|
$neLat = max(180 + $bounds->ne->latitude, 180 + $bounds->sw->latitude); |
| 261 |
|
$bounds->sw->latitude = $bounds->ne->latitude; |
| 262 |
|
$bounds->ne->latitude = $neLat; |
| 263 |
|
} |
| 264 |
|
if ($this->spanBoundsLng) { |
| 265 |
|
// workaround for crossover bounds being rounded too aggressively |
| 266 |
|
if ($bounds->sw->longitude == 0) { |
|
@@ 264-273 (lines=10) @@
|
| 261 |
|
$bounds->sw->latitude = $bounds->ne->latitude; |
| 262 |
|
$bounds->ne->latitude = $neLat; |
| 263 |
|
} |
| 264 |
|
if ($this->spanBoundsLng) { |
| 265 |
|
// workaround for crossover bounds being rounded too aggressively |
| 266 |
|
if ($bounds->sw->longitude == 0) { |
| 267 |
|
$bounds->sw->longitude += 360; |
| 268 |
|
} |
| 269 |
|
|
| 270 |
|
$neLng = max(360 + $bounds->ne->longitude, 360 + $bounds->sw->longitude); |
| 271 |
|
$bounds->sw->longitude = $bounds->ne->longitude; |
| 272 |
|
$bounds->ne->longitude = $neLng; |
| 273 |
|
} |
| 274 |
|
|
| 275 |
|
return $bounds; |
| 276 |
|
} |