back | source
Create menu bar
  1. Menu
    var control1 = new longdo.MenuBar({ button: [
      { label: 'first', value: 1 },
      { label: 'second', value: 2 }
    ], change: menuChange });
    map.Ui.add(control1);
    Example
  2. Tag panel
    var control3 = new longdo.TagPanel();
    Example
  3. Custom control
    var control5 = new longdo.CustomControl({ html: '<button>go</button>' })
    Example
  4. Remove
    map.Ui.remove(control1);
    Example
  5. 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);
  6. Example