RPC events

This guide shows how to enable an Oskari event to be transmitted via RPC. This enables the embedding page to be able to react to events on the embedded application. Existing Oskari events are listed here.

  1. Implement a getParams() function for the Oskari-event:
     * Serialization for RPC
     * @return {Object} object that includes event properties
    getParams: function () {
        return {
            'key': 'value'
  1. Allow the event to be transmitted via RPC:

Either modifying the default allowed events in Oskari/bundles/framework/rpc/instance.js:

     allowedEvents = {
        'AfterMapMoveEvent': true,
        'MapClickedEvent': true,
        'AfterAddMarkerEvent' : true,
        'MarkerClickEvent' : true,
        'MyCustomEvent' : true

Or use the RPC bundle configuration to declare additional events for specific application: RPC bundle documentation

Last modified: Fri Mar 15 2024 14:11:33 GMT+0200 (Eastern European Standard Time)