Class: TilesKeeper

TilesKeeper(osm, path)

new TilesKeeper(osm, path)

Parameters:
Name Type Description
osm object

OSM3, provid function addTile(mesh), center() and addTileMesh()

path string

workder js path O3_workerPath = "tiles-keeper.js", use webpack.config?

Source:

Methods

(static) collectOsmTiles(tkeeper, dir, c0, a) → {object}

If xyz is not in tiles, add new xyz to tiles.

Parameters:
Name Type Description
tkeeper tilesKeeper

{z: {x0: {y00: world00, ...}, {x1: {y10: world10, ...}, ...}}}

dir vec3

[x, y, z] dir

c0 vec3

[x, y, z] center / eye

a float

radius

Source:
Returns:

tiles

Type
object

destroy()

Source:

findTiles(osmTiles, camWorld:
, camera, castMatrix)
→ {object}

Find osm tiles according to camera position.

Parameters:
Name Type Description
osmTiles object

osm tile collection {z: {x: {y: tileInf}}}
tileInf: lon, lat, mesh, world

camWorld:
object

target: lookAt, {lat, lon, h = 0}
position: eye position, {lat, lon, h}
z: osm z

camera THREE.Camera
castMatrix THREE.Matrix4
Source:
Returns:

tiles {z: {x: {y: {tileInf}}}}

Type
object

getile()

Source:

loadOsmTilesAsync()

Source:

loasOsmAsync(xyz)

Asynchronously start an OSM tile loading - post message to worker. This function always use the first worker.

Parameters:
Name Type Description
xyz Array.<int>

[x,y,z]

Source:

onOsmReady()

on tile loaded

Source:

ping()

Source:

setile()

Source:

setOsmTexture(xyz, blobUrl)

Set loaded osm texture to the ground tile geometry For three.js texture loader, see https://threejs.org/docs/index.html#api/en/loaders/TextureLoader TODO put into work?

Parameters:
Name Type Description
xyz object

osm {x, y, z}

blobUrl Blob

should be a blob url - ready for building texture

Source:

update()

Source: