Skip to content

Commit 1a1c6e1

Browse files
authored
Fix types, always use mercator for XYZ tiles (#1272)
* Fix types, always use mercator for XYZ tiles * ImageFormatPlugin:Add url parameters
1 parent ddd3a0c commit 1a1c6e1

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/three/plugins/images/DeepZoomImagePlugin.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export class DeepZoomImagePlugin {
33
constructor( options: {
44
center?: boolean,
55
useRecommendedSettings?: boolean,
6+
url?: string,
67
} );
78

89
}

src/three/plugins/images/EPSGTilesPlugin.d.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ export class XYZTilesPlugin {
55
center?: boolean,
66
levels?: number,
77
tileDimension?: number,
8-
projection?: 'ellipsoid' | 'planar',
8+
shape?: 'ellipsoid' | 'planar',
99
bounds?: [ number, number, number, number ],
1010
useRecommendedSettings?: boolean,
11+
url?: string,
1112
} );
1213

1314
}
@@ -16,8 +17,9 @@ export class TMSTilesPlugin {
1617

1718
constructor( options: {
1819
center?: boolean,
19-
projection?: 'ellipsoid' | 'planar',
20+
shape?: 'ellipsoid' | 'planar',
2021
useRecommendedSettings?: boolean,
22+
url?: string,
2123
} );
2224

2325
}
@@ -28,7 +30,7 @@ export class WMTSTilesPlugin {
2830
center?: boolean,
2931
levels?: number,
3032
tileDimension?: number,
31-
projection?: 'ellipsoid' | 'planar',
33+
shape?: 'ellipsoid' | 'planar',
3234
bounds?: [ number, number, number, number ],
3335
useRecommendedSettings?: boolean,
3436
} );

src/three/plugins/images/EPSGTilesPlugin.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export class XYZTilesPlugin extends EllipsoidProjectionTilesPlugin {
1414
const {
1515
levels,
1616
tileDimension,
17-
projection,
1817
bounds,
1918
url,
2019
...rest
@@ -23,7 +22,7 @@ export class XYZTilesPlugin extends EllipsoidProjectionTilesPlugin {
2322
super( rest );
2423

2524
this.name = 'XYZ_TILES_PLUGIN';
26-
this.imageSource = new XYZImageSource( { url, levels, tileDimension, projection, bounds } );
25+
this.imageSource = new XYZImageSource( { url, levels, tileDimension, bounds } );
2726

2827
}
2928

src/three/plugins/images/sources/XYZImageSource.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ export class XYZImageSource extends TiledImageSource {
1010
const {
1111
levels = 20,
1212
tileDimension = 256,
13-
projection = 'EPSG:3857',
1413
url = null,
1514
} = options;
1615

1716
this.tileDimension = tileDimension;
1817
this.levels = levels;
19-
this.projection = projection;
2018
this.url = url;
2119

2220
}
@@ -33,10 +31,10 @@ export class XYZImageSource extends TiledImageSource {
3331
init() {
3432

3533
// transform the url
36-
const { tiling, tileDimension, levels, projection, url } = this;
34+
const { tiling, tileDimension, levels, url } = this;
3735

3836
tiling.flipY = ! /{\s*reverseY|-\s*y\s*}/g.test( url );
39-
tiling.setProjection( new ProjectionScheme( projection ) );
37+
tiling.setProjection( new ProjectionScheme( 'EPSG:3857' ) );
4038
tiling.setContentBounds( ...tiling.projection.getBounds() );
4139
tiling.generateLevels( levels, tiling.projection.tileCountX, tiling.projection.tileCountY, {
4240
tilePixelWidth: tileDimension,

0 commit comments

Comments
 (0)