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'
        };
    }

2) 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: Tue Mar 07 2017 13:56:13 GMT+0200 (EET)