Merge pull request #177 from UDST/feature/expose-tile-components

Expose tile components and change payload of tile event
feature/threejs-update
Robin Hawkes 2016-09-19 17:21:15 +01:00 zatwierdzone przez GitHub
commit 819421b59d
5 zmienionych plików z 14 dodań i 5 usunięć

Wyświetl plik

@ -86,7 +86,9 @@ class Layer extends EventEmitter {
} }
// Must return a promise // Must return a promise
_onAdd(world) {} _onAdd(world) {
return Promise.resolve(this);
}
getPickingId() { getPickingId() {
if (this._world._engine._picking) { if (this._world._engine._picking) {

Wyświetl plik

@ -30,7 +30,9 @@ class LayerGroup extends Layer {
this._world.removeLayer(layer); this._world.removeLayer(layer);
} }
_onAdd(world) {} _onAdd(world) {
return Promise.resolve(this);
}
// Destroy the layers and remove them from the scene and memory // Destroy the layers and remove them from the scene and memory
destroy() { destroy() {

Wyświetl plik

@ -237,7 +237,8 @@ class GeoJSONTile extends Tile {
this._request = reqwest({ this._request = reqwest({
url: url, url: url,
type: 'json', type: 'json',
crossOrigin: true crossOrigin: true,
headers: this._options.headers
}).then(res => { }).then(res => {
// Clear request reference // Clear request reference
this._request = null; this._request = null;
@ -261,7 +262,7 @@ class GeoJSONTile extends Tile {
// Using this creates a huge amount of memory due to the quantity of tiles // Using this creates a huge amount of memory due to the quantity of tiles
this._geojsonLayer = GeoJSONClass(data, this._options); this._geojsonLayer = GeoJSONClass(data, this._options);
this._geojsonLayer.addTo(this._world).then(() => { this._geojsonLayer.addTo(this._world).then(() => {
this._mesh = this._geojsonLayer._object3D; this._mesh.add(this._geojsonLayer._object3D);
this._pickingMesh = this._geojsonLayer._pickingMesh; this._pickingMesh = this._geojsonLayer._pickingMesh;
// Free the GeoJSON memory as we don't need it // Free the GeoJSON memory as we don't need it

Wyświetl plik

@ -128,7 +128,7 @@ class TileLayer extends Layer {
}); });
// Emit event notifying of new tiles // Emit event notifying of new tiles
this.emit('tilesList', this._tileList.map((tile) => tile._tile)); this.emit('tilesList', this._tileList.map((tile) => tile));
} }
// Works out tiles in the view frustum and stores them in an array // Works out tiles in the view frustum and stores them in an array

Wyświetl plik

@ -4,10 +4,12 @@ import Controls from './controls/index';
import Geo from './geo/Geo.js'; import Geo from './geo/Geo.js';
import Layer, {layer} from './layer/Layer'; import Layer, {layer} from './layer/Layer';
import LayerGroup, {layerGroup} from './layer/LayerGroup';
import EnvironmentLayer, {environmentLayer} from './layer/environment/EnvironmentLayer'; import EnvironmentLayer, {environmentLayer} from './layer/environment/EnvironmentLayer';
import ImageTileLayer, {imageTileLayer} from './layer/tile/ImageTileLayer'; import ImageTileLayer, {imageTileLayer} from './layer/tile/ImageTileLayer';
import GeoJSONTileLayer, {geoJSONTileLayer} from './layer/tile/GeoJSONTileLayer'; import GeoJSONTileLayer, {geoJSONTileLayer} from './layer/tile/GeoJSONTileLayer';
import TopoJSONTileLayer, {topoJSONTileLayer} from './layer/tile/TopoJSONTileLayer'; import TopoJSONTileLayer, {topoJSONTileLayer} from './layer/tile/TopoJSONTileLayer';
import GeoJSONTile, {geoJSONTile} from './layer/tile/GeoJSONTile';
import GeoJSONLayer, {geoJSONLayer} from './layer/GeoJSONLayer'; import GeoJSONLayer, {geoJSONLayer} from './layer/GeoJSONLayer';
import TopoJSONLayer, {topoJSONLayer} from './layer/TopoJSONLayer'; import TopoJSONLayer, {topoJSONLayer} from './layer/TopoJSONLayer';
import GeoJSONWorkerLayer, {geoJSONWorkerLayer} from './layer/GeoJSONWorkerLayer'; import GeoJSONWorkerLayer, {geoJSONWorkerLayer} from './layer/GeoJSONWorkerLayer';
@ -39,6 +41,8 @@ const VIZI = {
imageTileLayer: imageTileLayer, imageTileLayer: imageTileLayer,
GeoJSONTileLayer: GeoJSONTileLayer, GeoJSONTileLayer: GeoJSONTileLayer,
geoJSONTileLayer: geoJSONTileLayer, geoJSONTileLayer: geoJSONTileLayer,
GeoJSONTile: GeoJSONTile,
geoJSONTile: geoJSONTile,
TopoJSONTileLayer: TopoJSONTileLayer, TopoJSONTileLayer: TopoJSONTileLayer,
topoJSONTileLayer: topoJSONTileLayer, topoJSONTileLayer: topoJSONTileLayer,
GeoJSONLayer: GeoJSONLayer, GeoJSONLayer: GeoJSONLayer,