mirror of https://gitee.com/antv-l7/antv-l7
feat(worker): worker Source
This commit is contained in:
parent
3bbdb5ec88
commit
40947c04ec
|
@ -1,6 +1,6 @@
|
||||||
import Base from '../core/base';
|
import Base from '../core/base';
|
||||||
|
|
||||||
export default class VectorTileSource extends Base{
|
export default class VectorTileSource extends Base {
|
||||||
constructor(cfg, workerController) {
|
constructor(cfg, workerController) {
|
||||||
super({
|
super({
|
||||||
type: 'vector',
|
type: 'vector',
|
||||||
|
@ -10,10 +10,10 @@ export default class VectorTileSource extends Base{
|
||||||
}
|
}
|
||||||
loadTile(tile, callback) {
|
loadTile(tile, callback) {
|
||||||
const params = {
|
const params = {
|
||||||
id: tile,
|
id: tile
|
||||||
};
|
};
|
||||||
this.workerController.send('loadTile', params, done.bind(this));
|
this.workerController.send('loadTile', params, done.bind(this));
|
||||||
function done(err,data) {
|
function done(err, data) {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,9 +33,9 @@ export default class VectorTileSource extends Base {
|
||||||
console.log(params);
|
console.log(params);
|
||||||
const workerTile = new WorkerTile(params);
|
const workerTile = new WorkerTile(params);
|
||||||
workerTile.abort = this.loadVectorData(params, (err, response) => {
|
workerTile.abort = this.loadVectorData(params, (err, response) => {
|
||||||
|
|
||||||
})
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
abortTile() {
|
abortTile() {
|
||||||
|
|
|
@ -13,7 +13,7 @@ export default class Actor {
|
||||||
this.mapId = mapId;
|
this.mapId = mapId;
|
||||||
this.callbacks = {};
|
this.callbacks = {};
|
||||||
this.callbackID = 0;
|
this.callbackID = 0;
|
||||||
bindAll(['receive'], this);
|
bindAll([ 'receive' ], this);
|
||||||
this.target.addEventListener('message', this.receive, false);
|
this.target.addEventListener('message', this.receive, false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,8 @@ export default class Worker {
|
||||||
loadTile(cfg) {
|
loadTile(cfg) {
|
||||||
|
|
||||||
}
|
}
|
||||||
setLayers(mapId, layercfgs,callback) {
|
setLayers(mapId, layercfgs, callback) {
|
||||||
|
|
||||||
}
|
}
|
||||||
updateLayers(id, params, callback) {
|
updateLayers(id, params, callback) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue