layer control wip
This commit is contained in:
parent
65d31172bf
commit
68114bc460
20
static/js/map/LayerControl.js
Normal file
20
static/js/map/LayerControl.js
Normal 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;
|
||||
}
|
||||
});
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user