1
0
forked from MTSR/mapserver
mapserver/server/static/js/WorldInfoDisplay.js

20 lines
549 B
JavaScript
Raw Normal View History

2019-04-04 11:19:29 +03:00
/* exported WorldInfoDisplay */
2019-02-04 23:25:30 +03:00
// coord display
var WorldInfoDisplay = L.Control.extend({
initialize: function(wsChannel, opts) {
L.Control.prototype.initialize.call(this, opts);
this.wsChannel = wsChannel;
},
2019-04-04 11:19:29 +03:00
onAdd: function() {
2019-02-04 23:25:30 +03:00
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;
});
return div;
}
});