1
0
forked from MTSR/mapserver
mapserver/public/js/map/WorldInfoDisplay.js

21 lines
533 B
JavaScript
Raw Normal View History

2019-04-04 11:19:29 +03:00
/* exported WorldInfoDisplay */
import WorldStats from '../components/WorldStats.js';
2019-05-14 17:03:21 +03:00
2019-02-04 23:25:30 +03:00
// coord display
2019-06-11 15:16:41 +03:00
export default L.Control.extend({
2019-02-04 23:25:30 +03:00
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){
m.render(div, WorldStats(info));
2019-02-04 23:25:30 +03:00
});
return div;
}
});