1
0
forked from MTSR/mapserver

overlay stub

This commit is contained in:
NatureFreshMilk 2019-02-04 15:22:56 +01:00
parent ca7415f8cc
commit 1ab065e0e5
2 changed files with 11 additions and 11 deletions

View File

@ -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
# 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
#go test -cpuprofile cpu.prof -memprofile mem.prof -bench . ./mapblockrenderer/
#go tool pprof cpu.prof
#top

View File

@ -15,26 +15,20 @@ var PlayerOverlay = L.LayerGroup.extend({
this.layerMgr = layerMgr;
this.wsChannel = wsChannel;
this.currentObjects = [];
this.currentObjects = []; //{obj:{}, marker: {}}
this.onLayerChange = this.onLayerChange.bind(this);
this.reDraw = this.reDraw.bind(this);
this.onMapMove = debounce(this.onMapMove.bind(this), 50);
this.wsChannel.addListener("minetest-info", this.onMinetestUpdate.bind(this));
},
onLayerChange: function(layer){
this.reDraw();
this.onMinetestUpdate = this.onMinetestUpdate.bind(this);
},
onMinetestUpdate: function(info){
//TODO
//TODO incremental update
},
reDraw: function(){
//TODO full update
var self = this;
this.clearLayers();
var mapLayer = this.layerMgr.getCurrentLayer()
@ -43,11 +37,13 @@ var PlayerOverlay = L.LayerGroup.extend({
onAdd: function(map) {
this.layerMgr.addListener(this.reDraw);
this.reDraw(true)
this.wsChannel.addListener("minetest-info", this.onMinetestUpdate);
this.reDraw();
},
onRemove: function(map) {
this.clearLayers();
this.layerMgr.removeListener(this.reDraw);
this.wsChannel.removeListener("minetest-info", this.onMinetestUpdate);
}
});