layer control wip

This commit is contained in:
NatureFreshMilk 2019-09-18 08:42:11 +02:00
parent 65d31172bf
commit 68114bc460
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,20 @@
const Component = {
view: function(){
return m("select", {
class: "form-control"
},[
m("option", { value: "Ground" }, "Ground"),
m("option", { value: "Sky" }, "Sky")
]
);
}
};
export default L.Control.extend({
onAdd: function() {
var div = L.DomUtil.create('div');
m.mount(div, Component);
return div;
}
});

View File

@ -3,6 +3,7 @@ import SimpleCRS from './SimpleCRS.js';
import CoordinatesDisplay from './CoordinatesDisplay.js';
import WorldInfoDisplay from './WorldInfoDisplay.js';
import SearchControl from './SearchControl.js';
import LayerControl from './LayerControl.js';
import Overlaysetup from './Overlaysetup.js';
import CustomOverlay from './CustomOverlay.js';
import layerManager from './LayerManager.js';
@ -38,6 +39,8 @@ export function createMap(node, layerId, zoom, lat, lon){
new SearchControl(wsChannel, { position: 'topright' }).addTo(map);
}
new LayerControl({ position: 'topright' }).addTo(map);
//layer control
L.control.layers(layerManager.layerObjects, overlays, { position: "topright" }).addTo(map);