1
0
forked from MTSR/mapserver
mapserver/static/js/map/TopRightControl.js

28 lines
600 B
JavaScript
Raw Normal View History

2019-09-18 12:53:58 +03:00
import SearchInput from '../components/SearchInput.js';
import LayerSelector from '../components/LayerSelector.js';
import config from '../config.js';
const Component = {
view: function(){
const cfg = config.get();
return m("div", [
cfg.enablesearch ? m(SearchInput) : null,
m(LayerSelector)
2019-09-19 08:33:14 +03:00
]);
2019-09-18 12:53:58 +03:00
}
2019-09-19 08:33:14 +03:00
};
2019-09-18 12:53:58 +03:00
export default L.Control.extend({
initialize: function(wsChannel, opts) {
L.Control.prototype.initialize.call(this, opts);
},
onAdd: function() {
var div = L.DomUtil.create('div');
m.mount(div, Component);
return div;
}
});