forked from MTSR/mapserver
overlay stub
This commit is contained in:
parent
ca7415f8cc
commit
1ab065e0e5
@ -30,3 +30,7 @@ build: $(STATIC_VFS) $(OUT_DIR)
|
|||||||
GOARCH=amd64 GOOS=windows CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 go build -o $(OUT_DIR)/mapserver-windows-x86-64.exe
|
GOARCH=amd64 GOOS=windows CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 go build -o $(OUT_DIR)/mapserver-windows-x86-64.exe
|
||||||
# apt install gcc-5-arm-linux-gnueabihf, TODO: container
|
# apt install gcc-5-arm-linux-gnueabihf, TODO: container
|
||||||
GOARCH=arm GOARM=7 CC=arm-linux-gnueabihf-gcc-5 CGO_ENABLED=1 go build $(GO_LDFLAGS) -o $(OUT_DIR)/mapserver-linux-arm
|
GOARCH=arm GOARM=7 CC=arm-linux-gnueabihf-gcc-5 CGO_ENABLED=1 go build $(GO_LDFLAGS) -o $(OUT_DIR)/mapserver-linux-arm
|
||||||
|
|
||||||
|
#go test -cpuprofile cpu.prof -memprofile mem.prof -bench . ./mapblockrenderer/
|
||||||
|
#go tool pprof cpu.prof
|
||||||
|
#top
|
||||||
|
@ -15,26 +15,20 @@ var PlayerOverlay = L.LayerGroup.extend({
|
|||||||
this.layerMgr = layerMgr;
|
this.layerMgr = layerMgr;
|
||||||
this.wsChannel = wsChannel;
|
this.wsChannel = wsChannel;
|
||||||
|
|
||||||
this.currentObjects = [];
|
this.currentObjects = []; //{obj:{}, marker: {}}
|
||||||
|
|
||||||
this.onLayerChange = this.onLayerChange.bind(this);
|
|
||||||
this.reDraw = this.reDraw.bind(this);
|
this.reDraw = this.reDraw.bind(this);
|
||||||
this.onMapMove = debounce(this.onMapMove.bind(this), 50);
|
this.onMapMove = debounce(this.onMapMove.bind(this), 50);
|
||||||
|
this.onMinetestUpdate = this.onMinetestUpdate.bind(this);
|
||||||
this.wsChannel.addListener("minetest-info", this.onMinetestUpdate.bind(this));
|
|
||||||
},
|
|
||||||
|
|
||||||
onLayerChange: function(layer){
|
|
||||||
this.reDraw();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onMinetestUpdate: function(info){
|
onMinetestUpdate: function(info){
|
||||||
//TODO
|
//TODO incremental update
|
||||||
},
|
},
|
||||||
|
|
||||||
reDraw: function(){
|
reDraw: function(){
|
||||||
|
//TODO full update
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
this.clearLayers();
|
this.clearLayers();
|
||||||
|
|
||||||
var mapLayer = this.layerMgr.getCurrentLayer()
|
var mapLayer = this.layerMgr.getCurrentLayer()
|
||||||
@ -43,11 +37,13 @@ var PlayerOverlay = L.LayerGroup.extend({
|
|||||||
|
|
||||||
onAdd: function(map) {
|
onAdd: function(map) {
|
||||||
this.layerMgr.addListener(this.reDraw);
|
this.layerMgr.addListener(this.reDraw);
|
||||||
this.reDraw(true)
|
this.wsChannel.addListener("minetest-info", this.onMinetestUpdate);
|
||||||
|
this.reDraw();
|
||||||
},
|
},
|
||||||
|
|
||||||
onRemove: function(map) {
|
onRemove: function(map) {
|
||||||
this.clearLayers();
|
this.clearLayers();
|
||||||
this.layerMgr.removeListener(this.reDraw);
|
this.layerMgr.removeListener(this.reDraw);
|
||||||
|
this.wsChannel.removeListener("minetest-info", this.onMinetestUpdate);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user