Oskari API documentation

Select request

admindown-arrow
frameworkdown-arrow
mappingdown-arrow
uidown-arrow

Toolbar.ToolbarRequest

Requests for toolbar to create/show/hide/remove a toolbar.

Use cases

  • Add toolbar
  • Show toolbar
  • Hide toolbar
  • Remove toolbar
  • Change toolbar name

Description

Requests for toolbar to add button with given config

Parameters

(* means the parameter is required)

Name Type Description Default value
\* id String Toolbar identifier
\* op String Toolbar operation: add, show, hide, remove or changeName
\* data Object Operation arguments as properties

Parameters for data-object (add operation):

Name Type Description Default value
disableHover Boolean disable hover false
colours Object Toolbar colours. Now only supported hover colour. For example: {hover:'#ff0000', background: '#ffffff'} {hover: '#3c3c3c', background: '#333438'}
title String Toolbar title true
toolbarContainer Jquery element toolbar container
closeBoxCallback Function close box callback

Examples

Add toolbar (no hover):

var sb = Oskari.getSandbox();
var builder = sb.getRequestBuilder('Toolbar.ToolbarRequest');
var request = builder(
        'ExampleGroup',
        'add',
        {
            show: true,
            toolbarContainer: jQuery('#toolbarContainer'),
            colours: {
                hover: '#ff0000'
            },
            disableHover: true
        }
);
sb.request(me.getName(), request);