Skip to content

Commit 5d3622c

Browse files
authored
ImageOverlayPlugin: Add docs, fix default values (#1537)
* ImageFormatPlugin: Use a higher base error to ensure child tile does not contain higher error than the root, causing unconditional refinement * ImageOverlayPlugin: Fix NaN generation for UVs * Update docs * Update docs
1 parent 1b3d800 commit 5d3622c

5 files changed

Lines changed: 429 additions & 31 deletions

File tree

src/three/plugins/API.md

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,231 @@ constructor(
130130
)
131131
```
132132

133+
## ImageOverlay
134+
135+
Base class for all image overlays. Provides the interface that `ImageOverlayPlugin` uses to
136+
fetch, lock, and release overlay textures.
137+
138+
139+
### .constructor
140+
141+
```js
142+
constructor(
143+
{
144+
opacity = 1: number,
145+
color = 0xffffff: number | Color,
146+
frame = null: Matrix4,
147+
preprocessURL = null: function,
148+
alphaMask = false: boolean,
149+
alphaInvert = false: boolean,
150+
}
151+
)
152+
```
153+
154+
## GeoJSONOverlay
155+
156+
_extends [`ImageOverlay`](#imageoverlay)_
157+
158+
Overlay that rasterizes a GeoJSON dataset onto 3D tile geometry. Features are drawn using the
159+
Canvas 2D API at the tile's native resolution. Per-feature style overrides can be provided via
160+
the `strokeStyle`, `fillStyle`, `strokeWidth`, and `pointRadius` properties on each GeoJSON
161+
feature's `properties` object.
162+
163+
164+
### .constructor
165+
166+
```js
167+
constructor(
168+
{
169+
geojson = null: Object,
170+
url = null: string,
171+
resolution = 256: number,
172+
pointRadius = 6: number,
173+
strokeStyle = 'white': string,
174+
strokeWidth = 2: number,
175+
fillStyle = 'rgba( 255, 255, 255, 0.5 )': string,
176+
opacity = 1: number,
177+
color = 0xffffff: number | Color,
178+
frame = null: Matrix4,
179+
preprocessURL = null: function,
180+
alphaMask = false: boolean,
181+
alphaInvert = false: boolean,
182+
}
183+
)
184+
```
185+
186+
## TiledImageOverlay
187+
188+
_extends [`ImageOverlay`](#imageoverlay)_
189+
190+
Base class for overlays backed by a tiled image source (XYZ, TMS, WMS, WMTS, etc.).
191+
Manages a `TiledImageSource` and a `RegionImageSource` that handles compositing
192+
multiple source tiles into a single texture per 3D tile region.
193+
194+
195+
## GoogleMapsOverlay
196+
197+
_extends [`TiledImageOverlay`](#tiledimageoverlay)_
198+
199+
Overlay that streams Google Maps 2D tile imagery on top of 3D tile geometry using the
200+
Google Maps Tile API.
201+
202+
203+
### .constructor
204+
205+
```js
206+
constructor(
207+
{
208+
apiToken?: string,
209+
sessionOptions?: Object,
210+
autoRefreshToken = false: boolean,
211+
logoUrl = null: string,
212+
opacity = 1: number,
213+
color = 0xffffff: number | Color,
214+
frame = null: Matrix4,
215+
preprocessURL = null: function,
216+
alphaMask = false: boolean,
217+
alphaInvert = false: boolean,
218+
}
219+
)
220+
```
221+
222+
## TMSTilesOverlay
223+
224+
_extends [`TiledImageOverlay`](#tiledimageoverlay)_
225+
226+
Overlay that renders TMS (Tile Map Service) image tiles on top of 3D tile geometry.
227+
See the [TMS specification](https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification).
228+
229+
230+
### .constructor
231+
232+
```js
233+
constructor(
234+
{
235+
url?: string,
236+
opacity = 1: number,
237+
color = 0xffffff: number | Color,
238+
frame = null: Matrix4,
239+
preprocessURL = null: function,
240+
alphaMask = false: boolean,
241+
alphaInvert = false: boolean,
242+
}
243+
)
244+
```
245+
246+
## WMSTilesOverlay
247+
248+
_extends [`TiledImageOverlay`](#tiledimageoverlay)_
249+
250+
Overlay that renders WMS (Web Map Service) image tiles on top of 3D tile geometry.
251+
See the [WMS specification](https://www.ogc.org/standard/wms/).
252+
253+
254+
### .constructor
255+
256+
```js
257+
constructor(
258+
{
259+
url?: string,
260+
layer?: string,
261+
crs?: string,
262+
format?: string,
263+
tileDimension = 256: number,
264+
styles?: string,
265+
version?: string,
266+
opacity = 1: number,
267+
color = 0xffffff: number | Color,
268+
frame = null: Matrix4,
269+
preprocessURL = null: function,
270+
alphaMask = false: boolean,
271+
alphaInvert = false: boolean,
272+
}
273+
)
274+
```
275+
276+
## WMTSTilesOverlay
277+
278+
_extends [`TiledImageOverlay`](#tiledimageoverlay)_
279+
280+
Overlay that renders WMTS (Web Map Tile Service) image tiles on top of 3D tile geometry.
281+
Pass a parsed capabilities object from `WMTSCapabilitiesLoader` or provide a URL template
282+
directly. See the [WMTS specification](https://www.ogc.org/standard/wmts/).
283+
284+
285+
### .constructor
286+
287+
```js
288+
constructor(
289+
{
290+
capabilities?: Object,
291+
layer?: string,
292+
tileMatrixSet?: string,
293+
style?: string,
294+
dimensions?: Object,
295+
opacity = 1: number,
296+
color = 0xffffff: number | Color,
297+
frame = null: Matrix4,
298+
preprocessURL = null: function,
299+
alphaMask = false: boolean,
300+
alphaInvert = false: boolean,
301+
}
302+
)
303+
```
304+
305+
## XYZTilesOverlay
306+
307+
_extends [`TiledImageOverlay`](#tiledimageoverlay)_
308+
309+
Overlay that renders XYZ/Slippy-map image tiles (e.g. OpenStreetMap) on top of 3D tile
310+
geometry. See the [Slippy map tilenames specification](https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames).
311+
312+
313+
### .constructor
314+
315+
```js
316+
constructor(
317+
{
318+
url?: string,
319+
levels = 20: number,
320+
tileDimension = 256: number,
321+
projection = 'EPSG:3857': string,
322+
opacity = 1: number,
323+
color = 0xffffff: number | Color,
324+
frame = null: Matrix4,
325+
preprocessURL = null: function,
326+
alphaMask = false: boolean,
327+
alphaInvert = false: boolean,
328+
}
329+
)
330+
```
331+
332+
## CesiumIonOverlay
333+
334+
_extends [`TiledImageOverlay`](#tiledimageoverlay)_
335+
336+
Overlay that streams imagery from a Cesium Ion asset. Supports Ion-hosted TMS assets as well
337+
as external asset types (Google 2D Maps, Bing Maps) that Ion proxies.
338+
339+
340+
### .constructor
341+
342+
```js
343+
constructor(
344+
{
345+
apiToken?: string,
346+
assetId?: number,
347+
autoRefreshToken = false: boolean,
348+
opacity = 1: number,
349+
color = 0xffffff: number | Color,
350+
frame = null: Matrix4,
351+
preprocessURL = null: function,
352+
alphaMask = false: boolean,
353+
alphaInvert = false: boolean,
354+
}
355+
)
356+
```
357+
133358
## DebugTilesPlugin
134359

135360
Plugin that adds visual debugging aids to a `TilesRenderer`: bounding-volume

src/three/plugins/images/ImageFormatPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ export class ImageFormatPlugin {
204204
asset: {
205205
version: '1.1'
206206
},
207-
geometricError: 1e5,
207+
geometricError: Infinity,
208208
root: {
209209
refine: 'REPLACE',
210-
geometricError: 1e5,
210+
geometricError: Infinity,
211211
boundingVolume: this.createBoundingVolume( 0, 0, - 1 ),
212212
children,
213213

0 commit comments

Comments
 (0)