Skip to content

Commit

Permalink
use delta to decide if it's pyramid tiles more precisely
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzhenn committed May 30, 2024
1 parent f04b57f commit e3b93c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/map/spatial-reference/SpatialReference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,10 @@ export default class SpatialReference {
this._resolutions = resolutions;
this._pyramid = true;
if (this._pyramid) {
const delta = 1E4;
for (let i = 0; i < resolutions.length; i++) {
if (resolutions[i] && resolutions[i - 1]) {
if (resolutions[i - 1] / resolutions[i] !== 2) {
if (Math.round(resolutions[i - 1] / resolutions[i] * delta) / delta !== 2) {
this._pyramid = false;
break;
}
Expand Down

0 comments on commit e3b93c9

Please sign in to comment.