Create menu bar
- Menu
var control1 = new longdo.MenuBar({ button: [ { label: 'first', value: 1 }, { label: 'second', value: 2 } ], change: menuChange }); map.Ui.add(control1);
Example - Tag panel
var control3 = new longdo.TagPanel();
Example - Custom control
var control5 = new longdo.CustomControl({ html: '<button>go</button>' })
Example - Remove
map.Ui.remove(control1);
Example - Custom layer selector
var buttonTh = longdo.MapTheme.ui.layerSelectorOption.th.button; var buttonEn = longdo.MapTheme.ui.layerSelectorOption.en.button; var layer1 = { label: 'OSM', value: longdo.Layers.OSM }; if (buttonTh.length > 2 && buttonEn.length > 2) { buttonTh[2] = layer1; buttonEn[2] = layer1; }
var dropdown = longdo.MapTheme.ui.layerSelectorDropdown; var layer2 = { label: 'Open Cycle', value: longdo.Layers.OPENCYCLE }; dropdown.unshift(layer2);
Example