forked from MTSR/mapserver
use m.render for world info
This commit is contained in:
parent
2bb8319673
commit
c57436ddf8
@ -1,5 +1,9 @@
|
||||
/* exported WorldInfoDisplay */
|
||||
|
||||
var worldInfoRender = function(info){
|
||||
return "Lag: " + parseInt(info.max_lag*10)/10 + " Time: " + parseInt(info.time)/1000;
|
||||
}
|
||||
|
||||
// coord display
|
||||
var WorldInfoDisplay = L.Control.extend({
|
||||
initialize: function(wsChannel, opts) {
|
||||
@ -11,7 +15,7 @@ var WorldInfoDisplay = L.Control.extend({
|
||||
var div = L.DomUtil.create('div', 'leaflet-bar leaflet-custom-display');
|
||||
|
||||
this.wsChannel.addListener("minetest-info", function(info){
|
||||
div.innerHTML = "Lag: " + parseInt(info.max_lag*10)/10 + " Time: " + parseInt(info.time)/1000;
|
||||
m.render(div, worldInfoRender(info))
|
||||
});
|
||||
|
||||
return div;
|
||||
|
Loading…
Reference in New Issue
Block a user