Oskari API Documentation

Select bundle

admindown-arrow
cataloguedown-arrow
  • metadata
    Generic functionality to display metadata from a CSW-service
  • metadatasearch
    Provides metadata catalogue search user-interface for an application.
frameworkdown-arrow
  • announcements
    Bundle for displaying announcements made with admin-announcements.
  • Core services
    Provided by the framework
  • layeranalytics
    Map layer problem tracker
  • layerlist
    A layer listing functionality for the geoportal.
  • mydata
    Provides generic container for listing user data and offers other functionalities a way to present user-specific information.
  • Map Publisher 2
    Allows creation of embedded maps
  • RPC
  • Search
    Provides basic search functionality without any UI
  • Selected-featuredata
    Allows infobox opening in new flyout
  • statehandler
    History functionality and state saving.
  • usagetracker
    Pings the server when any of the configured events occur.
mappingdown-arrow
statisticsdown-arrow
  • statsgrid2016
    Statistics data display. This will replace the statsgrid bundle specification when the implementation has the comparable functionalities as the current one. The bundle depends on mapstats-bundle that provides support for statslayer layertype.
uidown-arrow

toolbar

Generic and extensible toolbar implementation

Description

The toolbar bundle provides a common interface for other bundles to add and manipulate tool buttons to a common toolbar. Bundles can add, remove, disable and enable buttons in the toolbar. The toolbar is rendered to a HTML element with id "toolbar". The bundle doesn't create it but assumes it exists on the page.

TODO

  • Currently toolbar has a set of default buttons. These should be added by other bundles instead of configuration for preventing buttons.
  • Handling missing for disabling an active tool (selected tool is disabled through request)

Screenshot

screenshot

Bundle configuration

Toolgroups and tools can be excluded from being added by default.

In the example below, all tools are excluded from the toolbar.

"conf": {
  "history": {
    "reset": false,
    "history_back": false,
    "history_forward": false
  },
  "basictools": {
    "zoombox": false,
    "select": false,
    "measureline": false,
    "measurearea": false
  },
  "viewtools": {
    "link": false,
    "print": false
  }
}

The following example also excludes all the tools from the toolbar, by setting all groups to false.

"conf": {
  "history": false,
  "basictools": false,
  "viewtools": false
}

A toolbar can also contain color configs:

"conf": {
  "colours": {
    "hover": "#ff0000",
    "background": "#00ff00"
  }
}

Hover color is used when hovering icon and Toolbar.ToolbarRequest add operation data not contains color configuration.

Background color is now only used to calculate light/dark icon classes. Configuration is used when Toolbar.ToolbarREquest add operation data not contains color configuration.

Bundle state

state : {
  selected : {
    id : '<id for the selected button>',
    group: '<group for the selected button>'
  }
}

Requests the bundle sends out

Currently default buttons send out requests but these should be defined in bundles that use toolbar.

RequestWhy/when
ToolSelectionRequest tbd
StateHandler.SetStateRequest tbd
ClearHistoryRequest tbd

Dependencies

Depends on an element with id "toolbar" to be present on DOM. Print and link buttons require mapfull bundle, Oskari.userinterface.component.Popup and Oskari.userinterface.component.Button from divmanazer bundle.

DependencyLinked fromPurpose
jQuery Version 1.7.1 assumed to be linked (on page locally in portal) Used to create tool buttons/HTML